diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 23830014690..994e5d89495 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -335,6 +335,3 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (72 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (722, 72, '18','0', '0.9', '1', 'VAT Rate 18+0.9', 1); ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; - -ALTER TABLE llx_website_page Add COLUMN fk_typeobject varchar(255); -ALTER TABLE llx_website_page Add COLUMN fk_object varchar(255); 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 e76948808bb..e177d53d6cc 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 @@ -330,3 +330,6 @@ ALTER TABLE llx_bank ADD COLUMN origin_type varchar(64) NULL; 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 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 ae339cfd119..ec2d6f4c72b 100644 --- a/htdocs/install/mysql/tables/llx_website_page.sql +++ b/htdocs/install/mysql/tables/llx_website_page.sql @@ -39,7 +39,7 @@ CREATE TABLE llx_website_page author_alias varchar(64), date_creation datetime, tms timestamp, - import_key varchar(14), -- import k + import_key varchar(14), -- import key fk_typeobject varchar(255), - fk_object 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 a3563418873..aa256960f0f 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaƫl Doursenaud + * Copyright (C) 2020 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -104,12 +105,13 @@ class WebsitePage extends CommonObject */ public $author_alias; - /** - * @var string path type object + /** + * @var string path of external object */ public $fk_typeobject; + /** - * @var string path name object + * @var string id of external object */ public $fk_object; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ce3f41676a0..add9e07eff5 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1,5 +1,6 @@ + * Copyright (C) 2020 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -941,7 +942,8 @@ 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->fk_object = GETPOST('WEBSITE_OBJECTID'); $substitutionarray = array(); $substitutionarray['__WEBSITE_CREATE_BY__'] = $user->getFullName($langs); @@ -981,12 +983,6 @@ if ($action == 'addcontainer') if (!$error) { - if (GETPOSTISSET('WEBSITE_OBJECTCLASS')){ - $objectpage->fk_typeobject = GETPOST('WEBSITE_OBJECTCLASS'); - } - if (GETPOSTISSET('WEBSITE_OBJECTID')){ - $objectpage->fk_object = GETPOST('WEBSITE_OBJECTID'); - } $pageid = $objectpage->create($user); if ($pageid <= 0) { $error++; @@ -3592,7 +3588,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ''; print 'ObjectClass'; print ''; - print ''; + print ''; print ''; print '';