2008-01-13 23:47:50 +01:00
< ? php
/* Copyright ( C ) 2003 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2012-02-20 19:57:16 +01:00
* Copyright ( C ) 2004 - 2012 Laurent Destailleur < eldy @ users . sourceforge . net >
2012-12-30 15:13:49 +01:00
* Copyright ( C ) 2005 - 2012 Regis Houssin < regis . houssin @ capnetworks . com >
2008-01-13 23:47:50 +01: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
2008-01-13 23:47:50 +01: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 00:21:57 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2008-01-13 23:47:50 +01:00
*/
2010-04-03 12:26:33 +02:00
/**
2012-02-20 19:57:16 +01:00
* \defgroup mymodule Module MyModule
* \brief Example of a module descriptor .
* Such a file must be copied into htdocs / mymodule / core / modules directory .
* \file htdocs / mymodule / core / modules / modMyModule . class . php
* \ingroup mymodule
* \brief Description and activation file for module MyModule
2008-08-21 20:24:21 +02:00
*/
2012-08-23 02:04:35 +02:00
include_once DOL_DOCUMENT_ROOT . '/core/modules/DolibarrModules.class.php' ;
2008-01-13 23:47:50 +01:00
2010-04-03 12:26:33 +02:00
/**
2012-02-20 19:57:16 +01:00
* Description and activation class for module MyModule
2008-08-21 20:24:21 +02:00
*/
2008-01-13 23:47:50 +01:00
class modMyModule extends DolibarrModules
{
2009-06-04 01:00:24 +02:00
/**
2011-08-28 19:40:51 +02:00
* Constructor . Define names , constants , directories , boxes , permissions
*
2011-12-30 23:07:27 +01:00
* @ param DoliDB $db Database handler
2009-06-04 01:00:24 +02:00
*/
2012-07-30 17:17:33 +02:00
function __construct ( $db )
2008-01-13 23:47:50 +01:00
{
2011-03-03 09:30:44 +01:00
global $langs , $conf ;
2011-08-11 01:29:50 +02:00
2011-12-30 23:07:27 +01:00
$this -> db = $db ;
2009-02-11 16:09:59 +01:00
2008-01-13 23:47:50 +01:00
// Id for module (must be unique).
2008-12-15 19:26:34 +01:00
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
2013-04-03 10:20:08 +02:00
$this -> numero = 100000 ;
2008-12-15 19:26:34 +01:00
// Key text used to identify module (for permissions, menus, etc...)
2008-01-14 02:47:06 +01:00
$this -> rights_class = 'mymodule' ;
2009-02-11 16:09:59 +01:00
2008-09-29 23:28:45 +02:00
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
2009-02-11 16:09:59 +01:00
// It is used to group modules in module setup page
$this -> family = " other " ;
2008-10-01 21:10:17 +02: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-20 16:22:24 +02:00
$this -> name = preg_replace ( '/^mod/i' , '' , get_class ( $this ));
2008-10-01 21:10:17 +02:00
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
2008-01-13 23:47:50 +01:00
$this -> description = " Description of module MyModule " ;
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
2009-02-11 16:09:59 +01:00
$this -> version = '1.0' ;
2008-05-05 10:15:40 +02:00
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
2008-10-01 21:10:17 +02:00
$this -> const_name = 'MAIN_MODULE_' . strtoupper ( $this -> name );
2009-02-24 03:38:02 +01:00
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
2008-12-11 20:42:25 +01:00
$this -> special = 0 ;
2009-04-30 00:11:08 +02:00
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
2010-03-26 11:27:04 +01:00
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
2008-01-14 00:18:38 +01:00
$this -> picto = 'generic' ;
2010-04-03 12:26:33 +02:00
2012-02-23 17:34:17 +01:00
// Defined all module parts (triggers, login, substitutions, menus, css, etc...)
2012-02-23 20:03:07 +01:00
// for default path (eg: /mymodule/core/xxxxx) (0=disable, 1=enable)
// for specific path of parts (eg: /mymodule/core/modules/barcode)
// for specific css file (eg: /mymodule/css/mymodule.css.php)
2012-02-24 11:06:05 +01:00
//$this->module_parts = array(
2012-08-08 20:43:23 +02:00
// 'triggers' => 0, // Set this to 1 if module has its own trigger directory (core/triggers)
// 'login' => 0, // Set this to 1 if module has its own login method directory (core/login)
// 'substitutions' => 0, // Set this to 1 if module has its own substitution function file (core/substitutions)
// 'menus' => 0, // Set this to 1 if module has its own menus handler directory (core/menus)
// 'theme' => 0, // Set this to 1 if module has its own theme directory (core/theme)
// 'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl)
// 'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode)
// 'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx)
// 'css' => array('/mymodule/css/mymodule.css.php'), // Set this to relative path of css file if module has its own css file
// 'js' => array('/mymodule/js/mymodule.js'), // Set this to relative path of js file if module must load a js on all pages
// 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module
2012-09-05 17:34:56 +02:00
// 'dir' => array('output' => 'othermodulename'), // To force the default directories names
2012-07-24 20:15:34 +02:00
// 'workflow' => array('WORKFLOW_MODULE1_YOURACTIONTYPE_MODULE2'=>array('enabled'=>'! empty($conf->module1->enabled) && ! empty($conf->module2->enabled)', 'picto'=>'yourpicto@mymodule')) // Set here all workflow context managed by module
2012-02-24 11:06:05 +01:00
// );
2012-02-23 17:34:17 +01:00
$this -> module_parts = array ();
2009-02-11 16:09:59 +01:00
2008-03-31 00:25:39 +02:00
// Data directories to create when module is enabled.
2009-05-04 13:06:49 +02:00
// Example: this->dirs = array("/mymodule/temp");
2008-01-13 23:47:50 +01:00
$this -> dirs = array ();
2008-03-31 00:25:39 +02:00
2012-02-04 00:50:49 +01:00
// Config pages. Put here list of php page, stored into mymodule/admin directory, to use to setup module.
$this -> config_page_url = array ( " mysetuppage.php@mymodule " );
2009-02-11 16:09:59 +01:00
2008-01-13 23:47:50 +01:00
// Dependencies
$this -> depends = array (); // 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
2011-01-30 17:05:57 +01:00
$this -> phpmin = array ( 5 , 0 ); // Minimum version of PHP required by module
$this -> need_dolibarr_version = array ( 3 , 0 ); // Minimum version of Dolibarr required by module
2012-07-23 09:45:16 +02:00
$this -> langfiles = array ( " mylangfile@mymodule " );
2009-02-11 16:09:59 +01:00
2008-01-13 23:47:50 +01:00
// Constants
2011-01-30 17:05:57 +01:00
// List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
2011-01-26 20:06:53 +01:00
// Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',1),
2013-01-25 16:52:23 +01:00
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
2011-10-14 18:51:20 +02:00
// );
2011-01-30 17:05:57 +01:00
$this -> const = array ();
2009-02-11 16:09:59 +01:00
2009-03-12 02:44:02 +01:00
// Array to add new pages in new tabs
2012-12-01 15:45:05 +01:00
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2
// 'objecttype:-tabname':NU:conditiontoremove); // To remove an existing tab identified by code tabname
2011-01-25 01:08:05 +01:00
// where objecttype can be
2009-03-12 02:44:02 +01:00
// 'thirdparty' to add a tab in third party view
// 'intervention' to add a tab in intervention view
2010-12-13 14:16:02 +01:00
// 'order_supplier' to add a tab in supplier order view
// 'invoice_supplier' to add a tab in supplier invoice view
2009-03-12 02:44:02 +01:00
// 'invoice' to add a tab in customer invoice view
// 'order' to add a tab in customer order view
// 'product' to add a tab in product view
2010-10-08 09:19:17 +02:00
// 'stock' to add a tab in stock view
2009-03-12 02:44:02 +01:00
// 'propal' to add a tab in propal view
// 'member' to add a tab in fundation member view
2009-10-29 14:29:10 +01:00
// 'contract' to add a tab in contract view
2010-09-17 07:18:01 +02:00
// 'user' to add a tab in user view
// 'group' to add a tab in group view
// 'contact' to add a tab in contact view
2011-03-11 15:59:35 +01:00
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
2011-01-25 01:08:05 +01:00
$this -> tabs = array ();
2009-02-11 16:09:59 +01:00
2011-03-03 09:30:44 +01:00
// Dictionnaries
2013-04-23 16:18:26 +02:00
if ( ! isset ( $conf -> mymodule -> enabled ))
2013-04-22 00:28:12 +02:00
{
$conf -> mymodule = new stdClass ();
$conf -> mymodule -> enabled = 0 ;
}
2012-01-15 15:06:02 +01:00
$this -> dictionnaries = array ();
2011-10-18 13:40:55 +02:00
/* Example :
2012-01-15 15:06:02 +01:00
if ( ! isset ( $conf -> mymodule -> enabled )) $conf -> mymodule -> enabled = 0 ; // This is to avoid warnings
2011-03-03 09:30:44 +01:00
$this -> dictionnaries = array (
2012-07-23 09:45:16 +02:00
'langs' => 'mylangfile@mymodule' ,
2012-01-15 15:06:02 +01:00
'tabname' => array ( MAIN_DB_PREFIX . " table1 " , MAIN_DB_PREFIX . " table2 " , MAIN_DB_PREFIX . " table3 " ), // List of tables we want to see into dictonnary editor
'tablib' => array ( " Table1 " , " Table2 " , " Table3 " ), // Label of tables
'tabsql' => array ( 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM ' . MAIN_DB_PREFIX . 'table1 as f' , 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM ' . MAIN_DB_PREFIX . 'table2 as f' , 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM ' . MAIN_DB_PREFIX . 'table3 as f' ), // Request to select fields
2011-10-18 13:40:55 +02:00
'tabsqlsort' => array ( " label ASC " , " label ASC " , " label ASC " ), // Sort order
'tabfield' => array ( " code,label " , " code,label " , " code,label " ), // List of fields (result of select to show dictionnary)
'tabfieldvalue' => array ( " code,label " , " code,label " , " code,label " ), // List of fields (list of fields to edit a record)
'tabfieldinsert' => array ( " code,label " , " code,label " , " code,label " ), // List of fields (list of fields for insert)
'tabrowid' => array ( " rowid " , " rowid " , " rowid " ), // Name of columns with primary key (try to always name it 'rowid')
2012-01-15 15:06:02 +01:00
'tabcond' => array ( $conf -> mymodule -> enabled , $conf -> mymodule -> enabled , $conf -> mymodule -> enabled ) // Condition to show each dictionnary
2011-03-03 09:30:44 +01:00
);
*/
// Boxes
2011-10-24 14:11:49 +02:00
// Add here list of php file(s) stored in core/boxes that contains class to show a box.
2011-03-03 09:30:44 +01:00
$this -> boxes = array (); // List of boxes
2008-01-13 23:47:50 +01:00
// Example:
2013-04-23 16:18:26 +02:00
//$this->boxes=array(array(0=>array('file'=>'myboxa.php','note'=>'','enabledbydefaulton'=>'Home'),1=>array('file'=>'myboxb.php','note'=>''),2=>array('file'=>'myboxc.php','note'=>'')););
2009-02-11 16:09:59 +01:00
2008-01-13 23:47:50 +01:00
// Permissions
$this -> rights = array (); // Permission array used by this module
2008-01-14 21:54:15 +01:00
$r = 0 ;
2009-02-11 16:09:59 +01:00
2008-01-13 23:47:50 +01:00
// Add here list of permission defined by an id, a label, a boolean and two constant strings.
// Example:
// $this->rights[$r][0] = 2000; // Permission id (must not be already used)
// $this->rights[$r][1] = 'Permision label'; // Permission label
// $this->rights[$r][3] = 1; // Permission by default for new user (0/1)
// $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
// $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
2008-01-14 21:54:15 +01:00
// $r++;
2008-01-13 23:47:50 +01:00
2009-02-11 16:09:59 +01:00
2008-01-13 23:47:50 +01:00
// Main menu entries
2013-05-08 17:23:41 +02:00
$this -> menu = array (); // List of menus to add
2008-05-02 16:36:39 +02:00
$r = 0 ;
2009-02-11 16:09:59 +01:00
2008-12-15 19:26:34 +01:00
// Add here entries to declare new menus
2011-12-31 01:33:12 +01:00
//
// Example to declare a new Top Menu entry and its Left menu entry:
2012-02-20 19:57:16 +01:00
// $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu
// 'type'=>'top', // This is a Top menu entry
2008-12-11 20:42:25 +01:00
// 'titre'=>'MyModule top menu',
2008-05-02 16:36:39 +02:00
// 'mainmenu'=>'mymodule',
2012-01-16 19:31:37 +01:00
// 'leftmenu'=>'mymodule',
2008-12-11 20:42:25 +01:00
// 'url'=>'/mymodule/pagetop.php',
2012-07-23 09:45:16 +02:00
// 'langs'=>'mylangfile@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
2008-05-02 16:36:39 +02:00
// 'position'=>100,
2012-02-20 19:57:16 +01:00
// 'enabled'=>'$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
2008-05-02 16:36:39 +02:00
// 'target'=>'',
2012-02-20 19:57:16 +01:00
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
2008-01-30 01:15:59 +01:00
// $r++;
2008-12-11 20:42:25 +01:00
//
2011-12-31 01:33:12 +01:00
// Example to declare a Left Menu entry into an existing Top menu entry:
2012-08-26 17:23:26 +02:00
// $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=xxx', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
2012-02-20 19:57:16 +01:00
// 'type'=>'left', // This is a Left menu entry
2011-12-31 01:33:12 +01:00
// 'titre'=>'MyModule left menu',
2012-08-26 17:23:26 +02:00
// 'mainmenu'=>'xxx',
2012-01-04 19:31:46 +01:00
// 'leftmenu'=>'mymodule',
2008-12-11 20:42:25 +01:00
// 'url'=>'/mymodule/pagelevel2.php',
2012-07-23 09:45:16 +02:00
// 'langs'=>'mylangfile@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
2008-12-11 20:42:25 +01:00
// 'position'=>100,
2012-02-20 19:57:16 +01:00
// 'enabled'=>'$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
2008-05-02 16:36:39 +02:00
// 'target'=>'',
2012-02-20 19:57:16 +01:00
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
2008-05-02 16:36:39 +02:00
// $r++;
2009-02-11 16:09:59 +01:00
2008-12-15 19:26:34 +01:00
// Exports
2009-06-04 01:00:24 +02:00
$r = 1 ;
2009-02-11 16:09:59 +01:00
2009-06-04 01:00:24 +02:00
// Example:
// $this->export_code[$r]=$this->rights_class.'_'.$r;
// $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
2011-02-05 19:13:10 +01:00
// $this->export_enabled[$r]='1'; // Condition to show export in list (ie: '$user->id==3'). Set to 1 to always show when module is enabled.
2009-06-04 01:00:24 +02:00
// $this->export_permission[$r]=array(array("facture","facture","export"));
2013-03-09 16:19:15 +01:00
// $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef');
// $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product');
2009-06-04 01:00:24 +02:00
// $this->export_sql_start[$r]='SELECT DISTINCT ';
// $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)';
2008-12-15 19:26:34 +01:00
// $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
// $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture';
2013-03-11 14:09:54 +01:00
// $this->export_sql_order[$r] .=' ORDER BY s.nom';
2009-06-04 01:00:24 +02:00
// $r++;
}
2008-01-13 23:47:50 +01:00
/**
2011-02-05 18:57:58 +01:00
* Function called when module is enabled .
* The init function add constants , boxes , permissions and menus ( defined in constructor ) into Dolibarr database .
2011-08-28 19:40:51 +02:00
* It also creates data directories
*
2011-08-31 12:41:06 +02:00
* @ param string $options Options when enabling module ( '' , 'noboxes' )
* @ return int 1 if OK , 0 if KO
2009-06-04 01:00:24 +02:00
*/
2011-08-31 12:41:06 +02:00
function init ( $options = '' )
2009-06-04 01:00:24 +02:00
{
$sql = array ();
2009-02-11 16:09:59 +01:00
2008-01-29 21:09:34 +01:00
$result = $this -> load_tables ();
2009-02-11 16:09:59 +01:00
2012-01-25 21:57:35 +01:00
return $this -> _init ( $sql , $options );
2009-06-04 01:00:24 +02:00
}
2008-01-13 23:47:50 +01:00
/**
2011-02-05 18:57:58 +01:00
* Function called when module is disabled .
* Remove from database constants , boxes and permissions from Dolibarr database .
2011-08-28 19:40:51 +02:00
* Data directories are not deleted
*
2011-08-31 12:41:06 +02:00
* @ param string $options Options when enabling module ( '' , 'noboxes' )
* @ return int 1 if OK , 0 if KO
2009-06-04 01:00:24 +02:00
*/
2011-08-31 12:41:06 +02:00
function remove ( $options = '' )
2008-01-13 23:47:50 +01:00
{
2009-06-04 01:00:24 +02:00
$sql = array ();
2008-01-13 23:47:50 +01:00
2012-01-25 21:57:35 +01:00
return $this -> _remove ( $sql , $options );
2009-06-04 01:00:24 +02:00
}
2008-01-13 23:47:50 +01:00
2009-02-11 16:09:59 +01:00
2008-01-29 21:09:34 +01:00
/**
2011-08-28 19:40:51 +02:00
* Create tables , keys and data required by module
* Files llx_table1 . sql , llx_table1 . key . sql llx_data . sql with create table , create keys
* and create data commands must be stored in directory / mymodule / sql /
* This function is called by this -> init
*
* @ return int <= 0 if KO , > 0 if OK
2009-06-04 01:00:24 +02:00
*/
2008-01-29 21:09:34 +01:00
function load_tables ()
{
2008-12-07 21:10:59 +01:00
return $this -> _load_tables ( '/mymodule/sql/' );
2008-01-29 21:09:34 +01:00
}
2008-01-13 23:47:50 +01:00
}
?>