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

Merge branch 'master' of https://github.com/unacms/UNA

AntonLV 6 месяцев назад
Родитель
Сommit
efee6baab6
81 измененных файлов с 609 добавлено и 96 удалено
  1. 3 3
      inc/classes/BxDolAccount.php
  2. 6 1
      inc/classes/BxDolAcl.php
  3. 48 0
      inc/classes/BxDolAlerts.php
  4. 1 0
      inc/classes/BxDolCmts.php
  5. 19 4
      inc/classes/BxDolCmtsQuery.php
  6. 10 0
      inc/classes/BxDolConnection.php
  7. 2 1
      inc/classes/BxDolConnectionRelation.php
  8. 14 2
      inc/classes/BxDolCover.php
  9. 4 1
      inc/classes/BxDolCronPruning.php
  10. 13 1
      inc/classes/BxDolEmailTemplates.php
  11. 7 0
      inc/classes/BxDolForm.php
  12. 5 0
      inc/classes/BxDolGrid.php
  13. 1 0
      inc/classes/BxDolLabel.php
  14. 3 0
      inc/classes/BxDolMetatags.php
  15. 1 0
      inc/classes/BxDolModuleProxy.php
  16. 1 0
      inc/classes/BxDolPage.php
  17. 1 0
      inc/classes/BxDolPermalinks.php
  18. 14 4
      inc/classes/BxDolProfile.php
  19. 1 1
      inc/classes/BxDolPush.php
  20. 7 2
      inc/classes/BxDolSearch.php
  21. 8 1
      inc/classes/BxDolTemplate.php
  22. 1 0
      inc/profiles.inc.php
  23. 0 0
      install/sql/system.sql
  24. 2 1
      member.php
  25. 4 2
      modules/base/connect/classes/BxBaseModConnectModule.php
  26. 9 1
      modules/base/general/classes/BxBaseModGeneralDb.php
  27. 1 0
      modules/base/general/classes/BxBaseModGeneralFormsEntryHelper.php
  28. 13 2
      modules/base/general/classes/BxBaseModGeneralModule.php
  29. 7 0
      modules/base/general/classes/BxBaseModGeneralTemplate.php
  30. 7 1
      modules/base/groups/classes/BxBaseModGroupsModule.php
  31. 12 3
      modules/base/profile/classes/BxBaseModProfileDb.php
  32. 4 2
      modules/base/profile/classes/BxBaseModProfileModule.php
  33. 19 3
      modules/base/profile/classes/BxBaseModProfileTemplate.php
  34. 7 1
      modules/base/text/classes/BxBaseModTextModule.php
  35. 8 2
      modules/base/text/classes/BxBaseModTextTemplate.php
  36. 7 1
      modules/boonex/ads/classes/BxAdsModule.php
  37. 3 1
      modules/boonex/albums/classes/BxAlbumsDb.php
  38. 5 0
      modules/boonex/analytics/classes/BxAnalyticsModule.php
  39. 3 1
      modules/boonex/artificer/data/template/system/scripts/BxTemplFunctions.php
  40. 2 1
      modules/boonex/channels/classes/BxCnlModule.php
  41. 16 2
      modules/boonex/convos/classes/BxCnvFormEntry.php
  42. 4 0
      modules/boonex/donations/classes/BxDonationsTemplate.php
  43. 1 0
      modules/boonex/english/data/langs/system/en.xml
  44. 2 0
      modules/boonex/events/classes/BxEventsModule.php
  45. 2 1
      modules/boonex/google_tagmanager/classes/BxGoogleTagManModule.php
  46. 1 1
      modules/boonex/intercom/classes/BxIntercomModule.php
  47. 1 1
      modules/boonex/mailchimp/classes/BxMailchimpModule.php
  48. 1 1
      modules/boonex/massmailer/classes/BxMassMailerModule.php
  49. 26 1
      modules/boonex/notifications/classes/BxNtfsDb.php
  50. 9 2
      modules/boonex/notifications/classes/BxNtfsModule.php
  51. 8 1
      modules/boonex/notifications/classes/BxNtfsTemplate.php
  52. 4 0
      modules/boonex/payment/classes/BxPaymentCart.php
  53. 24 0
      modules/boonex/payment/classes/BxPaymentModule.php
  54. 9 2
      modules/boonex/payment/classes/BxPaymentProviderChargebeeV3.php
  55. 16 4
      modules/boonex/payment/classes/BxPaymentProviderStripe.php
  56. 9 2
      modules/boonex/payment/classes/BxPaymentProviderStripeBasic.php
  57. 8 2
      modules/boonex/payment/classes/BxPaymentProviderStripeV3.php
  58. 1 0
      modules/boonex/russian/data/langs/system/ru.xml
  59. 26 2
      modules/boonex/timeline/classes/BxTimelineDb.php
  60. 5 2
      modules/boonex/timeline/classes/BxTimelineModule.php
  61. 7 2
      modules/boonex/timeline/classes/BxTimelineResponse.php
  62. 23 4
      modules/boonex/timeline/classes/BxTimelineTemplate.php
  63. 1 1
      studio/classes/BxDolStudioPermissionsLevels.php
  64. 1 1
      studio/classes/BxDolStudioRolesLevels.php
  65. 27 0
      studio/template/scripts/BxBaseStudioAgentsAgents.php
  66. 1 8
      studio/template/scripts/BxBaseStudioAgentsLogs.php
  67. 7 3
      template/scripts/BxBaseAccountForms.php
  68. 2 1
      template/scripts/BxBaseAcl.php
  69. 11 0
      template/scripts/BxBaseCmts.php
  70. 4 0
      template/scripts/BxBaseCover.php
  71. 1 0
      template/scripts/BxBaseFormAccount.php
  72. 7 1
      template/scripts/BxBaseFormView.php
  73. 4 1
      template/scripts/BxBaseFunctions.php
  74. 4 0
      template/scripts/BxBaseMenuSocialSharing.php
  75. 1 0
      template/scripts/BxBasePage.php
  76. 5 1
      template/scripts/BxBaseSearchExtended.php
  77. 3 1
      template/scripts/BxBaseSearchResult.php
  78. 8 0
      template/scripts/BxBaseServiceAccount.php
  79. 19 2
      template/scripts/BxBaseServiceLogin.php
  80. 9 1
      template/scripts/BxBaseServiceProfiles.php
  81. 8 2
      template/scripts/BxBaseServices.php

+ 3 - 3
inc/classes/BxDolAccount.php

@@ -561,7 +561,7 @@ class BxDolAccount extends BxDolFactory implements iBxDolSingleton
          *      - `display_name` - [string] by ref, account display name,  can be overridden in hook processing
          * @hook @ref hook-account-account_name
          */
-        bx_alert('account', 'account_name', $iAccountId, 0, array('info' => $aInfo, 'display_name' => &$sDisplayName));
+        bx_alert('account', 'account_name', $iAccountId, 0, array('info' => $aInfo, 'display_name' => &$sDisplayName, 'display_name_ref' => &$sDisplayName));
 
         return bx_process_output($sDisplayName);
     }
@@ -811,7 +811,7 @@ class BxDolAccount extends BxDolFactory implements iBxDolSingleton
          *      - `number` - [int] by ref, account limit on the number of profiles,  can be overridden in hook processing
          * @hook @ref hook-account-get_limit_profiles_number
          */
-        bx_alert('account', 'get_limit_profiles_number', 0, 0, array('account_id' => $this->_iAccountID, 'number' => &$iProfilesLimit));
+        bx_alert('account', 'get_limit_profiles_number', 0, 0, array('account_id' => $this->_iAccountID, 'number' => &$iProfilesLimit, 'number_ref' => &$iProfilesLimit));
         if (!isAdmin() && $iProfilesLimit && ($iProfilesNum = $this->getProfilesNumber()) && $iProfilesNum >= $iProfilesLimit)
             return true;
 
@@ -891,7 +891,7 @@ class BxDolAccount extends BxDolFactory implements iBxDolSingleton
          *      - `stop_deletion` - [bool] by ref, if it set to true account deletion will stopped, can be overridden in hook processing
          * @hook @ref hook-account-before_delete
          */
-        bx_alert('account', 'before_delete', $this->_iAccountID, 0, array('delete_with_content' => $bDeleteWithContent, 'stop_deletion' => &$isStopDeletion));
+        bx_alert('account', 'before_delete', $this->_iAccountID, 0, array('delete_with_content' => $bDeleteWithContent, 'stop_deletion' => &$isStopDeletion, 'stop_deletion_ref' => &$isStopDeletion));
         if ($isStopDeletion)
             return false;
 

+ 6 - 1
inc/classes/BxDolAcl.php

@@ -344,7 +344,12 @@ class BxDolAcl extends BxDolFactory implements iBxDolSingleton
             'perform' => &$bPerformAction,
             'result' => &$aResult,
             'lang' => &$aLangFileParams,
-            'continue' => &$bContinue
+            'continue' => &$bContinue,
+            'action_ref' => &$aAction,
+            'perform_ref' => &$bPerformAction,
+            'result_ref' => &$aResult,
+            'lang_ref' => &$aLangFileParams,
+            'continue_ref' => &$bContinue
         ));
 
         if (!$bContinue)

+ 48 - 0
inc/classes/BxDolAlerts.php

@@ -145,6 +145,9 @@ class BxDolAlerts extends BxDol
             }
         }
 
+        // log alert
+        $this->logAlert();
+
         // call agents
         $oAi = BxDolAI::getInstance();
         if($aAgents = $oAi->getAgentsByAlertUnitAndAction($this->sUnit, $this->sAction)) {
@@ -206,6 +209,51 @@ class BxDolAlerts extends BxDol
 
         return $aResult;
     }
+
+    public function logAlert()
+    {
+        $oDb = BxDolDb::getInstance();
+        $aExtraRefs = [];
+        foreach($this->aExtras as $sKey => $mixedValue) {
+            if (preg_match('/^(ref|override|return)_/', $sKey) || preg_match('/_(ref|override|return)$/', $sKey) || $sKey == 'result' || $sKey == 'res' || $sKey == 'return' || $sKey == 'ret' || $sKey == 'check_result') {
+                $aExtraRefs[] = $sKey;
+            }
+        }
+        $aBind = [
+            'unit' => $this->sUnit,
+            'action' => $this->sAction,
+            'object' => $this->iObject,
+            'sender' => $this->iSender,
+            'extra' => json_encode($this->aExtras),
+            'extra_refs' => json_encode($aExtraRefs)
+        ];
+        $oDb->query("
+            INSERT INTO sys_alerts_log
+            SET
+                unit  = :unit,
+                action = :action,
+                object = :object,
+                sender = :sender,
+                extra  = :extra,
+                extra_refs  = :extra_refs,
+                ts     = UNIX_TIMESTAMP(),
+                counter_total = 1,
+                counter_24h = 1
+            ON DUPLICATE KEY UPDATE
+                object = :object,
+                sender = :sender,
+                extra  = :extra,
+                ts     = UNIX_TIMESTAMP(),
+                counter_total = counter_total + 1,
+                counter_24h = counter_24h + 1
+        ", $aBind);
+    }
+
+    static public function resetAlertsCounter24h()
+    {
+        $oDb = BxDolDb::getInstance();
+        $oDb->query("UPDATE sys_alerts_log SET counter_24h = 0");
+    }
 }
 
 class BxDolAlertsResponse extends BxDol

+ 1 - 0
inc/classes/BxDolCmts.php

@@ -2648,6 +2648,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
             'data' => $aData,
             'params' => $aParams,
             'data_api' => &$aDataApi,
+            'data_api_ref' => &$aDataApi,
         ];
 
         /**

+ 19 - 4
inc/classes/BxDolCmtsQuery.php

@@ -307,7 +307,10 @@ class BxDolCmtsQuery extends BxDolDb
             'system' => $this->_oMain->getSystemInfo(), 
             'join_clause' => &$sJoinClause, 
             'where_clause' => &$sWhereClause, 
-            'params' => &$aBindings
+            'params' => &$aBindings,
+            'join_clause_ref' => &$sJoinClause, 
+            'where_clause_ref' => &$sWhereClause, 
+            'params_ref' => &$aBindings
         ]);
         
         $sQuery = "SELECT
@@ -365,7 +368,11 @@ class BxDolCmtsQuery extends BxDolDb
             'select_clause' => &$sSelectClause, 
             'join_clause' => &$sJoinClause, 
             'where_clause' => &$sWhereClause,  
-            'params' => &$aBindings
+            'params' => &$aBindings,
+            'select_clause_ref' => &$sSelectClause, 
+            'join_clause_ref' => &$sJoinClause, 
+            'where_clause_ref' => &$sWhereClause,  
+            'params_ref' => &$aBindings
         ]);
         
         $sQuery = "SELECT
@@ -479,7 +486,13 @@ class BxDolCmtsQuery extends BxDolDb
             'where_clause' => &$sWhereClause, 
             'order_clause' => &$sOrder, 
             'limit_clause' => &$sLimit, 
-            'params' => &$aBindings
+            'params' => &$aBindings,
+            'select_clause_ref' => &$sQuery, 
+            'join_clause_ref' => &$sJoin, 
+            'where_clause_ref' => &$sWhereClause, 
+            'order_clause_ref' => &$sOrder, 
+            'limit_clause_ref' => &$sLimit, 
+            'params_ref' => &$aBindings
         ]);
 
         $sQuery = $sQuery . $sJoin . " WHERE `{$this->_sTable}`.`cmt_object_id`=:cmt_object_id AND (ISNULL(`p`.`status`) OR `p`.`status`='active' OR `{$this->_sTable}`.`cmt_replies`!=0)" . $sWhereClause . $sOrder . $sLimit;
@@ -614,7 +627,9 @@ class BxDolCmtsQuery extends BxDolDb
                 BxDolSearchExtended::processParams($aParams['search_params'], [
                     'table' => $this->_sTable,
                     'bindings' => &$aMethod['params'][1],
-                    'where_clause' => &$sWhereClause
+                    'where_clause' => &$sWhereClause,
+                    'bindings_ref' => &$aMethod['params'][1],
+                    'where_clause_ref' => &$sWhereClause
                 ]);
 
                 if(($oCf = $this->_oMain->getObjectContentFilter()) !== false)

+ 10 - 0
inc/classes/BxDolConnection.php

@@ -372,6 +372,11 @@ class BxDolConnection extends BxDolFactory implements iBxDolFactoryObject
             'initiator' => &$iInitiator,
             'content' => &$iContent,
             'mutual' => &$iMutual,
+
+            'initiator_ref' => &$iInitiator,
+            'content_ref' => &$iContent,
+            'mutual_ref' => &$iMutual,
+
             'object' => $this,
             'override_result' => &$iOverrideResult,
         ];
@@ -489,6 +494,11 @@ class BxDolConnection extends BxDolFactory implements iBxDolFactoryObject
             'initiator' => &$iInitiator,
             'content' => &$iContent,
             'mutual' => &$iMutual,
+
+            'initiator_ref' => &$iInitiator,
+            'content_ref' => &$iContent,
+            'mutual_ref' => &$iMutual,
+
             'object' => $this,
         ];
         if(!empty($aParams['alert_extras']) && is_array($aParams['alert_extras']))

+ 2 - 1
inc/classes/BxDolConnectionRelation.php

@@ -305,7 +305,8 @@ class BxDolConnectionRelation extends BxTemplConnection
             'initiator' => (int)$iInitiator,
             'content' => (int)$iContent,
             'pre_list' => $this->_sPreList,
-            'relations' => &$aRelations
+            'relations' => &$aRelations,
+            'relations_ref' => &$aRelations
         ]);
 
         if($this->isConnected($iContent, $iInitiator)) {

+ 14 - 2
inc/classes/BxDolCover.php

@@ -149,7 +149,15 @@ class BxDolCover extends BxDolFactory implements iBxDolSingleton
          *      - `cover` - [object] object cover
          * @hook @ref hook-system-set_cover
          */
-        bx_alert('system', 'set_cover', 0, false, array('options' => &$this->_aOptions, 'template_name' => &$this->_sTemplateName, 'cover' => $this));
+        bx_alert('system', 'set_cover', 0, false, array(
+            'options' => &$this->_aOptions, 
+            'template_name' => &$this->_sTemplateName, 
+
+            'options_ref' => &$this->_aOptions, 
+            'template_name_ref' => &$this->_sTemplateName, 
+
+            'cover' => $this
+        ));
     }
 
     /**
@@ -183,7 +191,11 @@ class BxDolCover extends BxDolFactory implements iBxDolSingleton
          *      - `cover` - [object] object cover
          * @hook @ref hook-system-set_cover_image
          */
-        bx_alert('system', 'set_cover_image', 0, false, array('cover_image' => &$this->_sCoverImageUrl, 'cover' => $this));
+        bx_alert('system', 'set_cover_image', 0, false, array(
+            'cover_image' => &$this->_sCoverImageUrl,
+            'cover_image_ref' => &$this->_sCoverImageUrl, 
+            'cover' => $this
+        ));
 
         return true;
     }

+ 4 - 1
inc/classes/BxDolCronPruning.php

@@ -74,7 +74,10 @@ class BxDolCronPruning extends BxDolCron
 
         // clean ai related data
         $iDeletedItems = BxDolAI::pruning();
-        
+
+        // reset Alert counters
+        BxDolAlerts::resetAlertsCounter24h();
+
         echo call_user_func_array('_t', ['_sys_pruning_db', 
             $iDeleteMemLevels, 
             $iSessions, $iDeletedKeys, 

+ 13 - 1
inc/classes/BxDolEmailTemplates.php

@@ -144,7 +144,19 @@ class BxDolEmailTemplates extends BxDolFactory implements iBxDolSingleton
          *      - `template` - [array] by ref, template, can be overridden in hook processing
          * @hook @ref hook-system-parse_email_template
          */
-        bx_alert('system', 'parse_email_template', 0, 0, array('template_name' => &$sTemplateName, 'template_keys' => &$aTemplateKeys, 'account_id' => &$iAccountId, 'profile_id' => &$iProfileId, 'template' => &$aTemplate));
+        bx_alert('system', 'parse_email_template', 0, 0, array(
+            'template_name' => &$sTemplateName, 
+            'template_keys' => &$aTemplateKeys, 
+            'account_id' => &$iAccountId, 
+            'profile_id' => &$iProfileId, 
+            'template' => &$aTemplate,
+
+            'template_name_ref' => &$sTemplateName, 
+            'template_keys_ref' => &$aTemplateKeys, 
+            'account_id_ref' => &$iAccountId, 
+            'profile_id_ref' => &$iProfileId, 
+            'template_ref' => &$aTemplate
+        ));
         
         if (!$aTemplate)
             return false;

+ 7 - 0
inc/classes/BxDolForm.php

@@ -885,6 +885,7 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
          */
         bx_alert('system', 'form_check', 0, 0, [
             'object' => &$this,
+            'inputs_ref' => &$this->aInputs,
         ]);
     }
 
@@ -931,6 +932,7 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
                 'module' => isset($this->aParams['module']) ? $this->aParams['module'] : '',
                 'entry_id' => $iRes,
                 'form_object' => &$this,
+                'inputs_ref' => &$this->aInputs,
             ]);
 
             return $iRes;
@@ -968,6 +970,7 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
             'module' => isset($this->aParams['module']) ? $this->aParams['module'] : '',
             'entry_id' => $val,
             'form_object' => &$this,
+            'inputs_ref' => &$this->aInputs,
         ]);
 
         return $bRes;
@@ -1829,6 +1832,10 @@ class BxDolFormCheckerHelper
         bx_alert('system', 'check_spam', 0, getLoggedId(), [
             'is_spam' => &$bSpam, 
             'content' => &$val, 
+
+            'is_spam_ref' => &$bSpam, 
+            'content_ref' => &$val,
+
             'where' => 'form', 
             'type' => $sType
         ]);

+ 5 - 0
inc/classes/BxDolGrid.php

@@ -566,9 +566,14 @@ class BxDolGrid extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
             'markers' => $this->_aMarkers, 
             'filter' => $sFilter, 
             'browse_params' => $this->_aBrowseParams, 
+
             'query' => &$sQuery,
             'conditions' => &$sCond,
             'join' => &$sJoin,
+
+            'query_ref' => &$sQuery,
+            'conditions_ref' => &$sCond,
+            'join_ref' => &$sJoin,
         ]);
 
         // add WHERE for searching in translatable fields

+ 1 - 0
inc/classes/BxDolLabel.php

@@ -121,6 +121,7 @@ class BxDolLabel extends BxDolFactory implements iBxDolSingleton
 
         bx_alert('meta_keyword', 'url', 0, false, array(
            'url' => &$sUrl,
+           'url_ref' => &$sUrl,
            'keyword' => $sKeyword,
            'section' => $mixedSection,
         ));

+ 3 - 0
inc/classes/BxDolMetatags.php

@@ -549,6 +549,7 @@ class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
          */
         bx_alert('meta_keyword', 'url', 0, false, [
             'url' => &$sUrl,
+            'url_ref' => &$sUrl,
             'keyword' => $sKeyword,
             'id' => $iId,
             'object' => $this->_sObject,
@@ -1180,6 +1181,7 @@ class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
          */
         bx_alert('meta_' . $sAlertName, 'before_add_multiple', 'mention' == $sAlertName ? 0 : $iId, bx_get_logged_profile_id(), [
             'metas' => &$aMetas,
+            'metas_ref' => &$aMetas,
             'text' => $s,
             'content_id' => $iId, 
             'object' => $this->_sObject
@@ -1211,6 +1213,7 @@ class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
                  */
                 bx_alert('meta_' . $sAlertName, 'before_added', $iObjectId, bx_get_logged_profile_id(), [
                     'meta' => &$sMeta, 
+                    'meta_ref' => &$sMeta, 
                     'content_id' => $iId, 
                     'object' => $this->_sObject
                 ]);

+ 1 - 0
inc/classes/BxDolModuleProxy.php

@@ -58,6 +58,7 @@ class BxDolModuleProxy
             bx_alert($this->_sObjectType . '_method_call', $sMethodName, 0, 0, [
                 'module' => $oModule, 
                 'args' => &$aArguments, 
+                'args_ref' => &$aArguments,
                 'override_result' => &$res
             ]);
             if (null !== $res)

+ 1 - 0
inc/classes/BxDolPage.php

@@ -563,6 +563,7 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
                         'param_value' => $sSeoParamValue,
                         'title' => $sSeoTitle,
                         'uri' => &$sUri,
+                        'uri_ref' => &$sUri,
                     ]);
 
                     BxDolPageQuery::insertSeoLink($sPageModule, $sPageUri, $sSeoParamName, $sSeoParamValue, $sUri);

+ 1 - 0
inc/classes/BxDolPermalinks.php

@@ -178,6 +178,7 @@ class BxDolPermalinks extends BxDolDb implements iBxDolSingleton
         bx_alert('system', 'permalink', 0, 0, [
             'link' => $sLink, 
             'params' => &$aParams, 
+            'params_ref' => &$aParams, 
             'return_data' => &$sRet
         ]);
         if (null !== $sRet)

+ 14 - 4
inc/classes/BxDolProfile.php

@@ -367,7 +367,11 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
          *      - `display_name` - [bool] by ref, display profile name, can be overridden in hook processing
          * @hook @ref hook-profile-profile_name
          */
-        bx_alert('profile', 'profile_name', $iProfileId, 0, array('info' => $aInfo, 'display_name' => &$sDisplayName));
+        bx_alert('profile', 'profile_name', $iProfileId, 0, array(
+            'info' => $aInfo, 
+            'display_name' => &$sDisplayName,
+            'display_name_ref' => &$sDisplayName
+        ));
         return $sDisplayName;
     }
     
@@ -576,7 +580,7 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
          *      - `type` - [string] module name
          * @hook @ref hook-profile-before_delete
          */
-        bx_alert('profile', 'before_delete', $ID, 0, array('delete_with_content' => $bDeleteWithContent, 'stop_deletion' => &$isStopDeletion, 'type' => $aProfileInfo['type']));
+        bx_alert('profile', 'before_delete', $ID, 0, array('delete_with_content' => $bDeleteWithContent, 'stop_deletion' => &$isStopDeletion, 'stop_deletion_ref' => &$isStopDeletion, 'type' => $aProfileInfo['type']));
         if ($isStopDeletion)
             return false;
 
@@ -661,7 +665,7 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
          *      - `profile_id` - [int] by ref, iprofile_id, can be overridden in hook processing
          * @hook @ref hook-profile-add
          */
-        bx_alert('profile', 'add', $iProfileId, 0, array('module' => $sType, 'content' => $iContentId, 'account' => $iAccountId, 'status' => $sStatus, 'action' => $iAction, 'profile_id' => &$iProfileId));
+        bx_alert('profile', 'add', $iProfileId, 0, array('module' => $sType, 'content' => $iContentId, 'account' => $iAccountId, 'status' => $sStatus, 'action' => $iAction, 'profile_id' => &$iProfileId, 'profile_id_ref' => &$iProfileId));
         return $iProfileId;
     }
 
@@ -759,7 +763,13 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
          *      - `send_email_notification` - [bool] by ref, if need to send notification about changed status = true, otherwise false, can be overridden in hook processing
          * @hook @ref hook-profile-approve
          */
-        bx_alert('profile', $sAlertActionName, $iProfileId, false, array('action' => $iAction, 'status' => &$sStatus, 'send_email_notification' => &$bSendEmailNotification));
+        bx_alert('profile', $sAlertActionName, $iProfileId, false, array(
+            'action' => $iAction, 
+            'status' => &$sStatus, 
+            'status_ref' => &$sStatus, 
+            'send_email_notification' => &$bSendEmailNotification,
+            'send_email_notification_ref' => &$bSendEmailNotification
+        ));
         
         $this->doAudit('_sys_audit_action_set_status_' . $sStatus);
         

+ 1 - 1
inc/classes/BxDolPush.php

@@ -69,7 +69,7 @@ class BxDolPush extends BxDolFactoryObject
          *      - `tags` - [array] by ref, array of tags, can be overridden in hook processing
          * @hook @ref hook-system-push_tags
          */
-        bx_alert('system', 'push_tags', $iProfileId, $iProfileId, array('tags' => &$a));
+        bx_alert('system', 'push_tags', $iProfileId, $iProfileId, array('tags' => &$a, 'tags_ref' => &$a));
 
         return $a;
     }

+ 7 - 2
inc/classes/BxDolSearch.php

@@ -812,6 +812,7 @@ class BxDolSearchResult implements iBxDolReplaceable
          */
         bx_alert('simple_search', 'before_get_data', 0, false, [
             'object' => &$this->aCurrent, 
+            'object_ref' => &$this->aCurrent, 
             'mode' => $this->_sMode
         ]);
 
@@ -836,8 +837,10 @@ class BxDolSearchResult implements iBxDolReplaceable
          */
         bx_alert('simple_search', 'get_data', 0, false, [
             'object' => &$this->aCurrent, 
+            'object_ref' => &$this->aCurrent, 
             'mode' => $this->_sMode, 
-            'search_results' => &$aData
+            'search_results' => &$aData,
+            'search_results_ref' => &$aData
         ]);
 
         return $aData;
@@ -878,9 +881,11 @@ class BxDolSearchResult implements iBxDolReplaceable
          */
         bx_alert('simple_search', 'get_query', 0, false, [
             'object' => &$this->aCurrent, 
+            'object_ref' => &$this->aCurrent, 
             'mode' => $this->_sMode, 
             'search_object' => $sObject,
-            'search_query' => &$aQuery
+            'search_query' => &$aQuery,
+            'search_query_ref' => &$aQuery
         ]);
 
         return $aQuery;

+ 8 - 1
inc/classes/BxDolTemplate.php

@@ -3077,6 +3077,8 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
                         'system' => $bSystem,
                         'url' => &$sUrl,
                         'path' => &$sPath,
+                        'url_ref' => &$sUrl,
+                        'path_ref' => &$sPath,
                     ]);
 
                     if($bDynamic)
@@ -3858,7 +3860,12 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
          *      - `page_content` - [array] by ref, page content values, can be overridden in hook processing
          * @hook @ref hook-system-design_before_output
          */
-        bx_alert('system', 'design_before_output', 0, 0, ['page' => &$this->aPage, 'page_content' => &$this->aPageContent]);
+        bx_alert('system', 'design_before_output', 0, 0, [
+            'page' => &$this->aPage, 
+            'page_content' => &$this->aPageContent,
+            'page_ref' => &$this->aPage, 
+            'page_content_ref' => &$this->aPageContent
+        ]);
 
         header( 'Content-type: text/html; charset=utf-8' );
         $sXFrameOpts = getParam('sys_x_frame_options');

+ 1 - 0
inc/profiles.inc.php

@@ -300,6 +300,7 @@ function bx_check_password($sLogin, $sPassword, $iRole = BX_DOL_ROLE_MEMBER)
             'info' => $aAccountInfo,
 			'pwd' => $sPassword,
             'password' => &$sPassCheck,
+            'password_ref' => &$sPassCheck,
         ));
     
     if ($sErrorMsg = bx_check_login($aAccountInfo['id'], $sPassCheck, $iRole)){

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
install/sql/system.sql


+ 2 - 1
member.php

@@ -68,7 +68,8 @@ if (isset($_POST['ID'])) { // login form is submitted
 
             bx_alert('account', 'login_after', $oAccount->id(),  false, array(
                 'account' => $aAccount,
-                'url_relocate' => &$sUrlRelocate               
+                'url_relocate' => &$sUrlRelocate,
+                'url_relocate_ref' => &$sUrlRelocate,
             ));
 
             BxDolTemplate::getInstance()->setPageNameIndex (BX_PAGE_TRANSITION);

+ 4 - 2
modules/base/connect/classes/BxBaseModConnectModule.php

@@ -179,7 +179,7 @@ class BxBaseModConnectModule extends BxBaseModGeneralModule
 
         /**
          * @hooks
-         * @hookdef hook-bx_base_connect-fields_converted '{module_name}', 'fields_converted' - hook before a profile was created, which allows to modify account and/or profile fields before creation
+         * @hookdef hook-bx_base_connect-fields_converted '{module_name}', 'fields_converted' - hook before a profile is created, which allows to modify account and/or profile fields before creation
          * - $unit_name - module name
          * - $action - equals `fields_converted`
          * - $object_id - not used
@@ -239,8 +239,10 @@ class BxBaseModConnectModule extends BxBaseModGeneralModule
          */
         bx_alert('account', 'check_join', 0, false, [
             'error_msg' => &$sErrorMsg, 
+            'error_msg_ref' => &$sErrorMsg, 
             'email' => $aFieldsAccount['email'], 
-            'approve' => &$bSetPendingApproval
+            'approve' => &$bSetPendingApproval,
+            'approve_ref' => &$bSetPendingApproval
         ]);
         if ($sErrorMsg)
             return $sErrorMsg;

+ 9 - 1
modules/base/general/classes/BxBaseModGeneralDb.php

@@ -107,7 +107,15 @@ class BxBaseModGeneralDb extends BxDolModuleDb
                     'where_clause' => &$sWhereClause, 
                     'order_clause' => &$sOrderClause, 
                     'limit_clause' => &$sLimitClause, 
-                    'bindings' => &$aMethod['params'][1]
+                    'bindings' => &$aMethod['params'][1],
+
+                    'params_ref' => &$aParams, 
+                    'select_clause_ref' => &$sSelectClause, 
+                    'join_clause_ref' => &$sJoinClause, 
+                    'where_clause_ref' => &$sWhereClause, 
+                    'order_clause_ref' => &$sOrderClause, 
+                    'limit_clause_ref' => &$sLimitClause, 
+                    'bindings_ref' => &$aMethod['params'][1]
                 ]);
                 break;
 

+ 1 - 0
modules/base/general/classes/BxBaseModGeneralFormsEntryHelper.php

@@ -589,6 +589,7 @@ class BxBaseModGeneralFormsEntryHelper extends BxDolProfileForms
         bx_alert($this->_oModule->getName(), 'redirect_after_delete', 0, false, [
             'content' => $aContentInfo,
             'markers' => &$aMarkers,
+            'markers_ref' => &$aMarkers,
             'override_result' => &$sUrl,
         ]);
 

+ 13 - 2
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -1718,6 +1718,7 @@ class BxBaseModGeneralModule extends BxDolModule
         bx_alert('system', 'get_forms_helper', 0, 0, [
             'module' => $this->getName(),
             'class' => &$sClass,
+            'class_ref' => &$sClass,
             'object' => &$oObject
         ]);
 
@@ -3738,7 +3739,12 @@ class BxBaseModGeneralModule extends BxDolModule
             'mode' => &$sMode,
             'params' => &$aParams,
             'class' => &$sClass,
-            'object' => &$oObject
+            'object' => &$oObject,
+
+            'mode_ref' => &$sMode,
+            'params_ref' => &$aParams,
+            'class_ref' => &$sClass,
+            'object_ref' => &$oObject
         ]);
 
         if($oObject !== null) 
@@ -4362,6 +4368,7 @@ class BxBaseModGeneralModule extends BxDolModule
             'data' => $aData,
             'params' => $aParams,
             'data_api' => &$aDataApi,
+            'data_api_ref' => &$aDataApi,
         ];
 
         /**
@@ -4518,8 +4525,12 @@ class BxBaseModGeneralModule extends BxDolModule
             'content_id' => $iContentId,
             'content_info' => $aContentInfo,
             'form' => $oForm,
+
             'email_template' => &$sETemplate,
-            'email_params' => &$aEParams
+            'email_params' => &$aEParams,
+
+            'email_template_ref' => &$sETemplate,
+            'email_params_ref' => &$aEParams
         ]);
 
         return sendMailTemplate($sETemplate, 0, $aContentInfo[$CNF['FIELD_AUTHOR']], $aEParams);

+ 7 - 0
modules/base/general/classes/BxBaseModGeneralTemplate.php

@@ -90,6 +90,13 @@ class BxBaseModGeneralTemplate extends BxDolModuleTemplate
             'object' => &$sJsObject,
             'class' => &$sJsClass,
             'params' => &$aParams,
+
+            'mask_ref' => &$sMask,
+            'mask_markers_ref' => &$aMaskMarkers,
+            'object_ref' => &$sJsObject,
+            'class_ref' => &$sJsClass,
+            'params_ref' => &$aParams,
+
             'override_result' => &$sContent,
         ]);
 

+ 7 - 1
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -2440,10 +2440,16 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
          */
         bx_alert('system', 'prepare_alert_params', 0, 0, [
             'unit'=> $sModule, 
+            
             'action' => &$sAction, 
             'object_id' => &$iId, 
             'sender_id' => &$iAuthorId, 
-            'extras' => &$aParams
+            'extras' => &$aParams,
+
+            'action_ref' => &$sAction, 
+            'object_id_ref' => &$iId, 
+            'sender_id_ref' => &$iAuthorId, 
+            'extras_ref' => &$aParams
         ]);
         /**
          * @hooks

+ 12 - 3
modules/base/profile/classes/BxBaseModProfileDb.php

@@ -47,7 +47,8 @@ class BxBaseModProfileDb extends BxBaseModGeneralDb
          */
         bx_alert('profile', 'content_info_by_id', $iContentId, 0, [
             'module' => $this->_oConfig->getName(), 
-            'info' => &$aInfo
+            'info' => &$aInfo,
+            'info_ref' => &$aInfo
         ]);
 
         return $aInfo;
@@ -74,7 +75,8 @@ class BxBaseModProfileDb extends BxBaseModGeneralDb
          */
         bx_alert('profile', 'content_info_by_profile_id', $iProfileId, 0, [
             'module' => $this->_oConfig->getName(), 
-            'info' => &$aInfo
+            'info' => &$aInfo,
+            'info_ref' => &$aInfo
         ]);
         return $aInfo;
     }
@@ -152,11 +154,18 @@ class BxBaseModProfileDb extends BxBaseModGeneralDb
             'module' => $this->_oConfig->getName(), 
             'params' => $mixedParams['search_params'] ?? '',
             'table' => $this->_oConfig->CNF['TABLE_ENTRIES'], 
+
             'select' => &$sSelect,  
             'join' => &$sJoin, 
             'where' => &$sWhere, 
             'order_by' => &$sOrderBy,
-            'limit' => &$sLimit
+            'limit' => &$sLimit,
+
+            'select_ref' => &$sSelect,  
+            'join_ref' => &$sJoin, 
+            'where_ref' => &$sWhere, 
+            'order_by_ref' => &$sOrderBy,
+            'limit_ref' => &$sLimit
         ]);
 
         return $this->getAll("SELECT " . $sSelect . " FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` AS `c` " . $sJoin . " WHERE " . $sWhere . $sOrderBy . $sLimit, $aBindings);

+ 4 - 2
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -555,7 +555,8 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
          */
         bx_alert($this->getName(), 'profile_name', $aContentInfo['profile_id'], 0, [
             'info' => $aContentInfo, 
-            'display_name' => &$sDisplayName
+            'display_name' => &$sDisplayName,
+            'display_name_ref' => &$sDisplayName
         ]);
         
         return $sDisplayName;
@@ -668,7 +669,8 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
          */
         bx_alert('system', 'get_participating_profiles', $iProfileId, false, [
             'module' => $this->_oConfig->getName(),
-            'profiles' => &$aRet
+            'profiles' => &$aRet,
+            'profiles_ref' => &$aRet
         ]);
 
         return $aRet;

+ 19 - 3
modules/base/profile/classes/BxBaseModProfileTemplate.php

@@ -130,8 +130,16 @@ class BxBaseModProfileTemplate extends BxBaseModGeneralTemplate
             'check_private_content' => $isCheckPrivateContent,
             'template' => $mixedTemplate,
             'params' => $aParams,
+
             'tmpl_name' => &$sTemplate,
-            'tmpl_vars' => &$aVars
+            'tmpl_vars' => &$aVars,
+            'tmpl_name_ref' => &$sTemplate,
+            'tmpl_vars_ref' => &$aVars,
+
+            'tmpl_name_ref' => &$sTemplate,
+            'tmpl_vars_ref' => &$aVars,
+            'tmpl_name_ref' => &$sTemplate,
+            'tmpl_vars_ref' => &$aVars
         ];
         
         /**
@@ -489,8 +497,12 @@ class BxBaseModProfileTemplate extends BxBaseModGeneralTemplate
                    'transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_COVER'],
                    'field' => $CNF['FIELD_COVER'],
                    'is_background' => true,
+
                    'add_class' => &$sAddClassCover,
-                   'add_code' => &$sAddCode
+                   'add_code' => &$sAddCode,
+
+                   'add_class_ref' => &$sAddClassCover,
+                   'add_code_ref' => &$sAddCode
                 ]);
             }
             
@@ -562,8 +574,12 @@ class BxBaseModProfileTemplate extends BxBaseModGeneralTemplate
                    'transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_AVATAR_BIG'],
                    'field' => $CNF['FIELD_PICTURE'],
                    'is_background' => false,
+
                    'add_class' => &$sAddClassPicture,
-                   'add_code' => &$sAddCode
+                   'add_code' => &$sAddCode,
+
+                   'add_class_ref' => &$sAddClassPicture,
+                   'add_code_ref' => &$sAddCode,
                 ]); 
             }
             

+ 7 - 1
modules/base/text/classes/BxBaseModTextModule.php

@@ -507,10 +507,16 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
          */
         bx_alert('system', 'prepare_alert_params', 0, 0, [
             'unit'=> $this->getName(), 
+
             'action' => &$sAction, 
             'object_id' => &$iId, 
             'sender_id' => &$iAuthorId, 
-            'extras' => &$aParams
+            'extras' => &$aParams,
+
+            'action_ref' => &$sAction, 
+            'object_id_ref' => &$iId, 
+            'sender_id_ref' => &$iAuthorId, 
+            'extras_ref' => &$aParams
         ]);
 
         /**

+ 8 - 2
modules/base/text/classes/BxBaseModTextTemplate.php

@@ -76,8 +76,12 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
             'check_private_content' => $isCheckPrivateContent,
             'template' => $sTemplateName,
             'params' => $aParams,
+
             'tmpl_name' => &$sTemplateName,
-            'tmpl_vars' => &$aTemplateVars
+            'tmpl_vars' => &$aTemplateVars,
+
+            'tmpl_name_ref' => &$sTemplateName,
+            'tmpl_vars_ref' => &$aTemplateVars,
         ]);
 
         return $this->parseHtmlByName($sTemplateName, $aTemplateVars);
@@ -318,7 +322,9 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
                 'field' => $aImageParams['field'],
                 'is_background' => false,
                 'add_class' => &$sAddClassPicture,
-                'add_code' => &$sAddCode
+                'add_code' => &$sAddCode,
+                'add_class_ref' => &$sAddClassPicture,
+                'add_code_ref' => &$sAddCode,
             ]); 
         }
 

+ 7 - 1
modules/boonex/ads/classes/BxAdsModule.php

@@ -1378,10 +1378,16 @@ class BxAdsModule extends BxBaseModTextModule
         bx_alert($sModule, 'license_register_notif', 0, false, [
             'entry_id' => $iEntryId,
             'order' => $sOrder,
+
             'recipient_id' => &$iClientId,
             'email_template' => &$sEmailTemplate,
             'email_params' => &$aEmailParams,
-            'cancel' => &$bCancel
+            'cancel' => &$bCancel,
+
+            'recipient_id_ref' => &$iClientId,
+            'email_template_ref' => &$sEmailTemplate,
+            'email_params_ref' => &$aEmailParams,
+            'cancel_ref' => &$bCancel
         ]);
 
         if(!$bCancel)

+ 3 - 1
modules/boonex/albums/classes/BxAlbumsDb.php

@@ -126,7 +126,9 @@ class BxAlbumsDb extends BxBaseModTextDb
                 BxDolSearchExtended::processParams($aParams['search_params'], [
                     'table' => $CNF['TABLE_FILES2ENTRIES'],
                     'bindings' => &$aMethod['params'][1],
-                    'where_clause' => &$sWhereClause
+                    'where_clause' => &$sWhereClause,
+                    'bindings_ref' => &$aMethod['params'][1],
+                    'where_clause_ref' => &$sWhereClause
                 ]);
 
                 $sOrderClause .=  "`{$CNF['TABLE_FILES2ENTRIES']}`.`id` ASC";

+ 5 - 0
modules/boonex/analytics/classes/BxAnalyticsModule.php

@@ -126,6 +126,7 @@ class BxAnalyticsModule extends BxDolModule
          */
         bx_alert($this->_aModule['name'], 'get_modules', 0, 0, array(
             'list' => &$aResult,
+            'list_ref' => &$aResult,
         ));
         
         return $aResult;
@@ -184,6 +185,7 @@ class BxAnalyticsModule extends BxDolModule
         bx_alert($this->_aModule['name'], 'get_reports', 0, 0, array(
             'module' => $sModuleName,
             'list' => &$aRv,
+            'list_ref' => &$aRv,
         ));
         
         echo json_encode($aRv);
@@ -358,10 +360,13 @@ class BxAnalyticsModule extends BxDolModule
                     'module' => $sModuleName,
                     'report_name' => $sReportName,
                     'report_type' => &$sReportType,
+                    'report_type_ref' => &$sReportType,
                     'date_from' => $iDateFrom,
                     'date_to' => $iDateTo,
                     'data' => &$aData,
+                    'data_ref' => &$aData,
                     'prev_value' => &$iValuePrev,
+                    'prev_value_ref' => &$iValuePrev,
                 ));
                 
                 

+ 3 - 1
modules/boonex/artificer/data/template/system/scripts/BxTemplFunctions.php

@@ -184,7 +184,9 @@ class BxTemplFunctions extends BxBaseFunctions
 
         bx_alert('system', 'get_logo', 0, 0, [
             'tmpl_name' => &$sTmplName,
-            'tmpl_vars' => &$aTmplVars
+            'tmpl_vars' => &$aTmplVars,
+            'tmpl_name_ref' => &$sTmplName,
+            'tmpl_vars_ref' => &$aTmplVars,
         ]);
 
         return $this->_oTemplate->parseHtmlByName($sTmplName, $aTmplVars);

+ 2 - 1
modules/boonex/channels/classes/BxCnlModule.php

@@ -141,7 +141,8 @@ class BxCnlModule extends BxBaseModGroupsModule
             'action' => 'hashtag_added_notif', 
             'object_id' => $mixedCnlId, 
             'sender_id' => $iCnlProfileId, 
-            'extras' => &$aParams
+            'extras' => &$aParams,
+            'extras_ref' => &$aParams
         ]);
         
         /**

+ 16 - 2
modules/boonex/convos/classes/BxCnvFormEntry.php

@@ -67,7 +67,15 @@ class BxCnvFormEntry extends BxBaseModTextFormEntry
          *      - `where` - [string] module name
          * @hook @ref hook-system-check_spam
          */
-        bx_alert('system', 'check_spam', 0, getLoggedId(), array('is_spam' => &$bSpam, 'content' => &$sValue, 'where' => $this->MODULE));
+        bx_alert('system', 'check_spam', 0, getLoggedId(), array(
+            'is_spam' => &$bSpam, 
+            'content' => &$sValue, 
+
+            'is_spam_ref' => &$bSpam, 
+            'content_ref' => &$sValue, 
+
+            'where' => $this->MODULE
+        ));
         self::setSubmittedValue($CNF['FIELD_TEXT'], $sValue, $this->aFormAttrs['method']);
 
         if($iContentId) {
@@ -141,7 +149,13 @@ class BxCnvFormEntry extends BxBaseModTextFormEntry
                      *      - `where` - [string] module name
                      * @hook @ref hook-profile-check_contact
                      */
-                    bx_alert('profile', 'check_contact', 0, false, array('can_contact' => &$bCanContact, 'sender' => $iSender, 'recipient' => $iRecipient, 'where' => $this->MODULE));
+                    bx_alert('profile', 'check_contact', 0, false, array(
+                        'can_contact' => &$bCanContact, 
+                        'can_contact_ref' => &$bCanContact, 
+                        'sender' => $iSender, 
+                        'recipient' => $iRecipient, 
+                        'where' => $this->MODULE
+                    ));
                     if(!$bCanContact)
                         $iFolder = BX_CNV_FOLDER_SPAM;
                 }

+ 4 - 0
modules/boonex/donations/classes/BxDonationsTemplate.php

@@ -167,6 +167,10 @@ class BxDonationsTemplate extends BxBaseModGeneralTemplate
         bx_alert($this->_oConfig->getName(), 'donate', 0, 0, [
             'tmpl_name' => &$sTmplName,
             'tmpl_vars' => &$aTmplVars,
+
+            'tmpl_name_ref' => &$sTmplName,
+            'tmpl_vars_ref' => &$aTmplVars,
+
             'override_result' => &$sResult
         ]);
         if($sResult !== null)

+ 1 - 0
modules/boonex/english/data/langs/system/en.xml

@@ -2256,6 +2256,7 @@
 
     <string name="_sys_agents_form_field_err_enter"><![CDATA[This field is essential. Please enter something here.]]></string>
     <string name="_sys_agents_form_field_err_select"><![CDATA[This field is essential. Please select something here.]]></string>
+    <string name="_sys_agents_form_field_err_profile_has_agent"><![CDATA[This profile is already used in another agent({0}) with the same 'message' trigger.]]></string>
     <string name="_sys_agents_json_field_err"><![CDATA[Invalid JSON format.]]></string>
     <string name="_sys_agents_automators_txt_active"><![CDATA[Active]]></string>
     <string name="_sys_agents_automators_txt_name"><![CDATA[Name]]></string>

+ 2 - 0
modules/boonex/events/classes/BxEventsModule.php

@@ -283,6 +283,8 @@ class BxEventsModule extends BxBaseModGroupsModule implements iBxDolCalendarServ
             'end' =>  $sEnd,
             'sql_part' => &$aSQLPart,
             'data' => &$aEntries,
+            'sql_part_ref' => &$aSQLPart,
+            'data_ref' => &$aEntries,
         ));
 
         return [

+ 2 - 1
modules/boonex/google_tagmanager/classes/BxGoogleTagManModule.php

@@ -45,7 +45,8 @@ class BxGoogleTagManModule extends BxDolModule
             );
 
             bx_alert($this->getName(), 'get_data_layer', 0, 0, [
-                'data' => &$aDataLayer
+                'data' => &$aDataLayer,
+                'data_ref' => &$aDataLayer
             ]);
 
             $sDataLayer = json_encode($aDataLayer);

+ 1 - 1
modules/boonex/intercom/classes/BxIntercomModule.php

@@ -67,7 +67,7 @@ class BxIntercomModule extends BxDolModule
             $aSettings['all profiles'] = $sProfiles;
         }
 
-        bx_alert('bx_intercom', 'integration', $oProfile ? $oProfile->id() : 0, $oProfile ? $oProfile->id() : 0, array('settings' => &$aSettings));
+        bx_alert('bx_intercom', 'integration', $oProfile ? $oProfile->id() : 0, $oProfile ? $oProfile->id() : 0, array('settings' => &$aSettings, 'settings_ref' => &$aSettings));
         
         $sSettings = json_encode($aSettings);
 

+ 1 - 1
modules/boonex/mailchimp/classes/BxMailchimpModule.php

@@ -246,7 +246,7 @@ class BxMailchimpModule extends BxDolModule
         if(($sResetPasswordUrl = bx_get_reset_password_link($sEmail)) !== false)
             $aMarkers['RPASS_URL'] = $sResetPasswordUrl;
 
-        bx_alert($this->_aModule['name'], 'user_fields', $iAccountId, $iProfileId, array('email' => $sEmail, 'markers' => &$aMarkers));	
+        bx_alert($this->_aModule['name'], 'user_fields', $iAccountId, $iProfileId, array('email' => $sEmail, 'markers' => &$aMarkers, 'markers_ref' => &$aMarkers));
 
         return array (
             'email_address' => $oAccount->getEmail(),

+ 1 - 1
modules/boonex/massmailer/classes/BxMassMailerModule.php

@@ -521,7 +521,7 @@ class BxMassMailerModule extends BxBaseModGeneralModule
         $sLetterCode = $this->_oDb->addLetter($iCampaignId, $sEmail);
         
         $aMarkers = $this->addMarkers($iAccountId, $sLetterCode);
-        bx_alert($this->_aModule['name'], 'user_fields', $iCampaignId, $iAccountId, array('email' => $sEmail, 'markers' => &$aMarkers));
+        bx_alert($this->_aModule['name'], 'user_fields', $iCampaignId, $iAccountId, array('email' => $sEmail, 'markers' => &$aMarkers, 'markers_ref' => &$aMarkers));
         if ($bTrackKinks){
             $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
             $aTemplate['Body'] = preg_replace_callback("/$regexp/siU",

+ 26 - 1
modules/boonex/notifications/classes/BxNtfsDb.php

@@ -103,6 +103,7 @@ class BxNtfsDb extends BxBaseModNotificationsDb
          */
         bx_alert($this->_oConfig->getName(), 'get_events_before', 0, 0, [
             'params' => &$aParams,
+            'params_ref' => &$aParams,
         ]);
 
         if($aParams['browse'] != 'list' || $aParams['type'] != BX_NTFS_TYPE_OBJECT_OWNER_AND_CONNECTIONS)
@@ -193,6 +194,7 @@ class BxNtfsDb extends BxBaseModNotificationsDb
             'browse' => $aParams['browse'],
             'params' => $aAlertParams,
             'table' => $this->_sTable,
+
             'method' => &$sUnionMethod,
             'select_clause' => &$sSelectClause,
             'join_clause_po' => &$sJoinClausePo,
@@ -205,6 +207,19 @@ class BxNtfsDb extends BxBaseModNotificationsDb
             'limit_clause' => &$sUnionLimitClause,
             'query_po' => &$sQueryOwner,
             'query_pc' => &$sQueryConnections,
+
+            'method_ref' => &$sUnionMethod,
+            'select_clause_ref' => &$sSelectClause,
+            'join_clause_po_ref' => &$sJoinClausePo,
+            'join_clause_pc_ref' => &$sJoinClausePc,
+            'where_clause_po_ref' => &$sWhereClausePo,
+            'where_clause_pc_ref' => &$sWhereClausePc,
+            'order_clause_po_ref' => &$sOrderClausePo,
+            'order_clause_pc_ref' => &$sOrderClausePc,
+            'order_clause_ref' => &$sUnionOrderClause,
+            'limit_clause_ref' => &$sUnionLimitClause,
+            'query_po_ref' => &$sQueryOwner,
+            'query_pc_ref' => &$sQueryConnections,
         ]);
 
         $sQuery = "(" . $sQueryOwner . ") UNION (" . $sQueryConnections . ") {order} {limit}";
@@ -413,6 +428,7 @@ class BxNtfsDb extends BxBaseModNotificationsDb
             'owner_id' => $aParams['owner_id'],
             'params' => $aAlertParams,
             'table' => $this->_sTable,
+
             'join_clause' => &$sJoinClause,
             'where_clause' => &$sWhereClause,
             'where_clause_start_from' => &$sWhereClauseStartFrom,
@@ -420,7 +436,16 @@ class BxNtfsDb extends BxBaseModNotificationsDb
             'where_clause_modules' => &$sWhereClauseModules,
             'where_clause_new' => &$sWhereClauseNew,
             'where_clause_settings' => &$sWhereClauseSettings,
-            'where_clause_type' => &$sWhereClauseType
+            'where_clause_type' => &$sWhereClauseType,
+
+            'join_clause_ref' => &$sJoinClause,
+            'where_clause_ref' => &$sWhereClause,
+            'where_clause_start_from_ref' => &$sWhereClauseStartFrom,
+            'where_clause_status_ref' => &$sWhereClauseStatus,
+            'where_clause_modules_ref' => &$sWhereClauseModules,
+            'where_clause_new_ref' => &$sWhereClauseNew,
+            'where_clause_settings_ref' => &$sWhereClauseSettings,
+            'where_clause_type_ref' => &$sWhereClauseType,
         ]);
 
         $sWhereClause .= $sWhereClauseStartFrom;

+ 9 - 2
modules/boonex/notifications/classes/BxNtfsModule.php

@@ -473,7 +473,9 @@ class BxNtfsModule extends BxBaseModNotificationsModule
             bx_alert($sModule, 'is_notification', 0, 0, [
                 'browse_params' => $aBrowseParams,
                 'event' => &$aEvent, 
-                'event_canceled' => &$bEventCanceled
+                'event_canceled' => &$bEventCanceled,
+                'event_ref' => &$aEvent, 
+                'event_canceled_ref' => &$bEventCanceled
             ]);
 
             if($bEventCanceled)
@@ -659,9 +661,14 @@ class BxNtfsModule extends BxBaseModNotificationsModule
          */
         bx_alert($this->_aModule['name'], 'before_send_notification_push', 0, 0, [
             'profile_id' => $iProfile, 
+
             'content' => &$aContent, 
             'setting' => &$aSettings, 
-            'subject' => &$sSubject
+            'subject' => &$sSubject,
+
+            'content_ref' => &$aContent, 
+            'setting_ref' => &$aSettings, 
+            'subject_ref' => &$sSubject,
         ]);
         
         if (!$aContent)

+ 8 - 1
modules/boonex/notifications/classes/BxNtfsTemplate.php

@@ -239,11 +239,18 @@ class BxNtfsTemplate extends BxBaseModNotificationsTemplate
          */
         bx_alert($this->_oConfig->getName(), 'get_notification', 0, 0, [
             'browse_params' => $aBrowseParams,
+
             'event' => &$aEvent, 
             'event_parsed' => &$bEventParsed, 
             'event_canceled' => &$bEventCanceled,
             'owner' => &$oOwner, 
-            'owner_unit' => &$sOwnerUnit
+            'owner_unit' => &$sOwnerUnit,
+
+            'event_ref' => &$aEvent, 
+            'event_parsed_ref' => &$bEventParsed, 
+            'event_canceled_ref' => &$bEventCanceled,
+            'owner_ref' => &$oOwner, 
+            'owner_unit_ref' => &$sOwnerUnit,
         ]);
         
         if ($bEventCanceled)

+ 4 - 0
modules/boonex/payment/classes/BxPaymentCart.php

@@ -208,6 +208,10 @@ class BxPaymentCart extends BxBaseModPaymentCart
 
             'cart' => &$aCart,
             'cart_items' => &$sCartItems,
+
+            'cart_ref' => &$aCart,
+            'cart_items_ref' => &$sCartItems,
+
             'override_result' => &$sCartItemsResult,
         ]);
 

+ 24 - 0
modules/boonex/payment/classes/BxPaymentModule.php

@@ -858,9 +858,14 @@ class BxPaymentModule extends BxBaseModPaymentModule
         $this->alert('before_authorize', 0, $this->_iUserId, array(
             'client_id' => $this->_iUserId,
             'seller_id' => $iSellerId, 
+
             'type' => &$sType,
             'provider' => &$sProvider,
             'cart_info' => &$aInfo,
+
+            'type_ref' => &$sType,
+            'provider_ref' => &$sProvider,
+            'cart_info_ref' => &$aInfo,
         ));
 
         $iPendingId = $this->_oDb->insertOrderPending($this->_iUserId, $sType, $sProvider, $aInfo);
@@ -914,9 +919,14 @@ class BxPaymentModule extends BxBaseModPaymentModule
             'order_auth' => $sOrderAuth,
             'client_id' => $iClientId,
             'seller_id' => $iSellerId, 
+
             'type' => &$sType,
             'provider' => &$sProvider,
             'cart_info' => &$aInfo,
+
+            'type_ref' => &$sType,
+            'provider_ref' => &$sProvider,
+            'cart_info_ref' => &$aInfo,
         ));
 
         $aResult = $oProvider->captureAuthorizedCheckout($sOrderAuth, $aPending, $aInfo, $sRedirect);
@@ -934,8 +944,12 @@ class BxPaymentModule extends BxBaseModPaymentModule
             'pending' => $aPending,
             'transactions' => $this->_oDb->getOrderProcessed(array('type' => 'pending_id', 'pending_id' => (int)$aPending['id'])),
             'provider' => $oProvider,
+
             'message' => &$aResult['message'],
             'result' => &$aResult,
+
+            'message_ref' => &$aResult['message'],
+            'result_ref' => &$aResult,
         ));
 
         if(empty($aResult['redirect']) && $oProvider->needRedirect())
@@ -1047,10 +1061,16 @@ class BxPaymentModule extends BxBaseModPaymentModule
         $this->alert('before_pending', 0, bx_get_logged_profile_id(), array(
             'client_id' => $this->_iUserId,
             'seller_id' => $iSellerId, 
+
             'type' => &$sType,
             'provider' => &$sProvider,
             'cart_info' => &$aInfo,
             'custom' => &$aCustoms,
+
+            'type_ref' => &$sType,
+            'provider_ref' => &$sProvider,
+            'cart_info_ref' => &$aInfo,
+            'custom_ref' => &$aCustoms,
         ));
 
         $iPendingId = $this->_oDb->insertOrderPending($this->_iUserId, $sType, $sProvider, $aInfo, $aCustoms);
@@ -1169,8 +1189,12 @@ class BxPaymentModule extends BxBaseModPaymentModule
             'pending' => $aPending,
             'transactions' => $this->_oDb->getOrderProcessed(array('type' => 'pending_id', 'pending_id' => (int)$aPending['id'])),
             'provider' => $oProvider,
+
             'message' => &$aResult['message'],
             'result' => &$aResult,
+
+            'message_ref' => &$aResult['message'],
+            'result_ref' => &$aResult,
         ));
 
         if($oProvider->needRedirect()) 

+ 9 - 2
modules/boonex/payment/classes/BxPaymentProviderChargebeeV3.php

@@ -308,7 +308,10 @@ class BxPaymentProviderChargebeeV3 extends BxPaymentProviderChargebee
          */
     	bx_alert($this->_oModule->_oConfig->getName(), $this->_sName . '_get_js_code', 0, 0, [
             'site' => &$sSite,
-            'params' => &$aParams
+            'params' => &$aParams,
+
+            'site_ref' => &$sSite,
+            'param_ref' => &$aParams
     	]);
 
     	return $this->_oModule->_oTemplate->getJsCode($this->_sName, array_merge(array(
@@ -397,7 +400,11 @@ class BxPaymentProviderChargebeeV3 extends BxPaymentProviderChargebee
         bx_alert($this->_oModule->_oConfig->getName(), $this->_sName . '_get_button', 0, $iClientId, [
             'type' => &$sType, 
             'site' => &$sSite,
-            'params' => &$aParams
+            'params' => &$aParams,
+
+            'type_ref' => &$sType, 
+            'site_ref' => &$sSite,
+            'params_ref' => &$aParams,
         ]);
 
         $sJsMethod = '';

+ 16 - 4
modules/boonex/payment/classes/BxPaymentProviderStripe.php

@@ -309,8 +309,12 @@ class BxPaymentProviderStripe extends BxPaymentProviderStripeBasic implements iB
          */
         bx_alert($this->_oModule->_oConfig->getName(), $this->_sName . '_create_customer', 0, $aClient['id'], [
             'type' => $sType,
+
             'customer_object' => &$oCustomer, 
-            'customer_params' => &$aCustomer
+            'customer_params' => &$aCustomer,
+
+            'customer_object_ref' => &$oCustomer, 
+            'customer_params_ref' => &$aCustomer,
         ]);
 
         try {
@@ -361,7 +365,8 @@ class BxPaymentProviderStripe extends BxPaymentProviderStripeBasic implements iB
          */
         bx_alert($this->_oModule->_oConfig->getName(), $this->_sName . '_create_charge', $iPendingId, false, [
             'charge_object' => &$oCharge, 
-            'charge_params' => &$aCharge
+            'charge_params' => &$aCharge,
+            'charge_params_ref' => &$aCharge,
         ]);
 
         try {
@@ -429,8 +434,12 @@ class BxPaymentProviderStripe extends BxPaymentProviderStripeBasic implements iB
          */
         bx_alert($this->_oModule->_oConfig->getName(), $this->_sName . '_create_subscription', $iPendingId, false, [
             'customer' => &$this->_oCustomer,
+
             'subscription_object' => &$oSubscription, 
-            'subscription_params' => &$aSubscription
+            'subscription_params' => &$aSubscription,
+
+            'subscription_object_ref' => &$oSubscription, 
+            'subscription_params_ref' => &$aSubscription,
         ]);
 
         try {
@@ -516,7 +525,10 @@ class BxPaymentProviderStripe extends BxPaymentProviderStripeBasic implements iB
          */
     	bx_alert($this->_oModule->_oConfig->getName(), $this->_sName . '_get_button', 0, $iClientId, [
             'type' => &$sType, 
-            'public_key' => &$sPublicKey
+            'public_key' => &$sPublicKey,
+
+            'type_ref' => &$sType, 
+            'public_key_ref' => &$sPublicKey,
         ]);
 
         $sJsMethod = '';

+ 9 - 2
modules/boonex/payment/classes/BxPaymentProviderStripeBasic.php

@@ -372,8 +372,12 @@ class BxPaymentProviderStripeBasic extends BxBaseModPaymentProvider
          */
         bx_alert($this->_oModule->_oConfig->getName(), $this->_sName . '_retrieve_customer', 0, false, [
             'type' => $sType,
+
             'customer_id' => &$sId,
-            'customer_object' => &$oCustomer
+            'customer_object' => &$oCustomer,
+
+            'customer_id_ref' => &$sId,
+            'customer_object_ref' => &$oCustomer,
         ]);
 
         try {
@@ -412,7 +416,10 @@ class BxPaymentProviderStripeBasic extends BxBaseModPaymentProvider
          */
         bx_alert($this->_oModule->_oConfig->getName(), $this->_sName . '_retrieve_charge', 0, false, [
             'charge_id' => &$sId,
-            'charge_object' => &$oCharge
+            'charge_object' => &$oCharge,
+
+            'charge_id_ref' => &$sId,
+            'charge_object_ref' => &$oCharge,
         ]);
 
         try {

+ 8 - 2
modules/boonex/payment/classes/BxPaymentProviderStripeV3.php

@@ -453,7 +453,8 @@ class BxPaymentProviderStripeV3 extends BxPaymentProviderStripeBasic implements
          */
         bx_alert($this->_oModule->_oConfig->getName(), $this->_sName . '_create_tax', 0, false, [
             'tax_object' => &$oTax, 
-            'tax_params' => &$aTax
+            'tax_params' => &$aTax,
+            'tax_params_ref' => &$aTax,
         ]);
 
         try {
@@ -1055,9 +1056,14 @@ class BxPaymentProviderStripeV3 extends BxPaymentProviderStripeBasic implements
     	bx_alert($this->_oModule->_oConfig->getName(), $this->_sName . '_get_button', 0, $iClientId, [
             'client_id' => $iClientId,
             'vendor_id' => $iVendorId,
+
             'type' => &$sType, 
             'public_key' => &$sPublicKey,
-            'connected_account_id' => &$sConnectedAccountId
+            'connected_account_id' => &$sConnectedAccountId,
+
+            'type_ref' => &$sType, 
+            'public_key_ref' => &$sPublicKey,
+            'connected_account_id_ref' => &$sConnectedAccountId,
         ]);
 
         $sJsMethod = '';

+ 1 - 0
modules/boonex/russian/data/langs/system/ru.xml

@@ -2232,6 +2232,7 @@
 
         <string name="_sys_agents_form_field_err_enter"><![CDATA[Это поле имеет важное значение. Пожалуйста, напишите что-нибудь здесь.]]></string>
         <string name="_sys_agents_form_field_err_select"><![CDATA[Это поле имеет важное значение. Пожалуйста, выберите что-нибудь здесь.]]></string>
+        <string name="_sys_agents_form_field_err_profile_has_agent"><![CDATA[Этот профиль уже используется в другом агенте({0}) с тем же триггером 'сообщение'.]]></string>
         <string name="_sys_agents_json_field_err"><![CDATA[Неверный формат JSON.]]></string>
         <string name="_sys_agents_automators_txt_active"><![CDATA[Активный]]></string>
         <string name="_sys_agents_automators_txt_name"><![CDATA[Название]]></string>

+ 26 - 2
modules/boonex/timeline/classes/BxTimelineDb.php

@@ -674,6 +674,7 @@ class BxTimelineDb extends BxBaseModNotificationsDb
          */
         bx_alert($this->_oConfig->getName(), 'get_events_before', 0, 0, [
             'params' => &$aParams,
+            'params_ref' => &$aParams,
         ]);
 
         $sTable = isset($aParams['from_cache']) && $aParams['from_cache'] === true ? $this->_sTableSlice : $this->_sTable;
@@ -717,12 +718,20 @@ class BxTimelineDb extends BxBaseModNotificationsDb
             'params' => $aAlertParams,
             'table' => $sTable,
             'table_alias' => $sTableAlias,
+
             'method' => &$sMethod,
             'select_clause' => &$sSelectClause,
             'join_clause' => &$mixedJoinClause,
             'where_clause' => &$mixedWhereClause,
             'order_clause' => &$sOrderClause,
-            'limit_clause' => &$sLimitClause
+            'limit_clause' => &$sLimitClause,
+
+            'method_ref' => &$sMethod,
+            'select_clause_ref' => &$sSelectClause,
+            'join_clause_ref' => &$mixedJoinClause,
+            'where_clause_ref' => &$mixedWhereClause,
+            'order_clause_ref' => &$sOrderClause,
+            'limit_clause_ref' => &$sLimitClause,
         ]);
 
         $sSqlMask = "SELECT {select}
@@ -1439,6 +1448,7 @@ class BxTimelineDb extends BxBaseModNotificationsDb
             'params' => $aAlertParams,
             'table' => isset($aParams['from_cache']) && $aParams['from_cache'] === true ? $this->_sTableSlice : $this->_sTable,
             'table_alias' => $sTableAlias,
+
             'join_clause' => &$mixedJoinClause,
             'join_subclause' => &$mixedJoinSubclause,
             'where_clause' => &$mixedWhereClause,
@@ -1451,7 +1461,21 @@ class BxTimelineDb extends BxBaseModNotificationsDb
             'where_clause_muted' => &$sWhereClauseMuted,
             'where_clause_unpublished' => &$sWhereClauseUnpublished,
             'where_clause_cf' => &$sWhereClauseCf,
-            'where_subclause' => &$mixedWhereSubclause
+            'where_subclause' => &$mixedWhereSubclause,
+
+            'join_clause_ref' => &$mixedJoinClause,
+            'join_subclause_ref' => &$mixedJoinSubclause,
+            'where_clause_ref' => &$mixedWhereClause,
+            'where_clause_status_ref' => &$sWhereClauseStatus,
+            'where_clause_filter_ref' => &$sWhereClauseFilter,
+            'where_clause_timeline_ref' => &$sWhereClauseTimeline,
+            'where_clause_modules_ref' => &$sWhereClauseModules,
+            'where_clause_hidden_ref' => &$sWhereClauseHidden,
+            'where_clause_medias_ref' => &$sWhereClauseMedias,
+            'where_clause_muted_ref' => &$sWhereClauseMuted,
+            'where_clause_unpublished_ref' => &$sWhereClauseUnpublished,
+            'where_clause_cf_ref' => &$sWhereClauseCf,
+            'where_subclause_ref' => &$mixedWhereSubclause,
         ]);
 
         $mixedWhereClause .= $sWhereClauseStatus;

+ 5 - 2
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -1276,7 +1276,8 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             'module' => $this->_oConfig->getName(),
             'type' => $sType,
             'params' => $aParams,
-            'form' => &$oForm
+            'form' => &$oForm,
+            'form_inputs_ref' => &$oForm->aInputs,
         ));
 
     	return $oForm;
@@ -4518,7 +4519,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
              * @hook @ref hook-bx_base_profile-timeline_post
              */
             bx_alert($oProfileOwner->getModule(), $this->_oConfig->getUri() . '_post', $oProfileOwner->id(), $iUserId, [
-                'check_result' => &$aCheckResult
+                'check_result' => &$aCheckResult,
             ]);
         }
 
@@ -5987,6 +5988,8 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         bx_alert($oProfileOwner->getModule(), $this->_oConfig->getUri() . '_view', $this->_iOwnerId, $this->getUserId(), [
             'params' => &$aParams,
             'menu' => &$aMenu,
+            'params_ref' => &$aParams,
+            'menu_ref' => &$aMenu,
             'override_content' => &$mixedContent,
         ]);
 

+ 7 - 2
modules/boonex/timeline/classes/BxTimelineResponse.php

@@ -97,7 +97,8 @@ class BxTimelineResponse extends BxBaseModNotificationsResponse
                     'unit' => $oAlert->sUnit,
                     'action' => $oAlert->sAction,
                     'alert' => $oAlert,
-                    'data' => &$aEvent
+                    'data' => &$aEvent,
+                    'data_ref' => &$aEvent,
                 ]);
 
                 $iId = $this->_oModule->_oDb->insertEvent($aEvent);
@@ -166,8 +167,12 @@ class BxTimelineResponse extends BxBaseModNotificationsResponse
                     'unit' => $oAlert->sUnit,
                     'action' => $oAlert->sAction,
                     'alert' => $oAlert,
+
                     'data' => &$aParamsSet,
-                    'data_by_source' => &$aParamsSetBySource
+                    'data_by_source' => &$aParamsSetBySource,
+
+                    'data_ref' => &$aParamsSet,
+                    'data_by_source_ref' => &$aParamsSetBySource,
                 ]);
 
                 $this->_oModule->_oDb->updateEvent($aParamsSet, ['id' => $aEvent[$CNF['FIELD_ID']]]);

+ 23 - 4
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -698,6 +698,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         bx_alert($sModuleName, 'add_live_update', 0, 0, [
             'browse_params' => $aParams,
             'live_update_params' => &$aLiveUpdateParams,
+            'live_update_params_ref' => &$aLiveUpdateParams,
             'override_result' => &$sLiveUpdateCode,
         ]);
 
@@ -751,13 +752,22 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         bx_alert($sModuleName, 'get_view', 0, 0, [
             'params' => $aParams,
             'event_first' => $iEvent,
+
             'back' => &$sBack,
             'empty' => &$sEmpty,
             'content_before' => &$sContentBefore,
             'content' => &$sContent,
             'content_after' => &$sContentAfter,
             'load_more' => &$sLoadMore,
-            'js_content' => &$sJsContent
+            'js_content' => &$sJsContent,
+
+            'back_ref' => &$sBack,
+            'empty_ref' => &$sEmpty,
+            'content_before_ref' => &$sContentBefore,
+            'content_ref' => &$sContent,
+            'content_after_ref' => &$sContentAfter,
+            'load_more_ref' => &$sLoadMore,
+            'js_content_ref' => &$sJsContent,
         ]);
 
         $sJsObjectFilters = '';
@@ -1577,7 +1587,8 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         bx_alert($this->_oConfig->getName(), 'get_reposted_by', 0, 0, [
             'content_id' => $iId,
             'user_ids' => $aUserIds,
-            'users' => &$aTmplUsers
+            'users' => &$aTmplUsers,
+            'users_ref' => &$aTmplUsers,
         ]);
         
         if(empty($aTmplUsers))
@@ -2251,8 +2262,12 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
             'type' => $sType,
             'event' => $aEvent,
             'browse_params' => $aBrowseParams,
+
             'tmpl_code' => &$sTmplCode,
-            'tmpl_vars' => &$aTmplVars
+            'tmpl_vars' => &$aTmplVars,
+
+            'tmpl_code_ref' => &$sTmplCode,
+            'tmpl_vars_ref' => &$aTmplVars,
         ]);
 
         return $this->parseHtmlByContent($sTmplCode, $aTmplVars);
@@ -2401,8 +2416,12 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
             'type' => $sType,
             'event' => $aEvent,
             'browse_params' => $aBrowseParams,
+
             'tmpl_code' => &$sTmplCode,
-            'tmpl_vars' => &$aTmplVars
+            'tmpl_vars' => &$aTmplVars,
+
+            'tmpl_code_ref' => &$sTmplCode,
+            'tmpl_vars_ref' => &$aTmplVars,
         ]);
 
         return $this->parseHtmlByContent($sTmplCode, $aTmplVars);

+ 1 - 1
studio/classes/BxDolStudioPermissionsLevels.php

@@ -30,7 +30,7 @@ class BxDolStudioPermissionsLevels extends BxTemplStudioGrid
 
         // create system event before deletion
         $isStopDeletion = false;
-        bx_alert('acl', 'before_delete', $aLevel['id'], 0, array('level' => $aLevel, 'stop_deletion' => &$isStopDeletion));
+        bx_alert('acl', 'before_delete', $aLevel['id'], 0, array('level' => $aLevel, 'stop_deletion' => &$isStopDeletion, 'stop_deletion_ref' => &$isStopDeletion));
         if($isStopDeletion)
             return false;
 

+ 1 - 1
studio/classes/BxDolStudioRolesLevels.php

@@ -36,7 +36,7 @@ class BxDolStudioRolesLevels extends BxTemplStudioGrid
             return false;
 
         $isStopDeletion = false;
-        bx_alert('roles', 'before_delete', $iId, 0, array('role' => $aRole, 'stop_deletion' => &$isStopDeletion));
+        bx_alert('roles', 'before_delete', $iId, 0, array('role' => $aRole, 'stop_deletion' => &$isStopDeletion, 'stop_deletion_ref' => &$isStopDeletion));
         if($isStopDeletion)
             return false;
 

+ 27 - 0
studio/template/scripts/BxBaseStudioAgentsAgents.php

@@ -81,6 +81,14 @@ class BxBaseStudioAgentsAgents extends BxDolStudioAgentsAgents
         $oForm = new BxTemplFormView($aForm);
         $oForm->initChecker();
 
+        if ($oForm->isSubmitted() && $oForm->getCleanValue('trigger') == 'message') {
+            $aAgent = $this->_getAgentWithProfile($oForm->getCleanValue('profile_id'));
+            if ($aAgent) {
+                 $oForm->aInputs['profile_id']['error'] = _t('_sys_agents_form_field_err_profile_has_agent', $aAgent['name']);
+                 $oForm->setValid(false);
+            }
+        }
+
         if($oForm->isSubmittedAndValid()) {
             $aValsToAdd = [
                 'added' => time()
@@ -142,6 +150,14 @@ class BxBaseStudioAgentsAgents extends BxDolStudioAgentsAgents
         $oForm = new BxTemplFormView($aForm);
         $oForm->initChecker();
 
+        if ($oForm->isSubmitted() && $oForm->getCleanValue('trigger') == 'message') {
+            $aAgent = $this->_getAgentWithProfile($oForm->getCleanValue('profile_id'), $iId);
+            if ($aAgent) {
+                 $oForm->aInputs['profile_id']['error'] = _t('_sys_agents_form_field_err_profile_has_agent', $aAgent['name']);
+                 $oForm->setValid(false);
+            }
+        }
+
         if($oForm->isSubmittedAndValid()) {
             $aValsToAdd = [];
 
@@ -608,6 +624,17 @@ class BxBaseStudioAgentsAgents extends BxDolStudioAgentsAgents
             return '';
         return parent::_getActionDefault ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
     }
+
+    protected function _getAgentWithProfile($iProfileId, $iExcludeAgentId = 0)
+    {
+        $aAgents = BxDolAi::getInstance()->getAgentsByProfileId($iProfileId);
+        foreach($aAgents as $aAgent) {
+            if($aAgent['id'] != $iExcludeAgentId)
+                return $aAgent;
+        }
+
+        return null;
+    }
 }
 
 /** @} */

+ 1 - 8
studio/template/scripts/BxBaseStudioAgentsLogs.php

@@ -64,14 +64,7 @@ class BxBaseStudioAgentsLogs extends BxDolStudioAgentsGrid
 
     protected function _getCellContext ($mixedValue, $sKey, $aField, $aRow) 
     {
-        $sPopupString = '<pre>' . $mixedValue . '</pre>';
-        /*
-        if (preg_match('/^\[message\]\s{/', $mixedValue)) {
-            // $sPopupString = json_encode(json_decode(preg_replace('/^\[message\]\s/', '', $mixedValue), true), JSON_PRETTY_PRINT);
-            $sPopupString = preg_replace('/^\[message\]\s/', '', $mixedValue);
-            //$sPopupString = json_last_error_msg();//json_encode(json_decode(preg_replace('/^\[message\]\s/', '', $mixedValue), true), JSON_PRETTY_PRINT);
-        } 
-        */
+        $sPopupString = '<div style="width: 100vw; max-width: 800px;"><textarea class="bx-def-font-inputs bx-form-input-textarea">' . $mixedValue . '</textarea></div>';
         $mixedValue = BxTemplFunctions::getInstance()->getStringWithLimitedLength($mixedValue, 55, true, true, $sPopupString);
         return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);
     } 

+ 7 - 3
template/scripts/BxBaseAccountForms.php

@@ -39,7 +39,8 @@ class BxBaseAccountForms extends BxDolProfileForms
          * @hook @ref hook-account-add_form_get
          */
         bx_alert('account', 'add_form_get', 0, 0, [
-            'form_object' => &$oForm
+            'form_object' => &$oForm,
+            'form_inputs_ref' => &$oForm->aInputs,
         ]);
 
         return $oForm;
@@ -83,7 +84,8 @@ class BxBaseAccountForms extends BxDolProfileForms
          * @hook @ref hook-account-add_form_check
          */
         bx_alert('account', 'add_form_check', 0, 0, array(
-            'form_object' => &$oForm
+            'form_object' => &$oForm,
+            'form_inputs_ref' => &$oForm->aInputs,
         ));
 
         if (!$oForm->isSubmittedAndValid()) {
@@ -104,7 +106,9 @@ class BxBaseAccountForms extends BxDolProfileForms
              */
             bx_alert('account', 'add_form', 0, 0, array(
                     'form_object' => &$oForm,
-                    'form_code' => &$sCode
+                    'form_inputs_ref' => &$oForm->aInputs,
+                    'form_code' => &$sCode,
+                    'form_code_ref' => &$sCode,
             ));
             
             if($bIsApi){

+ 2 - 1
template/scripts/BxBaseAcl.php

@@ -120,7 +120,8 @@ class BxBaseAcl extends BxDolAcl
             'block_owner' => $iProfileId,
             'block_tmpl_name' => $sTmplName,
             'block_tmpl_vars' => $aTmplVars,
-            'block_code' => &$sContent
+            'block_code' => &$sContent,
+            'block_code_ref' => &$sContent,
         ]);
 
         $oTemplate->addCss(['acl.css']);

+ 11 - 0
template/scripts/BxBaseCmts.php

@@ -261,6 +261,7 @@ class BxBaseCmts extends BxDolCmts
             'id' => $this->getId(),
             'params_browse' => $aBp,
             'params_display' => $aDp,
+
             'post_form_top' => &$sPostFormTop,
             'content_before' => &$sContentBefore,
             'comments' => &$sComments,
@@ -270,6 +271,16 @@ class BxBaseCmts extends BxDolCmts
             'js_content' => &$sJsContent,
             'block_title' => &$sBlockTitle,
             'block_menu' => &$sBlockMenu,
+
+            'post_form_top_ref' => &$sPostFormTop,
+            'content_before_ref' => &$sContentBefore,
+            'comments_ref' => &$sComments,
+            'comments_pinned_ref' => &$sCommentsPinned,
+            'content_after_ref' => &$sContentAfter,
+            'post_form_bottom_ref'  => &$sPostFormBottom,
+            'js_content_ref' => &$sJsContent,
+            'block_title_ref' => &$sBlockTitle,
+            'block_menu_ref' => &$sBlockMenu,
         ]);
 
         $sContent = $this->_oTemplate->parseHtmlByName('comments_block.html', [

+ 4 - 0
template/scripts/BxBaseCover.php

@@ -83,8 +83,12 @@ class BxBaseCover extends BxDolCover
          */
         bx_alert('system', 'display_cover', 0, 0, [
             'res' => &$sResult, 
+
             'template_name' => &$this->_sTemplateName, 
             'params' => &$aParams, 
+
+            'template_name_ref' => &$this->_sTemplateName, 
+            'params_ref' => &$aParams, 
         ]);
 
         if ($sResult  != null)

+ 1 - 0
template/scripts/BxBaseFormAccount.php

@@ -69,6 +69,7 @@ class BxFormAccountCheckerHelper extends BxDolFormCheckerHelper
             'info' => $aInfo,
             'pwd' => $s,
             'password' => &$sPassCheck,
+            'password_ref' => &$sPassCheck,
         ]);
 
         return $aInfo['password'] == $sPassCheck;

+ 7 - 1
template/scripts/BxBaseFormView.php

@@ -350,7 +350,11 @@ class BxBaseFormView extends BxDolForm
             'dynamic' => $this->_bDynamicMode,
             'object' => &$this,
             'code' => &$this->sCode,
-            'include' => &$sInclude
+            'include' => &$sInclude,
+
+            'code_ref' => &$this->sCode,
+            'include_ref' => &$sInclude,
+            'form_inputs_ref' => &$this->aInputs,
         ]);
 
         if($this->sCode === false)
@@ -383,6 +387,8 @@ class BxBaseFormView extends BxDolForm
             'dynamic' => $this->_bDynamicMode,
             'object' => &$this,
             'code' => &$this->sCode,
+            'code_ref' => &$this->sCode,
+            'form_inputs_ref' => &$this->aInputs,
         ]);
 
         if($this->sCode === false) {

+ 4 - 1
template/scripts/BxBaseFunctions.php

@@ -671,7 +671,10 @@ class BxBaseFunctions extends BxDolFactory implements iBxDolSingleton
 
         bx_alert('system', 'get_logo', 0, 0, [
             'tmpl_name' => &$sTmplName,
-            'tmpl_vars' => &$aTmplVars
+            'tmpl_vars' => &$aTmplVars,
+
+            'tmpl_name_ref' => &$sTmplName,
+            'tmpl_vars_ref' => &$aTmplVars,
         ]);
 
         return $this->_oTemplate->parseHtmlByName($sTmplName, $aTmplVars);

+ 4 - 0
template/scripts/BxBaseMenuSocialSharing.php

@@ -48,6 +48,10 @@ class BxBaseMenuSocialSharing extends BxTemplMenu
         $oAlert = new BxDolAlerts('system', 'social_sharing_display', '', '', array (
         	'markers' => &$this->_aMarkers,
             'buttons' => &$this->_aObject['menu_items'],
+
+        	'markers_ref' => &$this->_aMarkers,
+            'buttons_ref' => &$this->_aObject['menu_items'],
+
             'override_output' => &$sOverrideOutput,
         ));
         $oAlert->alert();

+ 1 - 0
template/scripts/BxBasePage.php

@@ -331,6 +331,7 @@ class BxBasePage extends BxDolPage
             'page_object' => $this,
             'page_query' => $this->_oQuery,
             'page_code' => &$sPageCode,
+            'page_code_ref' => &$sPageCode,
             'sub_page' => $this->_bSubPage,
         ]);
 

+ 5 - 1
template/scripts/BxBaseSearchExtended.php

@@ -167,8 +167,12 @@ class BxBaseSearchExtended extends BxDolSearchExtended
          */
         bx_alert('search', 'get_data', 0, false, [
             'object' => $this->_aObject, 
+
             'search_params' => &$aParamsSearch, 
-            'search_results' => &$aResults
+            'search_results' => &$aResults,
+
+            'search_params_ref' => &$aParamsSearch, 
+            'search_results_ref' => &$aResults,
         ]);
 
     	if($aResults === false)

+ 3 - 1
template/scripts/BxBaseSearchResult.php

@@ -97,8 +97,10 @@ class BxBaseSearchResult extends BxDolSearchResult
          */
         bx_alert('simple_search', 'show_data', 0, false, [
             'object' => &$this->aCurrent, 
+            'condition_array_ref' => &$this->aCurrent, 
             'mode' => $this->_sMode, 
-            'search_results' => &$sCode
+            'search_results' => &$sCode,
+            'search_results_ref' => &$sCode
         ]);
 
         return $sCode;

+ 8 - 0
template/scripts/BxBaseServiceAccount.php

@@ -483,6 +483,10 @@ class BxBaseServiceAccount extends BxDol
                     bx_alert('account', 'before_confirm_phone_send_sms', $oAccount->id(), bx_get_logged_profile_id(), [
                         'phone_number' => &$sPhoneNumber, 
                         'sms_text' => &$sActivationText, 
+
+                        'phone_number_ref' => &$sPhoneNumber, 
+                        'sms_text_ref' => &$sActivationText, 
+
                         'override_result' => &$mixedResult
                     ]);
 
@@ -716,6 +720,10 @@ class BxBaseServiceAccount extends BxDol
                 bx_alert('account', 'before_forgot_password_send_sms', $aAccountInfo['id'], false, [
                     'phone_number' => &$sPhone, 
                     'sms_text' => &$sSmsText, 
+
+                    'phone_number_ref' => &$sPhone, 
+                    'sms_text_ref' => &$sSmsText, 
+
                     'override_result' => &$mixedOverrideResult
                 ]);
 

+ 19 - 2
template/scripts/BxBaseServiceLogin.php

@@ -179,7 +179,19 @@ class BxBaseServiceLogin extends BxDol
          *      - `aAuthTypes` - [array] by ref,  Auth Types, can be overridden in hook processing
          * @hook @ref hook-account-show_login_form
          */
-        bx_alert('profile', 'show_login_form', 0, 0, array('oForm' => &$oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes));
+        bx_alert('profile', 'show_login_form', 0, 0, array(
+            'oForm' => &$oForm, 
+            'sParams' => &$sParams, 
+            'sCustomHtmlBefore' => &$sCustomHtmlBefore, 
+            'sCustomHtmlAfter' => &$sCustomHtmlAfter, 
+            'aAuthTypes' => &$aAuthTypes,
+
+            'form_inputs_ref' => &$oForm->aInputs, 
+            'sParams_ref' => &$sParams, 
+            'sCustomHtmlBefore_ref' => &$sCustomHtmlBefore, 
+            'sCustomHtmlAfter_ref' => &$sCustomHtmlAfter, 
+            'aAuthTypes_ref' => &$aAuthTypes,
+        ));
 
         if (isset($oForm->aInputs['relocate'])) {
             if ($sForceRelocate && 0 === mb_stripos($sForceRelocate, BX_DOL_URL_ROOT))
@@ -287,6 +299,10 @@ class BxBaseServiceLogin extends BxDol
             bx_alert('account', 'before_2fa_send_sms', $oAccount->id(), false, [
                 'phone_number' => &$sPhoneNumber, 
                 'sms_text' => &$sActivationText, 
+
+                'phone_number_ref' => &$sPhoneNumber, 
+                'sms_text_ref' => &$sActivationText, 
+
                 'override_result' => &$mixedOverrideResult
             ]);
 
@@ -338,7 +354,8 @@ class BxBaseServiceLogin extends BxDol
              */
             bx_alert('account', 'login_after', $oAccount->id(),  false, array(
                 'account' => $aAccount,
-                'url_relocate' => &$sUrlRelocate               
+                'url_relocate' => &$sUrlRelocate,
+                'url_relocate_ref' => &$sUrlRelocate,
             ));
 
             BxDolTemplate::getInstance()->setPageNameIndex (BX_PAGE_TRANSITION);

+ 9 - 1
template/scripts/BxBaseServiceProfiles.php

@@ -1277,12 +1277,20 @@ class BxBaseServiceProfiles extends BxDol
         
         bx_alert('system', 'account_profile_switcher', 0, false, array(
             'account_id' => $iAccountId,
+
             'active_profile_id' => &$iActiveProfileId,
             'url_profile_action' => &$sUrlProfileAction,
             'show_all' => &$bShowAll,
             'button_title' => &$sButtonTitle,
             'profile_template' => &$sProfileTemplate,
-            'profiles' => &$aProfiles
+            'profiles' => &$aProfiles,
+
+            'active_profile_id_ref' => &$iActiveProfileId,
+            'url_profile_action_ref' => &$sUrlProfileAction,
+            'show_all_ref' => &$bShowAll,
+            'button_title_ref' => &$sButtonTitle,
+            'profile_template_ref' => &$sProfileTemplate,
+            'profiles_ref' => &$aProfiles,
         ));
 
         $aProfilesData = [];

+ 8 - 2
template/scripts/BxBaseServices.php

@@ -1614,7 +1614,13 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
              *      - `where` - [string]  equal redirect
              * @hook @ref hook-system-check_spam_url
              */
-            bx_alert('system', 'check_spam_url', 0, getLoggedId(), array('is_spam' => &$bSpam, 'content' => &$sUrl, 'where' => 'redirect'));
+            bx_alert('system', 'check_spam_url', 0, getLoggedId(), array(
+                'is_spam' => &$bSpam, 
+                'content' => &$sUrl, 
+                'is_spam_ref' => &$bSpam, 
+                'content_ref' => &$sUrl, 
+                'where' => 'redirect'
+            ));
 
             $sLangKey = $bSpam ? '_sys_redirect_confirmation_harmful' : '_sys_redirect_confirmation';
             return BxDolTemplate::getInstance()->parseHtmlByName('redirect.html', [
@@ -1720,7 +1726,7 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
          *      - `override_result` - [string] by ref, class name for search, can be overridden in hook processing
          * @hook @ref hook-system-search_keyword
          */
-        bx_alert('system', 'search_keyword', 0, 0, array('class' => &$sClass));
+        bx_alert('system', 'search_keyword', 0, 0, array('class' => &$sClass, 'class_name_ref' => &$sClass));
 
         $oSearch = new $sClass(bx_get('section'));
         $oSearch->setLiveSearch(bx_get('live_search') ? 1 : 0);

Некоторые файлы не были показаны из-за большого количества измененных файлов