dolibarr/htdocs/core/modules/modImport.class.php

96 lines
3.4 KiB
PHP
Raw Normal View History

2007-10-13 19:54:10 +02:00
<?php
2009-08-24 13:47:43 +02:00
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
2018-10-27 14:43:12 +02:00
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
2007-10-13 19:54:10 +02:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
2007-10-13 19:54:10 +02:00
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2007-10-13 19:54:10 +02:00
*/
/**
2011-08-31 12:27:17 +02:00
* \defgroup import Module import
* \brief Module to make generic import of data into dolibarr database
* \file htdocs/core/modules/modImport.class.php
2009-07-30 01:10:15 +02:00
* \ingroup import
2021-03-20 13:55:43 +01:00
* \brief Description and activation file for the module Import
2008-10-01 21:10:17 +02:00
*/
2007-10-13 19:54:10 +02:00
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
2007-10-13 19:54:10 +02:00
2012-10-03 00:30:50 +02:00
/**
2015-09-07 15:55:26 +02:00
* Class to describe and enable module Import
2008-10-01 21:10:17 +02:00
*/
2007-10-13 19:54:10 +02:00
class modImport extends DolibarrModules
{
2008-10-01 21:10:17 +02:00
/**
2011-09-26 16:22:35 +02:00
* Constructor. Define names, constants, directories, boxes, permissions
*
2012-01-04 21:23:50 +01:00
* @param DoliDB $db Database handler
2008-10-01 21:10:17 +02:00
*/
2019-02-25 20:35:59 +01:00
public function __construct($db)
2008-10-01 21:10:17 +02:00
{
2012-01-04 21:23:50 +01:00
$this->db = $db;
2008-10-01 21:10:17 +02:00
$this->numero = 250;
$this->family = "technic";
$this->module_position = '70';
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
2008-10-01 21:10:17 +02:00
$this->description = "Outils d'imports de donnees Dolibarr (via un assistant)";
2017-08-22 18:34:58 +02:00
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
2010-06-02 21:56:14 +02:00
$this->picto = 'technic';
2008-10-01 21:10:17 +02:00
// Data directories to create when module is enabled
$this->dirs = array("/import/temp");
2008-10-01 21:10:17 +02:00
// Config pages
$this->config_page_url = array("import.php");
2008-10-01 21:10:17 +02:00
2015-09-07 15:40:55 +02:00
// Dependencies
$this->hidden = false; // A condition to hide module
$this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
$this->requiredby = array(); // List of module ids to disable if this one is disabled
$this->conflictwith = array(); // List of module class names as string this module is in conflict with
2022-09-27 20:48:47 +02:00
$this->phpmin = array(7, 0); // Minimum version of PHP required by module - Need auto_detect_line_endings php option to solve MAC pbs.
2008-10-01 21:10:17 +02:00
$this->phpmax = array();
$this->need_dolibarr_version = array(2, 7, -1); // Minimum version of Dolibarr required by module
2023-01-09 12:30:56 +01:00
$this->enabled_bydefault = true; // Will be enabled during install
2008-10-01 21:10:17 +02:00
2015-09-07 15:40:55 +02:00
// Constants
2008-10-01 21:10:17 +02:00
$this->const = array();
// Boxes
$this->boxes = array();
// Permissions
$this->rights = array();
$this->rights_class = 'import';
$r = 0;
2009-07-29 21:47:15 +02:00
$r++;
$this->rights[$r][0] = 1251;
$this->rights[$r][1] = 'Run mass imports of external data (data load)';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'run';
2017-08-22 18:34:58 +02:00
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
2008-10-01 21:10:17 +02:00
}
2007-10-13 19:54:10 +02:00
}