update margin modules to core module

This commit is contained in:
Christophe Battarel 2012-07-18 16:13:29 +02:00
parent 3844a77395
commit c12c8bd0bb
3 changed files with 12 additions and 13 deletions

View File

@ -25,13 +25,12 @@
*/ */
$res=@include("../../main.inc.php"); // For root directory $res=@include("../../main.inc.php"); // For root directory
if (! $res) $res=@include("../../../main.inc.php"); // For "custom" directory
require_once("../lib/marges.lib.php"); require_once("../lib/marges.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
$langs->load("admin"); $langs->load("admin");
$langs->load("marges@marges"); $langs->load("marges");
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();

View File

@ -27,7 +27,7 @@
* \brief Description and activation file for module MyModule * \brief Description and activation file for module MyModule
* \version $Id: modMyModule.class.php,v 1.26 2008/12/15 18:27:00 eldy Exp $ * \version $Id: modMyModule.class.php,v 1.26 2008/12/15 18:27:00 eldy Exp $
*/ */
include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php"); include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
/** \class modMyModule /** \class modMyModule
@ -64,7 +64,7 @@ class modMarges extends DolibarrModules
$this->special = 0; $this->special = 0;
// Name of png file (without png) used for this module. // Name of png file (without png) used for this module.
// Png file must be in theme/yourtheme/img directory under name object_pictovalue.png. // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
$this->picto='marges@marges'; $this->picto='marges';
// Data directories to create when module is enabled. // Data directories to create when module is enabled.
$this->dirs = array(); $this->dirs = array();
@ -75,14 +75,14 @@ class modMarges extends DolibarrModules
$this->style_sheet = '/custom/marges/css/marges.css'; $this->style_sheet = '/custom/marges/css/marges.css';
// Config pages. Put here list of php page names stored in admmin directory used to setup module. // Config pages. Put here list of php page names stored in admmin directory used to setup module.
$this->config_page_url = array("marges.php@marges"); $this->config_page_url = array("marges.php");
// Dependencies // Dependencies
$this->depends = array("modPropale", "modProduct"); // List of modules id that must be enabled if this module is enabled $this->depends = array("modPropale", "modProduct"); // List of modules id that must be enabled if this module is enabled
$this->requiredby = array(); // List of modules id to disable if this one is disabled $this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->phpmin = array(4,1); // Minimum version of PHP required by module $this->phpmin = array(4,1); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3,1); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(3,1); // Minimum version of Dolibarr required by module
$this->langfiles = array("marges@marges"); $this->langfiles = array("marges");
// Constants // Constants
$this->const = array(); // List of particular constants to add when module is enabled $this->const = array(); // List of particular constants to add when module is enabled
@ -90,8 +90,8 @@ class modMarges extends DolibarrModules
// New pages on tabs // New pages on tabs
$this->tabs = array( $this->tabs = array(
'product:+marges:Marges:marges@marges:/marges/tabs/productMargins.php?id=__ID__', 'product:+marges:Marges:marges:/marges/tabs/productMargins.php?id=__ID__',
'thirdparty:+marges:Marges:marges@marges:/marges/tabs/thirdpartyMargins.php?socid=__ID__', 'thirdparty:+marges:Marges:marges:/marges/tabs/thirdpartyMargins.php?socid=__ID__',
); );
@ -132,7 +132,7 @@ class modMarges extends DolibarrModules
'mainmenu'=>'margins', 'mainmenu'=>'margins',
'leftmenu'=>'1', // Use 1 if you also want to add left menu entries using this descriptor. Use 0 if left menu entries are defined in a file pre.inc.php (old school). 'leftmenu'=>'1', // Use 1 if you also want to add left menu entries using this descriptor. Use 0 if left menu entries are defined in a file pre.inc.php (old school).
'url'=>'/marges/index.php', 'url'=>'/marges/index.php',
'langs'=>'marges@marges', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'marges', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100, 'position'=>100,
'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled. 'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules 'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules
@ -146,7 +146,7 @@ class modMarges extends DolibarrModules
'titre'=>'ProductMargins', 'titre'=>'ProductMargins',
'mainmenu'=>'margins', 'mainmenu'=>'margins',
'url'=>'/marges/productMargins.php', 'url'=>'/marges/productMargins.php',
'langs'=>'marges@marges', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'marges', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100, 'position'=>100,
'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled. 'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules 'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules
@ -159,7 +159,7 @@ class modMarges extends DolibarrModules
'titre'=>'CustomerMargins', 'titre'=>'CustomerMargins',
'mainmenu'=>'margins', 'mainmenu'=>'margins',
'url'=>'/marges/customerMargins.php', 'url'=>'/marges/customerMargins.php',
'langs'=>'marges@marges', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'marges', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>200, 'position'=>200,
'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled. 'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules 'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules
@ -172,7 +172,7 @@ class modMarges extends DolibarrModules
'titre'=>'AgentMargins', 'titre'=>'AgentMargins',
'mainmenu'=>'margins', 'mainmenu'=>'margins',
'url'=>'/marges/agentMargins.php', 'url'=>'/marges/agentMargins.php',
'langs'=>'marges@marges', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'marges', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>300, 'position'=>300,
'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled. 'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules 'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules
@ -220,7 +220,7 @@ class modMarges extends DolibarrModules
*/ */
function load_tables() function load_tables()
{ {
return $this->_load_tables('/marges/sql/'); //return $this->_load_tables('/marges/sql/');
} }
} }