Better examples
This commit is contained in:
parent
e04dd3c807
commit
f33289ed6a
@ -1486,7 +1486,14 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
|
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
|
||||||
$this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
if (! $resql)
|
||||||
|
{
|
||||||
|
$err++;
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
$this->errors[] = $this->db->lasterror();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,13 +125,22 @@ class modMyModule extends DolibarrModules
|
|||||||
1=>array('MYMODULE_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
|
1=>array('MYMODULE_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
if (! isset($conf->mymodule) || ! isset($conf->mymodule->enabled))
|
||||||
|
{
|
||||||
|
$conf->mymodule=new stdClass();
|
||||||
|
$conf->mymodule->enabled=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Array to add new pages in new tabs
|
// Array to add new pages in new tabs
|
||||||
// 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
|
$this->tabs = array();
|
||||||
// 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/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.
|
// Example:
|
||||||
// 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
||||||
// Can also be: $this->tabs = array('data'=>'...', 'entity'=>0);
|
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/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
|
// 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)
|
// '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
|
// 'contact' to add a tab in contact view
|
||||||
// 'contract' to add a tab in contract view
|
// 'contract' to add a tab in contract view
|
||||||
@ -151,13 +160,7 @@ class modMyModule extends DolibarrModules
|
|||||||
// 'stock' to add a tab in stock view
|
// 'stock' to add a tab in stock view
|
||||||
// 'thirdparty' to add a tab in third party view
|
// 'thirdparty' to add a tab in third party view
|
||||||
// 'user' to add a tab in user view
|
// 'user' to add a tab in user view
|
||||||
$this->tabs = array();
|
|
||||||
|
|
||||||
if (! isset($conf->mymodule) || ! isset($conf->mymodule->enabled))
|
|
||||||
{
|
|
||||||
$conf->mymodule=new stdClass();
|
|
||||||
$conf->mymodule->enabled=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dictionaries
|
// Dictionaries
|
||||||
$this->dictionaries=array();
|
$this->dictionaries=array();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user