25 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
39 global $langs, $conf, $mysoc;
44 $this->rights_class =
'blockedlog';
48 $this->family =
"base";
50 $this->module_position =
'75';
52 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
53 $this->
description =
"Enable a log on some business events into a non reversible log. This module may be mandatory for some countries.";
55 $this->version =
'dolibarr';
57 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
59 $this->picto =
'technic';
62 $this->dirs = array();
66 $this->config_page_url = array(
'blockedlog.php?withtab=1@blockedlog');
70 $this->hidden =
false;
71 $this->depends = array(
'always'=>
'modFacture');
72 $this->requiredby = array();
73 $this->conflictwith = array();
74 $this->langfiles = array(
'blockedlog');
76 $this->warnings_activation = array();
77 $this->warnings_activation_ext = array();
78 $this->warnings_unactivation = array(
'FR'=>
'BlockedLogAreRequiredByYourCountryLegislation');
93 $this->always_enabled = (!empty($conf->blockedlog->enabled)
94 && !empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY)
95 && in_array($mysoc->country_code, explode(
',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY))
100 $this->
const = array(
101 1=>array(
'BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY',
'chaine',
'FR',
'This is list of country code where the module may be mandatory', 0,
'current', 0)
106 $this->tabs = array();
110 $this->boxes = array();
114 $this->rights = array();
117 $this->rights[$r][0] = $this->numero + $r;
118 $this->rights[$r][1] =
'Read archived events and fingerprints';
119 $this->rights[$r][3] = 0;
120 $this->rights[$r][4] =
'read';
121 $this->rights[$r][5] =
'';
126 $this->menu[$r] = array(
127 'fk_menu'=>
'fk_mainmenu=tools',
129 'leftmenu'=>
'blockedlogbrowser',
131 'titre'=>
'BrowseBlockedLog',
132 'url'=>
'/blockedlog/admin/blockedlog_list.php?mainmenu=tools&leftmenu=blockedlogbrowser',
133 'langs'=>
'blockedlog',
135 'enabled'=>
'$conf->blockedlog->enabled',
136 'perms'=>
'$user->rights->blockedlog->read',
150 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
152 return $b->alreadyUsed(1);
164 public function init($options =
'')
171 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
173 $object =
new stdClass();
175 $object->element =
'module';
176 $object->ref =
'systemevent';
177 $object->entity = $conf->entity;
181 $result = $b->setObjectData($object,
'MODULE_SET', 0);
184 $this->error = $b->error;
185 $this->errors = $b->erros;
189 $res = $b->create($user);
191 $this->error = $b->error;
192 $this->errors = $b->errors;
196 return $this->
_init($sql, $options);
207 public function remove($options =
'')
215 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
217 $object =
new stdClass();
219 $object->element =
'module';
220 $object->ref =
'systemevent';
221 $object->entity = $conf->entity;
225 $result = $b->setObjectData($object,
'MODULE_RESET', 0);
228 $this->error = $b->error;
229 $this->errors = $b->erros;
233 if ($b->alreadyUsed(1))
235 $res = $b->create($user,
'0000000000');
237 $res = $b->create($user);
240 $this->error = $b->error;
241 $this->errors = $b->errors;
245 return $this->
_remove($sql, $options);
__construct($db)
Constructor.
init($options= '')
Function called when module is enabled.
Class to describe a BlockedLog module.
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
dol_now($mode= 'auto')
Return date for now.
alreadyUsed()
Check if module was already used before unactivation linked to warnings_unactivation property...
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.
_remove($array_sql, $options= '')
Disable function.
Class to manage Blocked Log.
_init($array_sql, $options= '')
Enables a module.