NEW Field to link website page to an other object

This commit is contained in:
Nicolas 2020-09-28 20:39:02 +02:00
parent 789defa46f
commit dfba9a06ad
5 changed files with 14 additions and 16 deletions

View File

@ -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); 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_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);

View File

@ -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_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 fk_object varchar(255);

View File

@ -39,7 +39,7 @@ CREATE TABLE llx_website_page
author_alias varchar(64), author_alias varchar(64),
date_creation datetime, date_creation datetime,
tms timestamp, tms timestamp,
import_key varchar(14), -- import k import_key varchar(14), -- import key
fk_typeobject varchar(255), fk_typeobject varchar(255),
fk_object varchar(255) fk_object varchar(255)
) ENGINE=innodb; ) ENGINE=innodb;

View File

@ -3,6 +3,7 @@
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2020 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -105,11 +106,12 @@ class WebsitePage extends CommonObject
public $author_alias; public $author_alias;
/** /**
* @var string path type object * @var string path of external object
*/ */
public $fk_typeobject; public $fk_typeobject;
/** /**
* @var string path name object * @var string id of external object
*/ */
public $fk_object; public $fk_object;

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2016-2020 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2016-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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->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->fk_object = GETPOST('WEBSITE_OBJECTID');
$substitutionarray = array(); $substitutionarray = array();
$substitutionarray['__WEBSITE_CREATE_BY__'] = $user->getFullName($langs); $substitutionarray['__WEBSITE_CREATE_BY__'] = $user->getFullName($langs);
@ -981,12 +983,6 @@ if ($action == 'addcontainer')
if (!$error) 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); $pageid = $objectpage->create($user);
if ($pageid <= 0) { if ($pageid <= 0) {
$error++; $error++;
@ -3592,7 +3588,7 @@ if ($action == 'editmeta' || $action == 'createcontainer')
print '<tr><td class="titlefieldcreate">'; print '<tr><td class="titlefieldcreate">';
print 'ObjectClass'; print 'ObjectClass';
print '</td><td>'; print '</td><td>';
print '<input type="text" class="flat minwidth300" name="WEBSITE_OBJECTCLASS" placeholder="/path/class/ObjectClass.class.php" >'; print '<input type="text" class="flat minwidth300" name="WEBSITE_OBJECTCLASS" placeholder="ClassName::/path/class/ObjectClass.class.php" >';
print '</td></tr>'; print '</td></tr>';
print '<tr><td class="titlefieldcreate">'; print '<tr><td class="titlefieldcreate">';