27require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
50 public $errors = array();
55 public $warnings = array();
76 public $version =
'dolibarr';
82 public $phpmin = array(7, 0);
97 public $driverlabel = array();
99 public $driverdesc = array();
101 public $driverversion = array();
103 public $drivererror = array();
105 public $liblabel = array();
107 public $libversion = array();
137 public $thirdpartyobject;
151 if (is_object($hookmanager)) {
152 $hookmanager->initHooks(array(
'import'));
153 $parameters = array();
154 $reshook = $hookmanager->executeHooks(
'constructModeleImports', $parameters, $this);
155 if ($reshook >= 0 && !empty($hookmanager->resArray)) {
156 foreach ($hookmanager->resArray as $mapList) {
157 self::$mapTableToElement[$mapList[
'table']] = $mapList[
'element'];
200 return $this->extension;
210 return $this->version;
220 return $this->label_lib;
230 return $this->version_lib;
243 dol_syslog(get_class($this).
"::listOfAvailableImportFormat");
245 $dir = DOL_DOCUMENT_ROOT.
"/core/modules/import/";
246 $handle = opendir($dir);
249 if (is_resource($handle)) {
250 while (($file = readdir($handle)) !==
false) {
252 if (preg_match(
"/^import_(.*)\.modules\.php/i", $file, $reg)) {
256 $file = $dir.
"/import_".$moduleid.
".modules.php";
257 $classname =
"Import".ucfirst($moduleid);
260 $module =
new $classname($db,
'');
263 $this->picto[$module->id] = $module->picto;
265 $this->driverlabel[$module->id] = $module->getDriverLabel(
'');
266 $this->driverdesc[$module->id] = $module->getDriverDesc(
'');
267 $this->driverversion[$module->id] = $module->getDriverVersion(
'');
268 $this->drivererror[$module->id] = $module->error ? $module->error :
'';
270 $this->liblabel[$module->id] = ($module->error ?
'<span class="error">'.$module->error.
'</span>' : $module->getLibLabel(
''));
271 $this->libversion[$module->id] = $module->getLibVersion(
'');
276 return array_keys($this->driverlabel);
288 return $this->picto[$key];
299 return $this->driverlabel[$key];
310 return $this->driverdesc[$key];
321 return $this->driverversion[$key];
332 return $this->liblabel[$key];
343 return $this->libversion[$key];
354 $tableElement = preg_replace(
'/^'.preg_quote($this->db->prefix(),
'/').
'/',
'', $tableNameWithPrefix);
355 $element = $tableElement;
357 if (isset(self::$mapTableToElement[$tableElement])) {
358 $element = self::$mapTableToElement[$tableElement];
Parent class for import file readers.
getLibVersionForKey($key)
Renvoi version de librairie externe du driver.
getDriverDescForKey($key)
Return description of import drivervoi la description d'un driver import.
getElementFromTableWithPrefix($tableNameWithPrefix)
Get element from table name with prefix.
getDriverLabelForKey($key)
Return label of driver import.
getLibLabel()
getDriverLabel
getDriverVersionForKey($key)
Renvoi version d'un driver import.
getDriverLabel()
getDriverLabel
getPictoForKey($key)
Return picto of import driver.
getLibLabelForKey($key)
Renvoi libelle de librairie externe du driver.
getDriverVersion()
getDriverVersion
listOfAvailableImportFormat($db, $maxfilenamelength=0)
Load into memory list of available import format.
getDriverExtension()
getDriverExtension
getLibVersion()
getLibVersion
__construct()
Constructor.
getDriverDesc()
getDriverDesc
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
const MODULE_MAPPING
This mapping defines the conversion to the current internal names from the alternative allowed names ...