Skip to content
Snippets Groups Projects
Commit 81116da3 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Add a control of file format

parent f6d1913b
No related branches found
No related tags found
No related merge requests found
......@@ -623,6 +623,17 @@ if ($step == 4 && $datatoimport)
$obj->separator = $separator;
$obj->enclosure = $enclosure;
}
if ($model == 'xlsx') {
if (! preg_match('/\.xlsx$/i', $filetoimport))
{
$langs->load("errors");
$param='&datatoimport='.$datatoimport.'&format='.$format;
setEventMessages($langs->trans("ErrorFileMustHaveFormat", $model),null,'errors');
header("Location: ".$_SERVER["PHP_SELF"].'?step=3'.$param.'&filetoimport='.urlencode($relativepath));
exit;
}
}
// Load source fields in input file
$fieldssource=array();
......
......@@ -173,6 +173,7 @@ ErrorOppStatusRequiredIfAmount=You set an estimated amount for this opportunity/
ErrorBadDefinitionOfMenuArrayInModuleDescriptor=Bad Definition Of Menu Array In Module Descriptor (bad value for key fk_menu)
ErrorSavingChanges=An error has ocurred when saving the changes
ErrorWarehouseRequiredIntoShipmentLine=Warehouse is required on the line to ship
ErrorFileMustHaveFormat=File must have format %s
# Warnings
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment