Merge pull request #24424 from Hystepik/develop#1

Fix : user group date modif to match database
This commit is contained in:
Laurent Destailleur 2023-04-04 21:21:35 +02:00 committed by GitHub
commit 1c4196b6c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View File

@ -747,7 +747,7 @@ class Users extends DolibarrApi
unset($cleanObject->clicktodial_loaded); unset($cleanObject->clicktodial_loaded);
unset($cleanObject->datec); unset($cleanObject->datec);
unset($cleanObject->datem); unset($cleanObject->tms);
unset($cleanObject->members); unset($cleanObject->members);
unset($cleanObject->note); unset($cleanObject->note);
unset($cleanObject->note_private); unset($cleanObject->note_private);

View File

@ -91,7 +91,7 @@ class UserGroup extends CommonObject
* *
* @var integer * @var integer
*/ */
public $datem; public $tms;
/** /**
* @var string Description * @var string Description
@ -932,7 +932,7 @@ class UserGroup extends CommonObject
$this->name = 'DOLIBARR GROUP SPECIMEN'; $this->name = 'DOLIBARR GROUP SPECIMEN';
$this->note = 'This is a note'; $this->note = 'This is a note';
$this->datec = time(); $this->datec = time();
$this->datem = time(); $this->tms = time();
// Members of this group is just me // Members of this group is just me
$this->members = array( $this->members = array(

View File

@ -209,6 +209,7 @@ if (empty($reshook)) {
$object->name = GETPOST("nom", 'alphanohtml'); $object->name = GETPOST("nom", 'alphanohtml');
$object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml'))); $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml')));
$object->tms = dol_now();
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');

View File

@ -173,7 +173,7 @@ $morecss = array();
// Build and execute select // Build and execute select
// -------------------------------------------------------------------- // --------------------------------------------------------------------
$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms as datem, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; $sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions";
$sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_rights as ugr ON ugr.fk_usergroup = g.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_rights as ugr ON ugr.fk_usergroup = g.rowid";
@ -471,7 +471,7 @@ while ($i < $imaxinloop) {
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
print '<td class="center nowrap">'.dol_print_date($db->jdate($obj->datem), "dayhour").'</td>'; print '<td class="center nowrap">'.dol_print_date($db->jdate($obj->tms), "dayhour").'</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }