diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 79401b57798..3816fa6ee58 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -426,7 +426,7 @@ if ($id > 0) print ''; - /* + /* // Ref print '"; + print '"; print ""; // Period end date diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 1ba0773afff..1fdd567745f 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -153,6 +153,8 @@ class ChargeSociales extends CommonObject { global $conf; + $now=dol_now(); + // Nettoyage parametres $newamount=price2num($this->amount,'MT'); @@ -162,17 +164,18 @@ class ChargeSociales extends CommonObject return -2; } - $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, entity)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, entity, fk_user_author, date_creation)"; $sql.= " VALUES (".$this->type; $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); $sql.= ", ".($this->mode_reglement_id>0?"'".$this->mode_reglement_id."'":"NULL"); - $sql.= ", '".$this->db->escape($this->lib)."',"; - $sql.= " '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."',"; - $sql.= " '".price2num($newamount)."',"; - $sql.= " ".$conf->entity; + $sql.= ", '".$this->db->escape($this->lib)."'"; + $sql.= ", '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."'"; + $sql.= ", '".price2num($newamount)."'"; + $sql.= ", ".$conf->entity; + $sql.= ", ".$user->id; + $sql.= ", '".$this->db->idate($now)."'"; $sql.= ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); @@ -276,10 +279,11 @@ class ChargeSociales extends CommonObject $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales"; - $sql.= " SET libelle='".$this->db->escape($this->lib)."',"; - $sql.= " date_ech='".$this->db->idate($this->date_ech)."',"; - $sql.= " periode='".$this->db->idate($this->periode)."',"; - $sql.= " amount='".price2num($this->amount,'MT')."'"; + $sql.= " SET libelle='".$this->db->escape($this->lib)."'"; + $sql.= ", date_ech='".$this->db->idate($this->date_ech)."'"; + $sql.= ", periode='".$this->db->idate($this->periode)."'"; + $sql.= ", amount='".price2num($this->amount,'MT')."'"; + $sql.= ", fk_user_modif=".$user->id; $sql.= " WHERE rowid=".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); @@ -505,8 +509,9 @@ class ChargeSociales extends CommonObject */ function info($id) { - $sql = "SELECT e.rowid, e.tms as datem, e.date_creation as datec, e.date_valid as datev, e.import_key"; - $sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as e"; + $sql = "SELECT e.rowid, e.tms as datem, e.date_creation as datec, e.date_valid as datev, e.import_key,"; + $sql.= " fk_user_author, fk_user_modif, fk_user_valid"; + $sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as e"; $sql.= " WHERE e.rowid = ".$id; dol_syslog(get_class($this)."::info", LOG_DEBUG); @@ -522,7 +527,13 @@ class ChargeSociales extends CommonObject if ($obj->fk_user_author) { $cuser = new User($this->db); $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; + $this->user_creation = $cuser; + } + + if ($obj->fk_user_modif) { + $muser = new User($this->db); + $muser->fetch($obj->fk_user_modif); + $this->user_modification = $muser; } if ($obj->fk_user_valid) { @@ -532,7 +543,7 @@ class ChargeSociales extends CommonObject } $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); + if (! empty($obj->fk_user_modif)) $this->date_modification = $this->db->jdate($obj->datem); $this->date_validation = $this->db->jdate($obj->datev); $this->import_key = $obj->import_key; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a86a3b939a2..58f4ff9bbb4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5188,7 +5188,7 @@ class Form -
+
'; - print ''; + print ''; print '\n"; print '\n"; print ''; @@ -198,7 +198,7 @@ if ($action == 'create') print ''; print ''; - print '
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id',$linkback); @@ -446,7 +446,7 @@ if ($id > 0) }*/ // Type - print "
".$langs->trans("Type")."".$object->type_libelle."
'.$langs->trans("Type")."".$object->type_libelle."
'.$langs->trans("Loan").'
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("DateStart").''.dol_print_date($loan->datestart,'day')."
'.$langs->trans("Label").''.$loan->label."
'.$langs->trans("Amount").''.price($loan->capital,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans("Payment").'
'.$langs->trans("Date").''; + print '
'.$langs->trans("Date").''; $datepaid = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $datepayment = empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaye):0; $form->select_date($datepayment, '', '', '', '', "add_payment", 1, 1); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 19fae0b6342..81b4458706c 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -268,6 +268,21 @@ class Products extends DolibarrApi return $categories->getListForItem('product', $sortfield, $sortorder, $limit, $page, $id); } + /** + * Clean sensible object datas + * + * @param object $object Object to clean + * @return array Array of cleaned object properties + */ + function _cleanObjectDatas($object) { + + $object = parent::_cleanObjectDatas($object); + + unset($object->regeximgext); + + return $object; + } + /** * Validate fields before create or update object * diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 2cec79d7020..216d08df637 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -685,7 +685,7 @@ if ($id > 0 || $ref) { dol_print_error($db); } - print '
'.$langs->trans("LastMovement").''; + print '
'.$langs->trans("LastMovement").''; if ($lastmovementdate) { print dol_print_date($lastmovementdate,'dayhour').' ';