mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Add 2 new field typeObject and ObjectId to website
This commit is contained in:
parent
eb7a8ccb73
commit
bdb38da9d3
|
|
@ -335,3 +335,6 @@ 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);
|
||||
|
|
|
|||
|
|
@ -39,5 +39,7 @@ CREATE TABLE llx_website_page
|
|||
author_alias varchar(64),
|
||||
date_creation datetime,
|
||||
tms timestamp,
|
||||
import_key varchar(14) -- import key
|
||||
import_key varchar(14), -- import k
|
||||
fk_typeobject varchar(255),
|
||||
fk_object varchar(255)
|
||||
) ENGINE=innodb;
|
||||
|
|
|
|||
|
|
@ -104,6 +104,14 @@ class WebsitePage extends CommonObject
|
|||
*/
|
||||
public $author_alias;
|
||||
|
||||
/**
|
||||
* @var string path type object
|
||||
*/
|
||||
public $fk_typeobject;
|
||||
/**
|
||||
* @var string path name object
|
||||
*/
|
||||
public $fk_object;
|
||||
|
||||
const STATUS_DRAFT = 0;
|
||||
const STATUS_VALIDATED = 1;
|
||||
|
|
@ -161,6 +169,8 @@ 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'=>''),
|
||||
'fk_object' => array('type' => 'varchar(255)','label' => 'ObjectId', 'enabled'=>1, 'visible'=>1, 'position'=>47, 'searchall'=>0, 'help'=>'')
|
||||
);
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
|
|
@ -260,7 +270,9 @@ class WebsitePage extends CommonObject
|
|||
$sql .= " t.fk_user_creat,";
|
||||
$sql .= " t.author_alias,";
|
||||
$sql .= " t.fk_user_modif,";
|
||||
$sql .= " t.import_key";
|
||||
$sql .= " t.import_key,";
|
||||
$sql .= " t.fk_typeobject,";
|
||||
$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
|
||||
$sql .= ' WHERE 1 = 1';
|
||||
|
|
@ -319,6 +331,8 @@ 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->fk_object = $obj->fk_object;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
|
|
@ -374,7 +388,9 @@ class WebsitePage extends CommonObject
|
|||
$sql .= " t.fk_user_creat,";
|
||||
$sql .= " t.author_alias,";
|
||||
$sql .= " t.fk_user_modif,";
|
||||
$sql .= " t.import_key";
|
||||
$sql .= " t.import_key,";
|
||||
$sql .= " t.fk_typeobject,";
|
||||
$sql .= " t.fk_object";
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
|
||||
$sql .= ' WHERE t.fk_website = '.$websiteid;
|
||||
// Manage filter
|
||||
|
|
@ -443,6 +459,8 @@ 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->fk_object = $obj->fk_object;
|
||||
//var_dump($record->id);
|
||||
$records[$record->id] = $record;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -981,6 +981,12 @@ 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++;
|
||||
|
|
@ -1657,7 +1663,12 @@ 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'));
|
||||
|
||||
if(GETPOSTISSET('WEBSITE_OBJECTCLASS')){
|
||||
$objectpage->fk_typeobject = GETPOST('WEBSITE_OBJECTCLASS', 'alpha');
|
||||
}
|
||||
if(GETPOSTISSET('WEBSITE_OBJECTID')){
|
||||
$objectpage->fk_typeobject = 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'));
|
||||
if ($newdatecreation) $objectpage->date_creation = $newdatecreation;
|
||||
|
||||
|
|
@ -3578,6 +3589,18 @@ if ($action == 'editmeta' || $action == 'createcontainer')
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '<tr><td class="titlefieldcreate">';
|
||||
print 'ObjectClass';
|
||||
print '</td><td>';
|
||||
print '<input type="text" class="flat minwidth300" name="WEBSITE_OBJECTCLASS" placeholder="/path/class/ObjectClass.class.php" >';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td class="titlefieldcreate">';
|
||||
print 'ObjectID';
|
||||
print '</td><td>';
|
||||
print '<input type="text" class="flat minwidth300" name="WEBSITE_OBJECTID" >';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
$fuser = new User($db);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user