ソースを参照

Ticket #4575 - Events: Enhancements. Point 3.

AntonLV 2 年 前
親
コミット
ce1e9a455f

+ 8 - 2
modules/base/groups/classes/BxBaseModGroupsConnectionFans.php

@@ -95,6 +95,10 @@ class BxBaseModGroupsConnectionFans extends BxTemplConnection
                     'uri_title' => '',
                     'submit_name' => 'do_submit'
                 ],
+                'module' => $this->_sModule,
+                'object' => $this->_sModule . '_questionnaire',
+                'display' => $this->_sModule . '_questionnaire_answer',
+                'view_mode' => 0,
             ],
             'inputs' => []
         ];
@@ -104,9 +108,11 @@ class BxBaseModGroupsConnectionFans extends BxTemplConnection
             return false;
 
         foreach($aQuestions as $aQuestion) {
-            $aForm['inputs'][] = [
+            $sName = 'question_' . $aQuestion['id'];
+
+            $aForm['inputs'][$sName] = [
                 'type' => 'text',
-                'name' => 'question_' . $aQuestion['id'],
+                'name' => $sName,
                 'caption' => $aQuestion['question'],
                 'value' => '',
                 'required' => '1',

+ 4 - 4
template/scripts/BxBaseServiceConnections.php

@@ -52,12 +52,12 @@ class BxBaseServiceConnections extends BxDol
             $sModule = $oConnection->getModule();
 
             return [
-                'a' => $aParams['a'],
-                'block' => [
-                    'content' => [bx_api_get_block('form', $oConnection->getQuestionnaireForm('add', $aParams['cid'])->getCodeAPI(), ['ext' => [
+                'a' => 'questionnaire',
+                'data' => [
+                    bx_api_get_block('form', $oConnection->getQuestionnaireForm('add', $aParams['cid'])->getCodeAPI(), ['ext' => [
                         'name' => $sModule, 
                         'request' => ['url' => '/api.php?r=' . $sModule . '/get_questionnaire&params[]=main&params[]=' . $aParams['o'] . '&params[]=add&params[]=' . $aParams['cid'], 'immutable' => true]
-                    ]])]
+                    ]])
                 ]
             ];
         }