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

Fix fields too long for database
This commit is contained in:
Laurent Destailleur 2016-09-28 17:58:57 +02:00 committed by GitHub
commit 29634304fd
2 changed files with 7 additions and 4 deletions

View File

@ -110,6 +110,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)."'";

View File

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