diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 26231534f67..7fd906044f6 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -79,16 +79,13 @@ class Website extends CommonObject * @var mixed */ public $date_creation; - - /** - * @var mixed - */ - public $tms = ''; + public $date_modification; /** * @var integer */ public $fk_default_home; + public $fk_user_creat; /** * @var string @@ -169,7 +166,7 @@ class Website extends CommonObject $sql .= ' '.(! isset($this->virtualhost)?'NULL':"'".$this->db->escape($this->virtualhost)."'").","; $sql .= ' '.(! isset($this->fk_user_creat)?$user->id:$this->fk_user_creat).','; $sql .= ' '.(! isset($this->date_creation) || dol_strlen($this->date_creation)==0?'NULL':"'".$this->db->idate($this->date_creation)."'").","; - $sql .= ' '.(! isset($this->date_modification) || dol_strlen($this->date_modification)==0?'NULL':"'".$this->db->idate($this->date_creation)."'"); + $sql .= ' '.(! isset($this->date_modification) || dol_strlen($this->date_modification)==0?'NULL':"'".$this->db->idate($this->date_modification)."'"); $sql .= ')'; $this->db->begin(); @@ -525,6 +522,7 @@ class Website extends CommonObject global $hookmanager, $langs; global $dolibarr_main_data_root; + $now = dol_now(); $error=0; dol_syslog(__METHOD__, LOG_DEBUG); @@ -560,6 +558,8 @@ class Website extends CommonObject $object->ref=$newref; $object->fk_default_home=0; $object->virtualhost=''; + $object->date_creation = $now; + $object->fk_user_creat = $user->id; // Create clone $object->context['createfromclone'] = 'createfromclone'; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index e84acc03527..3c166c1d1f8 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -410,6 +410,8 @@ class WebsitePage extends CommonObject public function createFromClone(User $user, $fromid, $newref, $newlang='', $istranslation=0, $newwebsite=0, $keeptitleunchanged=0) { global $hookmanager, $langs; + + $now = dol_now(); $error = 0; dol_syslog(__METHOD__, LOG_DEBUG); @@ -428,6 +430,7 @@ class WebsitePage extends CommonObject $object->pageurl = $newref; $object->aliasalt = ''; $object->fk_user_creat = $user->id; + $object->date_creation = $now; $object->title = ($keeptitleunchanged ? '' : $langs->trans("CopyOf").' ').$object->title; if (! empty($newlang)) $object->lang=$newlang; if ($istranslation) $object->fk_page = $fromid; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0c7ae842c9b..f0e97b22a13 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1163,6 +1163,8 @@ if ($action == 'updatemeta') $objectpage->keywords = GETPOST('WEBSITE_KEYWORDS', 'alpha'); $objectpage->lang = GETPOST('WEBSITE_LANG', 'aZ09'); $objectpage->htmlheader = trim(GETPOST('htmlheader', 'none')); + $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; $res = $objectpage->update($user); if (! ($res > 0)) @@ -2506,7 +2508,8 @@ if ($action == 'editmeta' || $action == 'createcontainer') $pagehtmlheader=$objectpage->htmlheader; $pagedatecreation=$objectpage->date_creation; $pagedatemodification=$objectpage->date_modification; - $pageauthorid=$objectpage->fk_user_create; + $pageauthorid=$objectpage->fk_user_creat; + $pageusermodifid=$objectpage->fk_user_modif; } else { @@ -2633,23 +2636,37 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ''; $fuser=new User($db); - $fuser->fetch($pageauthorid); print ''; print $langs->trans('Author'); print ''; - if ($pageauthorid > 0) print $fuser->getNomUrl(1); + if ($pageauthorid > 0) + { + $fuser->fetch($pageauthorid); + print $fuser->getNomUrl(1); + } print ''; print ''; print $langs->trans('DateCreation'); print ''; - print dol_print_date($pagedatecreation, 'dayhour'); + print $form->select_date($pagedatecreation, 'datecreation', 1, 1, 0, '', 1, 1); + //print dol_print_date($pagedatecreation, 'dayhour'); print ''; if ($action != 'createcontainer') { - print ''; + print ''; + print $langs->trans('LastModificationAuthor'); + print ''; + if ($pageusermodifid > 0) + { + $fuser->fetch($pageusermodifid); + print $fuser->getNomUrl(1); + } + print ''; + + print ''; print $langs->trans('DateModification'); print ''; print dol_print_date($pagedatemodification, 'dayhour');