diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f20dcad0319..da4e1ba1a7c 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -105,8 +105,8 @@ class ActionComm extends CommonObject $now=dol_now('tzserver'); // Clean parameters - $this->label=trim($this->label); - $this->location=trim($this->location); + $this->label=dol_trunc(trim($this->label),128); + $this->location=dol_trunc(trim($this->location),128); $this->note=dol_htmlcleanlastbr(trim($this->note)); if (! $this->percentage) $this->percentage = 0; if (! $this->priority) $this->priority = 0; diff --git a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql index b2f665cc7de..5e9fb75db17 100644 --- a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql +++ b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql @@ -34,3 +34,5 @@ ALTER TABLE llx_notify_def ADD COLUMN type varchar(16) DEFAULT 'email'; ALTER TABLE llx_notify MODIFY fk_contact integer NULL; ALTER TABLE llx_notify ADD COLUMN fk_user integer NULL after fk_contact; ALTER TABLE llx_notify ADD COLUMN type varchar(16) DEFAULT 'email'; + +ALTER TABLE llx_actioncomm MODIFY label varchar(128) NOT NULL; diff --git a/htdocs/install/mysql/tables/llx_actioncomm.sql b/htdocs/install/mysql/tables/llx_actioncomm.sql index c2f55bb02f8..23383be70b2 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm.sql @@ -30,7 +30,7 @@ create table llx_actioncomm datea2 datetime, -- deprecated fk_action integer, -- type de l'action - label varchar(50) NOT NULL, -- libelle de l'action + label varchar(128) NOT NULL, -- libelle de l'action datec datetime, -- date creation tms timestamp, -- date modif diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5c4558c0a9d..a063c7d6b3c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -186,13 +186,15 @@ class Societe extends CommonObject if ($this->code_client == -1) $this->get_codeclient($this->prefix_comm,0); if ($this->code_fournisseur == -1) $this->get_codefournisseur($this->prefix_comm,1); + $now=dol_now(); + // Check more parameters $result = $this->verify(); if ($result >= 0) { $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, entity, datec, datea, fk_user_creat)"; - $sql.= " VALUES ('".addslashes($this->nom)."', ".$conf->entity.", ".$this->db->idate(gmmktime()).", ".$this->db->idate(gmmktime()).","; + $sql.= " VALUES ('".$db->escape($this->nom)."', ".$conf->entity.", '".$this->db->idate($now)."', '".$this->db->idate($now)."',"; $sql.= " ".($user->id > 0 ? "'".$user->id."'":"null"); $sql.= ")"; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index d32b2b167f7..1932d5381c2 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -477,9 +477,10 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create') print '
| '.$langs->trans('LastName').' | '; + print ' | ||
| '.$langs->trans('LastName').' | '; print ' | '.$langs->trans('Prefix').' | |
| '.$langs->trans('FirstName').' | '; print ' | ||
| '.$langs->trans('Name').' | '; + print ' | ||
| '.$langs->trans('Name').' | '; print ' | '.$langs->trans('Prefix').' | |