This commit is contained in:
David Bensel
2020-12-14 22:40:47 +03:00
parent 8320546641
commit bc9f7c83f4
3660 changed files with 183847 additions and 274871 deletions

View File

@@ -39,9 +39,9 @@ class modTakePos extends DolibarrModules
*/
public function __construct($db)
{
global $langs, $conf;
global $langs, $conf;
$this->db = $db;
$this->db = $db;
// Id for module (must be unique).
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
@@ -78,16 +78,16 @@ class modTakePos extends DolibarrModules
// for specific path of parts (eg: /takepos/core/modules/barcode)
// for specific css file (eg: /takepos/css/takepos.css.php)
$this->module_parts = array(
'triggers' => 0, // Set this to 1 if module has its own trigger directory (core/triggers)
'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 file (core/login)
'substitutions' => 1, // 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 (theme)
'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl)
'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)
'hooks' => array() // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all'
);
);
// Data directories to create when module is enabled.
// Example: this->dirs = array("/takepos/temp","/takepos/subdir");
@@ -127,13 +127,13 @@ class modTakePos extends DolibarrModules
// Array to add new pages in new tabs
$this->tabs = array();
$this->tabs = array();
// Example:
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@takepos:$user->rights->takepos->read:/takepos/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@takepos:$user->rights->othermodule->read:/takepos/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
//
// Where objecttype can be
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@takepos:$user->rights->othermodule->read:/takepos/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
//
// Where objecttype can be
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
// 'contact' to add a tab in contact view
// 'contract' to add a tab in contract view
@@ -155,9 +155,9 @@ class modTakePos extends DolibarrModules
// 'user' to add a tab in user view
// Dictionaries
// Dictionaries
$this->dictionaries = array();
/* Example:
/* Example:
$this->dictionaries=array(
'langs'=>'mylangfile@takepos',
'tabname'=>array(MAIN_DB_PREFIX."table1",MAIN_DB_PREFIX."table2",MAIN_DB_PREFIX."table3"), // List of tables we want to see into dictonnary editor
@@ -173,13 +173,13 @@ class modTakePos extends DolibarrModules
*/
// Boxes/Widgets
// Boxes/Widgets
// Add here list of php file(s) stored in takepos/core/boxes that contains class to show a widget.
$this->boxes = array(
//0=>array('file'=>'takeposwidget1.php@takepos','note'=>'Widget provided by TakePos','enabledbydefaulton'=>'Home'),
//1=>array('file'=>'takeposwidget2.php@takepos','note'=>'Widget provided by TakePos'),
//2=>array('file'=>'takeposwidget3.php@takepos','note'=>'Widget provided by TakePos')
);
$this->boxes = array(
//0=>array('file'=>'takeposwidget1.php@takepos','note'=>'Widget provided by TakePos','enabledbydefaulton'=>'Home'),
//1=>array('file'=>'takeposwidget2.php@takepos','note'=>'Widget provided by TakePos'),
//2=>array('file'=>'takeposwidget3.php@takepos','note'=>'Widget provided by TakePos')
);
// Cronjobs (List of cron jobs entries to add when module is enabled)
@@ -260,7 +260,7 @@ class modTakePos extends DolibarrModules
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories
*
* @param string $options Options when enabling module ('', 'noboxes')
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
public function init($options = '')