Add result message on extrafield deletion

This commit is contained in:
Laurent Destailleur
2023-09-19 16:42:50 +02:00
parent 4fa60709d5
commit bd4efca9e7
2 changed files with 7 additions and 2 deletions

View File

@@ -401,8 +401,12 @@ if ($action == 'update') {
// Delete attribute
if ($action == 'delete') {
if (GETPOSTISSET("attrname") && preg_match("/^\w[a-zA-Z0-9-_]*$/", GETPOST("attrname", 'aZ09'))) {
$result = $extrafields->delete(GETPOST("attrname", 'aZ09'), $elementtype);
$attributekey = GETPOST('attrname', 'aZ09');
$result = $extrafields->delete($attributekey, $elementtype);
if ($result >= 0) {
setEventMessages($langs->trans("ExtrafieldsDeleted", $attributekey), null, 'mesgs');
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else {

View File

@@ -2416,4 +2416,5 @@ AllowAnyPrivileges=If a user A has this permission, he can create a user B with
ThisValueCanBeReadBecauseInstanceIsNotInProductionMode=This value can be read because your instance is not set in production mode
SeeConfFile=See inside conf.php file on the server
ReEncryptDesc=Reencrypt data if not yet encrypted
PasswordFieldEncrypted=%s new record have this field been encrypted
PasswordFieldEncrypted=%s new record have this field been encrypted
ExtrafieldsDeleted=Extrafields %s has been deleted