Fix: field too short

This commit is contained in:
Laurent Destailleur 2010-08-24 17:48:49 +00:00
parent 098b11e5f8
commit 29217c5270
5 changed files with 11 additions and 6 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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.= ")";

View File

@ -477,9 +477,10 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create')
print '<table class="border" width="100%">';
// Name, firstname
if ($soc->particulier)
{
print '<tr><td><span class="fieldrequired">'.$langs->trans('LastName').'</span></td><td><input type="text" size="30" name="nom" value="'.$soc->nom.'"></td>';
print '<tr><td><span class="fieldrequired">'.$langs->trans('LastName').'</span></td><td><input type="text" size="30" maxlength="60" name="nom" value="'.$soc->nom.'"></td>';
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$soc->prefix_comm.'"></td></tr>';
print '<tr><td>'.$langs->trans('FirstName').'</td><td><input type="text" size="30" name="prenom" value="'.$soc->firstname.'"></td>';
print '<td colspan=2>&nbsp;</td></tr>';
@ -489,7 +490,7 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create')
}
else
{
print '<tr><td><span class="fieldrequired">'.$langs->trans('Name').'</span></td><td><input type="text" size="30" name="nom" value="'.$soc->nom.'"></td>';
print '<tr><td><span class="fieldrequired">'.$langs->trans('Name').'</span></td><td><input type="text" size="30" maxlength="60" name="nom" value="'.$soc->nom.'"></td>';
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$soc->prefix_comm.'"></td></tr>';
}