瀏覽代碼

update db schema

Olivier Massot 4 年之前
父節點
當前提交
1ad251e317

+ 4 - 1
ot_core/Classes/Controller/ActionController.php

@@ -11,7 +11,10 @@ use Opentalent\OtCore\Page\OtPageRepository;
  */
 class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
 {
-    protected $otPageRepository;
+    /**
+     * @var OtPageRepository
+     */
+    protected OtPageRepository $otPageRepository;
 
     public function injectOtPageRepository(OtPageRepository $otPageRepository) {
         $this->otPageRepository = $otPageRepository;

+ 14 - 0
ot_core/Configuration/TCA/Overrides/pages.php

@@ -10,6 +10,13 @@ $columns = array (
             'type' => 'input',
         )
     ),
+    'tx_opentalent_structure_domain' => array (
+        'label' => 'LLL:EXT:ot_core/Resources/Private/Language/locallang.xlf:structure_id',
+        'displayCond' => 'HIDE_FOR_NON_ADMINS',
+        'config' => array (
+            'type' => 'input',
+        )
+    )
 );
 
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
@@ -23,3 +30,10 @@ $columns = array (
     '',
     'after:subtitle'
 );
+
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
+    'pages',
+    'tx_opentalent_structure_domain',
+    '',
+    'after:tx_opentalent_structure_id'
+);

+ 3 - 0
ot_core/Resources/Private/Language/locallang.xlf

@@ -13,6 +13,9 @@
 			<trans-unit id="structure_id">
 				<source>Id de la structure</source>
 			</trans-unit>
+			<trans-unit id="structure_domain">
+				<source>Domaine de la structure</source>
+			</trans-unit>
 		</body>
 	</file>
 </xliff>

+ 23 - 0
ot_core/ext_tables.sql

@@ -0,0 +1,23 @@
+# ext_tables.sql contient les directives permettant d ajouter des tables et champs à la DB
+
+#
+# Table structure for table 'pages'
+#
+CREATE TABLE pages (
+	tx_opentalent_structure_id bigint,
+	tx_opentalent_structure_domain varchar(255)
+);
+
+#
+# Table structure for table 'tx_opentalent_log'
+#
+CREATE TABLE tx_opentalent_log (
+    request_id varchar(13) DEFAULT '' NOT NULL,
+    time_micro double(16,4) NOT NULL default '0.0000',
+    component varchar(255) DEFAULT '' NOT NULL,
+    level tinyint(1) unsigned DEFAULT '0' NOT NULL,
+    message text,
+    data text,
+
+    KEY request (request_id)
+);

+ 1 - 17
ot_templating/ext_tables.sql

@@ -4,22 +4,6 @@
 # Table structure for table 'pages'
 #
 CREATE TABLE pages (
-	tx_opentalent_structure_id bigint,
     tx_opentalent_template varchar(100) DEFAULT '',
-    tx_opentalent_template_preferences text DEFAULT '',
-    tx_opentalent_matomo_id bigint
-);
-
-#
-# Table structure for table 'tx_opentalent_log'
-#
-CREATE TABLE tx_opentalent_log (
-    request_id varchar(13) DEFAULT '' NOT NULL,
-    time_micro double(16,4) NOT NULL default '0.0000',
-    component varchar(255) DEFAULT '' NOT NULL,
-    level tinyint(1) unsigned DEFAULT '0' NOT NULL,
-    message text,
-    data text,
-
-    KEY request (request_id)
+    tx_opentalent_template_preferences text DEFAULT ''
 );