Skip to content
Snippets Groups Projects
Commit 29634304 authored by Laurent Destailleur's avatar Laurent Destailleur Committed by GitHub
Browse files

Merge pull request #5795 from atm-ph/fix_4.0_value_too_long

Fix fields too long for database
parents e4f17c87 058cf61a
No related branches found
No related tags found
No related merge requests found
......@@ -111,6 +111,9 @@ class CompanyBankAccount extends Account
$this->create();
}
if (dol_strlen($this->domiciliation) > 255) $this->domiciliation = dol_trunc($this->domiciliation, 254, 'right', 'UTF-8', 1);
if (dol_strlen($this->owner_address) > 255) $this->owner_address = dol_trunc($this->owner_address, 254, 'right', 'UTF-8', 1);
$sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET";
$sql.= " bank = '" .$this->db->escape($this->bank)."'";
$sql.= ",code_banque='".$this->code_banque."'";
......
......@@ -541,7 +541,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
}
print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="4">';
print '<textarea name="domiciliation" rows="4" cols="40">';
print '<textarea name="domiciliation" rows="4" cols="40" maxlength="255">';
print $account->domiciliation;
print "</textarea></td></tr>";
......@@ -550,7 +550,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
print "</td></tr>\n";
print '<tr><td>'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="4">';
print "<textarea name=\"owner_address\" rows=\"4\" cols=\"40\">";
print "<textarea name=\"owner_address\" rows=\"4\" cols=\"40\" maxlength=\"255\">";
print $account->owner_address;
print "</textarea></td></tr>";
......@@ -644,7 +644,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer)
print '<td colspan="4"><input size="12" type="text" name="bic" value="'.GETPOST('bic').'"></td></tr>';
print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="4">';
print '<textarea name="domiciliation" rows="4" cols="40">';
print '<textarea name="domiciliation" rows="4" cols="40" maxlength="255">';
print GETPOST('domiciliation');
print "</textarea></td></tr>";
......@@ -653,7 +653,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer)
print "</td></tr>\n";
print '<tr><td>'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="4">';
print '<textarea name="owner_address" rows="4" cols="40">';
print '<textarea name="owner_address" rows="4" cols="40" maxlength="255">';
print GETPOST('owner_address');
print "</textarea></td></tr>";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment