Fix: sql error with postgres when creating extrafield with an upper cas
character. code for new fields must be always lowercase.
This commit is contained in:
parent
b1eef7cd42
commit
63a2aa3365
@ -117,8 +117,8 @@ if ($action == 'add')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Type et taille non encore pris en compte => varchar(255)
|
// attrname must be alphabetical and lower case only
|
||||||
if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname']))
|
if (isset($_POST["attrname"]) && preg_match("/^[a-z0-9-_]+$/",$_POST['attrname']))
|
||||||
{
|
{
|
||||||
// Construct array for parameter (value of select list)
|
// Construct array for parameter (value of select list)
|
||||||
$default_value = GETPOST('default_value');
|
$default_value = GETPOST('default_value');
|
||||||
@ -159,7 +159,7 @@ if ($action == 'add')
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode"));
|
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialNorUpperCharacters",$langs->transnoentities("AttributeCode"));
|
||||||
setEventMessage($mesg,'errors');
|
setEventMessage($mesg,'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,7 +70,7 @@
|
|||||||
<!-- Label -->
|
<!-- Label -->
|
||||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Label"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo GETPOST('label'); ?>"></td></tr>
|
<tr><td class="fieldrequired"><?php echo $langs->trans("Label"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo GETPOST('label'); ?>"></td></tr>
|
||||||
<!-- Code -->
|
<!-- Code -->
|
||||||
<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?> (<?php echo $langs->trans("AlphaNumOnlyCharsAndNoSpace"); ?>)</td><td class="valeur"><input type="text" name="attrname" id="attrname" size="10" value="<?php echo GETPOST('attrname'); ?>"></td></tr>
|
<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?></td><td class="valeur"><input type="text" name="attrname" id="attrname" size="10" value="<?php echo GETPOST('attrname'); ?>"> (<?php echo $langs->trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)</td></tr>
|
||||||
<!-- Type -->
|
<!-- Type -->
|
||||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur">
|
<tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur">
|
||||||
<?php print $form->selectarray('type',$type2label,GETPOST('type')); ?>
|
<?php print $form->selectarray('type',$type2label,GETPOST('type')); ?>
|
||||||
|
|||||||
@ -983,6 +983,7 @@ ExtraFieldsProject=Complementary attributes (projects)
|
|||||||
ExtraFieldsProjectTask=Complementary attributes (tasks)
|
ExtraFieldsProjectTask=Complementary attributes (tasks)
|
||||||
ExtraFieldHasWrongValue=Attribut %s has a wrong value.
|
ExtraFieldHasWrongValue=Attribut %s has a wrong value.
|
||||||
AlphaNumOnlyCharsAndNoSpace=only alphanumericals characters without space
|
AlphaNumOnlyCharsAndNoSpace=only alphanumericals characters without space
|
||||||
|
AlphaNumOnlyLowerCharsAndNoSpace=only alphanumericals and lower case characters without space
|
||||||
SendingMailSetup=Setup of sendings by email
|
SendingMailSetup=Setup of sendings by email
|
||||||
SendmailOptionNotComplete=Warning, on some Linux systems, to send email from your email, sendmail execution setup must contains option -ba (parameter mail.force_extra_parameters into your php.ini file). If some recipients never receive emails, try to edit this PHP parameter with mail.force_extra_parameters = -ba).
|
SendmailOptionNotComplete=Warning, on some Linux systems, to send email from your email, sendmail execution setup must contains option -ba (parameter mail.force_extra_parameters into your php.ini file). If some recipients never receive emails, try to edit this PHP parameter with mail.force_extra_parameters = -ba).
|
||||||
PathToDocuments=Path to documents
|
PathToDocuments=Path to documents
|
||||||
|
|||||||
@ -62,6 +62,7 @@ ErrorNoValueForCheckBoxType=Please fill value for checkbox list
|
|||||||
ErrorNoValueForRadioType=Please fill value for radio list
|
ErrorNoValueForRadioType=Please fill value for radio list
|
||||||
ErrorBadFormatValueList=The list value cannot have more than one come : <u>%s</u>, but need at least one: llave,valores
|
ErrorBadFormatValueList=The list value cannot have more than one come : <u>%s</u>, but need at least one: llave,valores
|
||||||
ErrorFieldCanNotContainSpecialCharacters=Field <b>%s</b> must not contains special characters.
|
ErrorFieldCanNotContainSpecialCharacters=Field <b>%s</b> must not contains special characters.
|
||||||
|
ErrorFieldCanNotContainSpecialNorUpperCharacters=Field <b>%s</b> must not contains special characters, nor upper case characters.
|
||||||
ErrorNoAccountancyModuleLoaded=No accountancy module activated
|
ErrorNoAccountancyModuleLoaded=No accountancy module activated
|
||||||
ErrorExportDuplicateProfil=This profil name already exists for this export set.
|
ErrorExportDuplicateProfil=This profil name already exists for this export set.
|
||||||
ErrorLDAPSetupNotComplete=Dolibarr-LDAP matching is not complete.
|
ErrorLDAPSetupNotComplete=Dolibarr-LDAP matching is not complete.
|
||||||
|
|||||||
@ -983,6 +983,7 @@ ExtraFieldsProject=Attributs supplémentaires (projets)
|
|||||||
ExtraFieldsProjectTask=Attributs supplémentaires (tâches)
|
ExtraFieldsProjectTask=Attributs supplémentaires (tâches)
|
||||||
ExtraFieldHasWrongValue=L'attribut %s a une valeur incorrecte.
|
ExtraFieldHasWrongValue=L'attribut %s a une valeur incorrecte.
|
||||||
AlphaNumOnlyCharsAndNoSpace=uniquement caractères alphanumériques sans espace
|
AlphaNumOnlyCharsAndNoSpace=uniquement caractères alphanumériques sans espace
|
||||||
|
AlphaNumOnlyLowerCharsAndNoSpace=uniquement caractères minuscules alphanumériques sans espace
|
||||||
SendingMailSetup=Configuration de l'envoi par email
|
SendingMailSetup=Configuration de l'envoi par email
|
||||||
SendmailOptionNotComplete=Attention, sur certains systèmes Linux, avec cette méthode d'envoi, pour pouvoir envoyer des emails en votre nom, la configuration d'exécution de sendmail doit contenir l'option <b>-ba</b> (paramètre <b>mail.force_extra_parameters</b> dans le fichier <b>php.ini</b>). Si certains de vos destinataires ne reçoivent pas de message, essayer de modifier ce paramètre PHP avec <b>mail.force_extra_parameters = -ba</b>.
|
SendmailOptionNotComplete=Attention, sur certains systèmes Linux, avec cette méthode d'envoi, pour pouvoir envoyer des emails en votre nom, la configuration d'exécution de sendmail doit contenir l'option <b>-ba</b> (paramètre <b>mail.force_extra_parameters</b> dans le fichier <b>php.ini</b>). Si certains de vos destinataires ne reçoivent pas de message, essayer de modifier ce paramètre PHP avec <b>mail.force_extra_parameters = -ba</b>.
|
||||||
PathToDocuments=Chemin d'accès aux documents
|
PathToDocuments=Chemin d'accès aux documents
|
||||||
|
|||||||
@ -62,6 +62,7 @@ ErrorNoValueForCheckBoxType=Les valeurs de la liste de case a cochées doivent
|
|||||||
ErrorNoValueForRadioType=Les valeurs de la liste d'options doivent être renseignées
|
ErrorNoValueForRadioType=Les valeurs de la liste d'options doivent être renseignées
|
||||||
ErrorBadFormatValueList=Les valeurs de la liste ne peuvent pas contenir plus d'une virgule : <b>%s</b>, mais doivent en avoir au moins une: clef,valeur
|
ErrorBadFormatValueList=Les valeurs de la liste ne peuvent pas contenir plus d'une virgule : <b>%s</b>, mais doivent en avoir au moins une: clef,valeur
|
||||||
ErrorFieldCanNotContainSpecialCharacters=Le champ <b>%s</b> ne peut contenir de caractères spéciaux.
|
ErrorFieldCanNotContainSpecialCharacters=Le champ <b>%s</b> ne peut contenir de caractères spéciaux.
|
||||||
|
ErrorFieldCanNotContainSpecialNorUpperCharacters=Le champ <b>%s</b> ne peut contenir de caractères spéciaux, ni de caractères en majuscules.
|
||||||
ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé
|
ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé
|
||||||
ErrorExportDuplicateProfil=Ce nom de profil existe déjà pour ce lot d'export.
|
ErrorExportDuplicateProfil=Ce nom de profil existe déjà pour ce lot d'export.
|
||||||
ErrorLDAPSetupNotComplete=Le matching Dolibarr-LDAP est incomplet.
|
ErrorLDAPSetupNotComplete=Le matching Dolibarr-LDAP est incomplet.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user