Rename fk_typeobject to type_object

This commit is contained in:
Florian 2020-10-01 15:18:19 +02:00
parent 71f49c643a
commit c89f8b323b
4 changed files with 10 additions and 10 deletions

View File

@ -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_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); ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255);

View File

@ -40,6 +40,6 @@ CREATE TABLE llx_website_page
date_creation datetime, date_creation datetime,
tms timestamp, tms timestamp,
import_key varchar(14), -- import key import_key varchar(14), -- import key
fk_typeobject varchar(255), object_type varchar(255),
fk_object varchar(255) fk_object varchar(255)
) ENGINE=innodb; ) ENGINE=innodb;

View File

@ -108,7 +108,7 @@ class WebsitePage extends CommonObject
/** /**
* @var string path of external object * @var string path of external object
*/ */
public $fk_typeobject; public $object_type;
/** /**
* @var string id of external object * @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_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), //'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), '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'=>'') 'fk_object' => array('type' => 'varchar(255)','label' => 'ObjectId', 'enabled'=>1, 'visible'=>1, 'position'=>47, 'searchall'=>0, 'help'=>'')
); );
// END MODULEBUILDER PROPERTIES // END MODULEBUILDER PROPERTIES
@ -273,7 +273,7 @@ class WebsitePage extends CommonObject
$sql .= " t.author_alias,"; $sql .= " t.author_alias,";
$sql .= " t.fk_user_modif,"; $sql .= " t.fk_user_modif,";
$sql .= " t.import_key,"; $sql .= " t.import_key,";
$sql .= " t.fk_typeobject,"; $sql .= " t.object_type,";
$sql .= " t.fk_object"; $sql .= " t.fk_object";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
//$sql .= ' WHERE entity IN ('.getEntity('website').')'; // entity is on website level //$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->author_alias = $obj->author_alias;
$this->fk_user_modif = $obj->fk_user_modif; $this->fk_user_modif = $obj->fk_user_modif;
$this->import_key = $obj->import_key; $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->fk_object = $obj->fk_object;
} }
$this->db->free($resql); $this->db->free($resql);
@ -391,7 +391,7 @@ class WebsitePage extends CommonObject
$sql .= " t.author_alias,"; $sql .= " t.author_alias,";
$sql .= " t.fk_user_modif,"; $sql .= " t.fk_user_modif,";
$sql .= " t.import_key,"; $sql .= " t.import_key,";
$sql .= " t.fk_typeobject,"; $sql .= " t.object_type,";
$sql .= " t.fk_object"; $sql .= " t.fk_object";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
$sql .= ' WHERE t.fk_website = '.$websiteid; $sql .= ' WHERE t.fk_website = '.$websiteid;
@ -461,7 +461,7 @@ class WebsitePage extends CommonObject
$record->author_alias = $obj->author_alias; $record->author_alias = $obj->author_alias;
$record->fk_user_modif = $obj->fk_user_modif; $record->fk_user_modif = $obj->fk_user_modif;
$record->import_key = $obj->import_key; $record->import_key = $obj->import_key;
$record->fk_typeobject = $obj->fk_typeobject; $record->object_type = $obj->object_type;
$record->fk_object = $obj->fk_object; $record->fk_object = $obj->fk_object;
//var_dump($record->id); //var_dump($record->id);
$records[$record->id] = $record; $records[$record->id] = $record;

View File

@ -942,7 +942,7 @@ if ($action == 'addcontainer')
$objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml')); $objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml'));
$objectpage->htmlheader = GETPOST('htmlheader', 'none'); $objectpage->htmlheader = GETPOST('htmlheader', 'none');
$objectpage->author_alias = GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml'); $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'); $objectpage->fk_object = GETPOST('WEBSITE_OBJECTID');
$substitutionarray = array(); $substitutionarray = array();
$substitutionarray['__WEBSITE_CREATE_BY__'] = $user->getFullName($langs); $substitutionarray['__WEBSITE_CREATE_BY__'] = $user->getFullName($langs);
@ -1659,7 +1659,7 @@ if ($action == 'updatemeta')
$objectpage->htmlheader = trim(GETPOST('htmlheader', 'none')); $objectpage->htmlheader = trim(GETPOST('htmlheader', 'none'));
$objectpage->fk_page = (GETPOST('pageidfortranslation', 'int') > 0 ? GETPOST('pageidfortranslation', 'int') : 0); $objectpage->fk_page = (GETPOST('pageidfortranslation', 'int') > 0 ? GETPOST('pageidfortranslation', 'int') : 0);
$objectpage->author_alias = trim(GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml')); $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'); $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')); $newdatecreation = dol_mktime(GETPOST('datecreationhour', 'int'), GETPOST('datecreationmin', 'int'), GETPOST('datecreationsec', 'int'), GETPOST('datecreationmonth', 'int'), GETPOST('datecreationday', 'int'), GETPOST('datecreationyear', 'int'));