Add a control of file format
This commit is contained in:
parent
f6d1913bb7
commit
81116da33b
@ -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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user