From c89f8b323b256e4c12fe6063c8f92c9d6394c073 Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 1 Oct 2020 15:18:19 +0200 Subject: [PATCH] Rename fk_typeobject to type_object --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_website_page.sql | 2 +- htdocs/website/class/websitepage.class.php | 12 ++++++------ htdocs/website/index.php | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index e177d53d6cc..cae368aea21 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -331,5 +331,5 @@ ALTER TABLE llx_bank ADD COLUMN import_key varchar(14); ALTER TABLE llx_menu MODIFY COLUMN enabled text; -ALTER TABLE llx_website_page ADD COLUMN fk_typeobject varchar(255); +ALTER TABLE llx_website_page ADD COLUMN object_type varchar(255); ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255); diff --git a/htdocs/install/mysql/tables/llx_website_page.sql b/htdocs/install/mysql/tables/llx_website_page.sql index ec2d6f4c72b..e2bec4a8a24 100644 --- a/htdocs/install/mysql/tables/llx_website_page.sql +++ b/htdocs/install/mysql/tables/llx_website_page.sql @@ -40,6 +40,6 @@ CREATE TABLE llx_website_page date_creation datetime, tms timestamp, import_key varchar(14), -- import key - fk_typeobject varchar(255), + object_type varchar(255), fk_object varchar(255) ) ENGINE=innodb; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index aa256960f0f..8e9584a86ac 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -108,7 +108,7 @@ class WebsitePage extends CommonObject /** * @var string path of external object */ - public $fk_typeobject; + public $object_type; /** * @var string id of external object @@ -171,7 +171,7 @@ class WebsitePage extends CommonObject 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'position'=>512), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'index'=>1, 'position'=>1000, 'notnull'=>-1), - 'fk_typeobject' => array('type' => 'varchar(255)','label' => 'ObjectType', 'enabled'=>1, 'visible'=>1, 'position'=>46, 'searchall'=>0, 'help'=>''), + 'object_type' => array('type' => 'varchar(255)','label' => 'ObjectType', 'enabled'=>1, 'visible'=>1, 'position'=>46, 'searchall'=>0, 'help'=>''), 'fk_object' => array('type' => 'varchar(255)','label' => 'ObjectId', 'enabled'=>1, 'visible'=>1, 'position'=>47, 'searchall'=>0, 'help'=>'') ); // END MODULEBUILDER PROPERTIES @@ -273,7 +273,7 @@ class WebsitePage extends CommonObject $sql .= " t.author_alias,"; $sql .= " t.fk_user_modif,"; $sql .= " t.import_key,"; - $sql .= " t.fk_typeobject,"; + $sql .= " t.object_type,"; $sql .= " t.fk_object"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; //$sql .= ' WHERE entity IN ('.getEntity('website').')'; // entity is on website level @@ -333,7 +333,7 @@ class WebsitePage extends CommonObject $this->author_alias = $obj->author_alias; $this->fk_user_modif = $obj->fk_user_modif; $this->import_key = $obj->import_key; - $this->fk_typeobject = $obj->fk_typeobject; + $this->object_type = $obj->object_type; $this->fk_object = $obj->fk_object; } $this->db->free($resql); @@ -391,7 +391,7 @@ class WebsitePage extends CommonObject $sql .= " t.author_alias,"; $sql .= " t.fk_user_modif,"; $sql .= " t.import_key,"; - $sql .= " t.fk_typeobject,"; + $sql .= " t.object_type,"; $sql .= " t.fk_object"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' WHERE t.fk_website = '.$websiteid; @@ -461,7 +461,7 @@ class WebsitePage extends CommonObject $record->author_alias = $obj->author_alias; $record->fk_user_modif = $obj->fk_user_modif; $record->import_key = $obj->import_key; - $record->fk_typeobject = $obj->fk_typeobject; + $record->object_type = $obj->object_type; $record->fk_object = $obj->fk_object; //var_dump($record->id); $records[$record->id] = $record; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 29dd6c44929..db859573707 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -942,7 +942,7 @@ if ($action == 'addcontainer') $objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml')); $objectpage->htmlheader = GETPOST('htmlheader', 'none'); $objectpage->author_alias = GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml'); - $objectpage->fk_typeobject = GETPOST('WEBSITE_OBJECTCLASS'); + $objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS'); $objectpage->fk_object = GETPOST('WEBSITE_OBJECTID'); $substitutionarray = array(); $substitutionarray['__WEBSITE_CREATE_BY__'] = $user->getFullName($langs); @@ -1659,7 +1659,7 @@ if ($action == 'updatemeta') $objectpage->htmlheader = trim(GETPOST('htmlheader', 'none')); $objectpage->fk_page = (GETPOST('pageidfortranslation', 'int') > 0 ? GETPOST('pageidfortranslation', 'int') : 0); $objectpage->author_alias = trim(GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml')); - $objectpage->fk_typeobject = GETPOST('WEBSITE_OBJECTCLASS', 'alpha'); + $objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS', 'alpha'); $objectpage->fk_object = GETPOST('WEBSITE_OBJECTID', 'aZ09'); $newdatecreation = dol_mktime(GETPOST('datecreationhour', 'int'), GETPOST('datecreationmin', 'int'), GETPOST('datecreationsec', 'int'), GETPOST('datecreationmonth', 'int'), GETPOST('datecreationday', 'int'), GETPOST('datecreationyear', 'int'));