31,003
edits
No edit summary |
|||
| Line 29: | Line 29: | ||
<source lang="php"> | <source lang="php"> | ||
/** | |||
* Function called when module is disabled. | |||
* Remove from database constants, boxes and permissions from Dolibarr database. | |||
* Data directories are not deleted. | |||
* @return int 1 if OK, 0 if KO | |||
*/ | |||
function remove() | |||
{ | |||
$sql = array("DELETE FROM ".MAIN_DB_PREFIX."const WHERE name like '%_mymodulename' OR name like '%_mymodulename_%';"); | |||
return $this->_remove($sql); | |||
} | |||
</source> | </source> | ||
| Line 61: | Line 60: | ||
* @return void | * @return void | ||
*/ | */ | ||
function doActions($parameters, $object, $action) { | function doActions($parameters, $object, $action) | ||
{ | |||
print_r($parameters); | print_r($parameters); | ||
echo "action: ".$action; | echo "action: ".$action; | ||
print_r($object); | print_r($object); | ||
if ($parameters->context == 'somecontext') { | if ($parameters->context == 'somecontext') | ||
// do something only for the context 'somecontext'} | { | ||
// do something only for the context 'somecontext' | |||
} | |||
} | |||
} | |||
</source> | </source> | ||