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>
|
2012-12-30 15:13:49 +01:00
|
|
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.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
|
2013-01-16 15:36:08 +01:00
|
|
|
* 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
|
2011-08-01 01:24:38 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2007-10-13 19:54:10 +02:00
|
|
|
*/
|
|
|
|
|
|
2011-08-27 18:15:06 +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
|
2011-10-24 14:11:49 +02:00
|
|
|
* \file htdocs/core/modules/modImport.class.php
|
2009-07-30 01:10:15 +02:00
|
|
|
* \ingroup import
|
|
|
|
|
* \brief Fichier de description et activation du module Import
|
2008-10-01 21:10:17 +02:00
|
|
|
*/
|
2007-10-13 19:54:10 +02:00
|
|
|
|
2012-08-23 02:04:35 +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
|
|
|
*/
|
2012-07-30 17:17:33 +02:00
|
|
|
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";
|
2016-04-12 14:10:27 +02:00
|
|
|
$this->module_position = 70;
|
2016-02-19 20:05:25 +01:00
|
|
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
2009-10-21 15:09:42 +02:00
|
|
|
$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)";
|
2009-10-20 18:17:58 +02:00
|
|
|
// Possible values for version are: 'experimental' or 'dolibarr' or version
|
2009-10-20 19:56:11 +02:00
|
|
|
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
2008-10-06 09:39:52 +02:00
|
|
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
2008-10-01 21:10:17 +02:00
|
|
|
$this->special = 0;
|
2010-06-02 21:56:14 +02:00
|
|
|
$this->picto = 'technic';
|
2008-10-01 21:10:17 +02:00
|
|
|
|
2009-04-28 22:35:01 +02:00
|
|
|
// Data directories to create when module is enabled
|
2009-05-04 13:40:00 +02:00
|
|
|
$this->dirs = array("/import/temp");
|
2008-10-01 21:10:17 +02:00
|
|
|
|
|
|
|
|
// Config pages
|
|
|
|
|
$this->config_page_url = array();
|
|
|
|
|
|
2015-09-07 15:40:55 +02:00
|
|
|
// Dependencies
|
2008-10-01 21:10:17 +02:00
|
|
|
$this->depends = array();
|
|
|
|
|
$this->requiredby = array();
|
2009-10-28 17:34:05 +01:00
|
|
|
$this->phpmin = array(4,3,0); // Need auto_detect_line_endings php option to solve MAC pbs.
|
2008-10-01 21:10:17 +02:00
|
|
|
$this->phpmax = array();
|
2009-08-24 14:05:41 +02:00
|
|
|
$this->need_dolibarr_version = array(2,7,-1); // Minimum version of Dolibarr required by module
|
|
|
|
|
$this->need_javascript_ajax = 1;
|
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';
|
2009-07-29 21:47:15 +02:00
|
|
|
$r=0;
|
|
|
|
|
|
|
|
|
|
$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';
|
2016-09-30 13:02:13 +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
|
|
|
}
|