Parcourir la source

Ticket #4575 - Events: Enhancements.

AntonLV il y a 2 ans
Parent
commit
2676877060

+ 21 - 1
modules/base/groups/classes/BxBaseModGroupsGridQuestionsManage.php

@@ -33,7 +33,27 @@ class BxBaseModGroupsGridQuestionsManage extends BxTemplGrid
             $this->setProfileId($iGroupProfileId);
     }
 
-    function getFormCallBackUrlAPI($sAction, $iId = 0){
+    public function getFormBlockTitleAPI($sAction, $iId = 0)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $sResult = '';
+
+        switch($sAction) {
+            case 'add':
+                $sResult = _t($CNF['T']['popup_title_question_add']);
+                break;
+
+            case 'edit':
+                $sResult = _t($CNF['T']['popup_title_question_edit']);
+                break;
+        }
+
+        return $sResult;
+    }
+
+    public function getFormCallBackUrlAPI($sAction, $iId = 0)
+    {
          return '/api.php?r=system/perfom_action_api/TemplServiceGrid/&params[]=&o=' . $this->_sObject . '&profile_id=' . $this->_iGroupProfileId . '&a=' . $sAction . '&id=' . $iId;
     }
     

+ 19 - 0
modules/boonex/events/classes/BxEventsGridSessionsManage.php

@@ -37,6 +37,25 @@ class BxEventsGridSessionsManage extends BxTemplGrid
             $this->setProfileId($iEventProfileId);
     }
 
+    public function getFormBlockTitleAPI($sAction, $iId = 0)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $sResult = '';
+
+        switch($sAction) {
+            case 'add':
+                $sResult = _t('_bx_events_popup_title_sn_add');
+                break;
+
+            case 'edit':
+                $sResult = _t('_bx_events_popup_title_sn_edit');
+                break;
+        }
+
+        return $sResult;
+    }
+
     public function getFormCallBackUrlAPI($sAction, $iId = 0)
     {
          return '/api.php?r=system/perfom_action_api/TemplServiceGrid/&params[]=&o=' . $this->_sObject . '&profile_id=' . $this->_iEventProfileId . '&a=' . $sAction . '&id=' . $iId;

+ 15 - 5
template/scripts/BxBaseGrid.php

@@ -371,19 +371,29 @@ class BxBaseGrid extends BxDolGrid
         return $aDataRv;
     }
     
-    function getFormBlockAPI($oForm, $sAction, $iId = 0){
+    public function getFormBlockAPI($oForm, $sAction, $iId = 0)
+    {
         return [
-            bx_api_get_block(
-                'form', 
-                $oForm->getCodeAPI(), 
-                ['ext' => [
+            bx_api_get_block('form', $oForm->getCodeAPI(), [
+                'ext' => [
                     'name' => $this->_oModule->getName(), 
+                    'title' => $this->getFormBlockTitleAPI($sAction, $iId),
                     'request' => ['url' => $this->getFormCallBackUrlAPI($sAction, $iId), 'immutable' => true]]
                 ]
             )
         ];
     }
 
+    public function getFormBlockTitleAPI($sAction, $iId)
+    {
+        return '';
+    }
+
+    public function getFormCallBackUrlAPI($sAction, $iId)
+    {
+        return '';
+    }
+
     /**
      * Reset query params, like filter and page number
      */