@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def as r,"; |
154 | 154 | $sql .= " " . MAIN_DB_PREFIX . "usergroup_rights as gr"; |
155 | 155 | $sql .= " WHERE gr.fk_id = r.id"; |
156 | - $sql .= " AND gr.entity = " . ((int)$entity); |
|
157 | - $sql .= " AND gr.fk_usergroup = " . ((int)$object->id); |
|
156 | + $sql .= " AND gr.entity = " . ((int) $entity); |
|
157 | + $sql .= " AND gr.fk_usergroup = " . ((int) $object->id); |
|
158 | 158 | |
159 | 159 | dol_syslog("get user perms", LOG_DEBUG); |
160 | 160 | $result = $db->query($sql); |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $sql = "SELECT r.id, r.libelle as label, r.module, r.perms, r.subperms, r.module_position, r.bydefault"; |
261 | 261 | $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def as r"; |
262 | 262 | $sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" |
263 | - $sql .= " AND r.entity = " . ((int)$entity); |
|
263 | + $sql .= " AND r.entity = " . ((int) $entity); |
|
264 | 264 | if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) { |
265 | 265 | $sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable |
266 | 266 | } |
@@ -317,8 +317,8 @@ discard block |
||
317 | 317 | // with |
318 | 318 | // 'INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1401 + 200100000, 'PCG99-ABREGE','CAPIT', '1234', 1400 + 200100000,...' |
319 | 319 | // Note: string with 'PCG99-ABREGE','CAPIT', 1234 instead of 'PCG99-ABREGE','CAPIT', '1234' is also supported |
320 | - $newsql = preg_replace('/VALUES\s*\(__ENTITY__, \s*(\d+)\s*,(\s*\'[^\',]*\'\s*,\s*\'[^\',]*\'\s*,\s*\'?[^\',]*\'?\s*),\s*\'?([^\',]*)\'?/ims', 'VALUES (__ENTITY__, \1 + ' . ((int)$offsetforchartofaccount) . ', \2, \3 + ' . ((int)$offsetforchartofaccount), $newsql); |
|
321 | - $newsql = preg_replace('/([,\s])0 \+ ' . ((int)$offsetforchartofaccount) . '/ims', '\1 0', $newsql); |
|
320 | + $newsql = preg_replace('/VALUES\s*\(__ENTITY__, \s*(\d+)\s*,(\s*\'[^\',]*\'\s*,\s*\'[^\',]*\'\s*,\s*\'?[^\',]*\'?\s*),\s*\'?([^\',]*)\'?/ims', 'VALUES (__ENTITY__, \1 + ' . ((int) $offsetforchartofaccount) . ', \2, \3 + ' . ((int) $offsetforchartofaccount), $newsql); |
|
321 | + $newsql = preg_replace('/([,\s])0 \+ ' . ((int) $offsetforchartofaccount) . '/ims', '\1 0', $newsql); |
|
322 | 322 | //var_dump($newsql); |
323 | 323 | $arraysql[$i] = $newsql; |
324 | 324 | |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | $sql = preg_replace('/__DATABASE__/i', $db->escape($database), $sql); |
418 | 418 | } |
419 | 419 | |
420 | - $newsql = preg_replace('/__ENTITY__/i', (!empty($entity) ? $entity : (string)$conf->entity), $sql); |
|
420 | + $newsql = preg_replace('/__ENTITY__/i', (!empty($entity) ? $entity : (string) $conf->entity), $sql); |
|
421 | 421 | |
422 | 422 | // Add log of request |
423 | 423 | if (!$silent) { |
@@ -594,11 +594,11 @@ discard block |
||
594 | 594 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "const"; |
595 | 595 | $sql .= " WHERE (" . $db->decrypt('name') . " = '" . $db->escape($name) . "'"; |
596 | 596 | if (is_numeric($name)) { |
597 | - $sql .= " OR rowid = " . ((int)$name); |
|
597 | + $sql .= " OR rowid = " . ((int) $name); |
|
598 | 598 | } |
599 | 599 | $sql .= ")"; |
600 | 600 | if ($entity >= 0) { |
601 | - $sql .= " AND entity = " . ((int)$entity); |
|
601 | + $sql .= " AND entity = " . ((int) $entity); |
|
602 | 602 | } |
603 | 603 | |
604 | 604 | dol_syslog("admin.lib::dolibarr_del_const", LOG_DEBUG); |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | $sql = "SELECT " . $db->decrypt('value') . " as value"; |
630 | 630 | $sql .= " FROM " . MAIN_DB_PREFIX . "const"; |
631 | 631 | $sql .= " WHERE name = " . $db->encrypt($name); |
632 | - $sql .= " AND entity = " . ((int)$entity); |
|
632 | + $sql .= " AND entity = " . ((int) $entity); |
|
633 | 633 | |
634 | 634 | dol_syslog("admin.lib::dolibarr_get_const", LOG_DEBUG); |
635 | 635 | $resql = $db->query($sql); |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "const"; |
679 | 679 | $sql .= " WHERE name = " . $db->encrypt($name); |
680 | 680 | if ($entity >= 0) { |
681 | - $sql .= " AND entity = " . ((int)$entity); |
|
681 | + $sql .= " AND entity = " . ((int) $entity); |
|
682 | 682 | } |
683 | 683 | |
684 | 684 | dol_syslog("admin.lib::dolibarr_set_const", LOG_DEBUG); |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | $sql .= " VALUES ("; |
701 | 701 | $sql .= $db->encrypt($name); |
702 | 702 | $sql .= ", " . $db->encrypt($newvalue); |
703 | - $sql .= ", '" . $db->escape($type) . "', " . ((int)$visible) . ", '" . $db->escape($note) . "', " . ((int)$entity) . ")"; |
|
703 | + $sql .= ", '" . $db->escape($type) . "', " . ((int) $visible) . ", '" . $db->escape($note) . "', " . ((int) $entity) . ")"; |
|
704 | 704 | |
705 | 705 | //print "sql".$value."-".pg_escape_string($value)."-".$sql;exit; |
706 | 706 | //print "xx".$db->escape($value); |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | $sql = "SELECT COUNT(r.id) as nb"; |
863 | 863 | $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def as r"; |
864 | 864 | $sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" |
865 | - $sql .= " AND entity = " . ((int)$conf->entity); |
|
865 | + $sql .= " AND entity = " . ((int) $conf->entity); |
|
866 | 866 | $sql .= " AND bydefault = 1"; |
867 | 867 | if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) { |
868 | 868 | $sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled |
@@ -1695,7 +1695,7 @@ discard block |
||
1695 | 1695 | $obj = $db->fetch_object($result); // Take first result of select |
1696 | 1696 | |
1697 | 1697 | if (empty($obj)) { // If not yet into table |
1698 | - $obj = (object)array('rowid' => '', 'name' => $const, 'value' => '', 'type' => $type, 'note' => ''); |
|
1698 | + $obj = (object) array('rowid' => '', 'name' => $const, 'value' => '', 'type' => $type, 'note' => ''); |
|
1699 | 1699 | } |
1700 | 1700 | |
1701 | 1701 | if (empty($strictw3c)) { |
@@ -1895,7 +1895,7 @@ discard block |
||
1895 | 1895 | $db->begin(); |
1896 | 1896 | |
1897 | 1897 | $sql = "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity, libelle, description)"; |
1898 | - $sql .= " VALUES ('" . $db->escape($name) . "','" . $db->escape($type) . "'," . ((int)$conf->entity) . ", "; |
|
1898 | + $sql .= " VALUES ('" . $db->escape($name) . "','" . $db->escape($type) . "'," . ((int) $conf->entity) . ", "; |
|
1899 | 1899 | $sql .= ($label ? "'" . $db->escape($label) . "'" : 'null') . ", "; |
1900 | 1900 | $sql .= (!empty($description) ? "'" . $db->escape($description) . "'" : "null"); |
1901 | 1901 | $sql .= ")"; |
@@ -1928,7 +1928,7 @@ discard block |
||
1928 | 1928 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "document_model"; |
1929 | 1929 | $sql .= " WHERE nom = '" . $db->escape($name) . "'"; |
1930 | 1930 | $sql .= " AND type = '" . $db->escape($type) . "'"; |
1931 | - $sql .= " AND entity = " . ((int)$conf->entity); |
|
1931 | + $sql .= " AND entity = " . ((int) $conf->entity); |
|
1932 | 1932 | |
1933 | 1933 | dol_syslog("admin.lib::delDocumentModel", LOG_DEBUG); |
1934 | 1934 | $resql = $db->query($sql); |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | |
144 | 144 | // Add here list of permission defined by an id, a label, a boolean and two constant strings. |
145 | 145 | // Example: |
146 | - $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) |
|
146 | + $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) |
|
147 | 147 | $this->rights[$r][1] = 'Generate/modify users API key'; // Permission label |
148 | - $this->rights[$r][3] = 0; // Permission by default for new user (0/1) |
|
149 | - $this->rights[$r][4] = 'apikey'; // In php code, permission will be checked by test if ($user->hasRight('permkey','level1','level2')) |
|
150 | - $this->rights[$r][5] = 'generate'; // In php code, permission will be checked by test if ($user->hasRight('permkey','level1','level2')) |
|
148 | + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) |
|
149 | + $this->rights[$r][4] = 'apikey'; // In php code, permission will be checked by test if ($user->hasRight('permkey','level1','level2')) |
|
150 | + $this->rights[$r][5] = 'generate'; // In php code, permission will be checked by test if ($user->hasRight('permkey','level1','level2')) |
|
151 | 151 | $r++; |
152 | 152 | |
153 | 153 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | { |
231 | 231 | // Remove old constants with entity fields different of 0 |
232 | 232 | $sql = array( |
233 | - "DELETE FROM " . MAIN_DB_PREFIX . "const WHERE name = " . $this->db->encrypt('MAIN_MODULE_API'), // API can't be enabled per environment. Why ? |
|
233 | + "DELETE FROM " . MAIN_DB_PREFIX . "const WHERE name = " . $this->db->encrypt('MAIN_MODULE_API'), // API can't be enabled per environment. Why ? |
|
234 | 234 | "DELETE FROM " . MAIN_DB_PREFIX . "const WHERE name = " . $this->db->encrypt('API_PRODUCTION_MODE') // Not in production mode by default at activation |
235 | 235 | ); |
236 | 236 |
@@ -236,82 +236,82 @@ discard block |
||
236 | 236 | /* END MODULEBUILDER TOPMENU */ |
237 | 237 | /* BEGIN MODULEBUILDER LEFTMENU CONFERENCEORBOOTH*/ |
238 | 238 | $this->menu[$r++] = array( |
239 | - 'fk_menu' => 'fk_mainmenu=project', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
240 | - 'type' => 'left', // This is a Left menu entry |
|
239 | + 'fk_menu' => 'fk_mainmenu=project', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
240 | + 'type' => 'left', // This is a Left menu entry |
|
241 | 241 | 'titre' => 'EventOrganizationMenuLeft', |
242 | 242 | 'prefix' => img_picto('', 'eventorganization', 'class="paddingright pictofixedwidth"'), |
243 | 243 | 'mainmenu' => 'project', |
244 | 244 | 'leftmenu' => 'eventorganization', |
245 | 245 | 'url' => '', |
246 | - 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
246 | + 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
247 | 247 | 'position' => 1000 + $r, |
248 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
249 | - 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
248 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
249 | + 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
250 | 250 | 'target' => '', |
251 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
251 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
252 | 252 | ); |
253 | 253 | $this->menu[$r++] = array( |
254 | - 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
255 | - 'type' => 'left', // This is a Left menu entry |
|
254 | + 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
255 | + 'type' => 'left', // This is a Left menu entry |
|
256 | 256 | 'titre' => 'New', |
257 | 257 | 'url' => '/projet/card.php?leftmenu=projects&action=create&usage_organize_event=1&usage_opportunity=0', |
258 | - 'langs' => 'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
258 | + 'langs' => 'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
259 | 259 | 'position' => 1000 + $r, |
260 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
261 | - 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
260 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
261 | + 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
262 | 262 | 'target' => '', |
263 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
263 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
264 | 264 | ); |
265 | 265 | $this->menu[$r++] = array( |
266 | - 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
267 | - 'type' => 'left', // This is a Left menu entry |
|
266 | + 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
267 | + 'type' => 'left', // This is a Left menu entry |
|
268 | 268 | 'titre' => 'List', |
269 | 269 | 'url' => '/projet/list.php?search_usage_event_organization=1&search_status=99&mainmenu=project&contextpage=organizedevents', |
270 | - 'langs' => 'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
270 | + 'langs' => 'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
271 | 271 | 'position' => 1000 + $r, |
272 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
273 | - 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
272 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
273 | + 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
274 | 274 | 'target' => '', |
275 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
275 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
276 | 276 | ); |
277 | 277 | $this->menu[$r++] = array( |
278 | - 'fk_menu' => 'fk_mainmenu=project', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
279 | - 'type' => 'left', // This is a Left menu entry |
|
278 | + 'fk_menu' => 'fk_mainmenu=project', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
279 | + 'type' => 'left', // This is a Left menu entry |
|
280 | 280 | 'titre' => 'ConferenceOrBooth', |
281 | 281 | 'prefix' => img_picto('', 'conferenceorbooth', 'class="paddingright pictofixedwidth"'), |
282 | 282 | 'mainmenu' => 'project', |
283 | 283 | 'leftmenu' => 'eventorganizationconforbooth', |
284 | 284 | 'url' => '', |
285 | - 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
285 | + 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
286 | 286 | 'position' => 1000 + $r, |
287 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
288 | - 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
287 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
288 | + 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
289 | 289 | 'target' => '', |
290 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
290 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
291 | 291 | ); |
292 | 292 | $this->menu[$r++] = array( |
293 | - 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
294 | - 'type' => 'left', // This is a Left menu entry |
|
293 | + 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
294 | + 'type' => 'left', // This is a Left menu entry |
|
295 | 295 | 'titre' => 'New', |
296 | 296 | 'url' => '/eventorganization/conferenceorbooth_card.php?leftmenu=projects&action=create', |
297 | - 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
297 | + 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
298 | 298 | 'position' => 1000 + $r, |
299 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
300 | - 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
299 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
300 | + 'perms' => '$user->hasRight("eventorganization", "write")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
301 | 301 | 'target' => '', |
302 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
302 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
303 | 303 | ); |
304 | 304 | $this->menu[$r++] = array( |
305 | - 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
306 | - 'type' => 'left', // This is a Left menu entry |
|
305 | + 'fk_menu' => 'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
306 | + 'type' => 'left', // This is a Left menu entry |
|
307 | 307 | 'titre' => 'List', |
308 | 308 | 'url' => '/eventorganization/conferenceorbooth_list.php?mainmenu=project', |
309 | - 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
309 | + 'langs' => 'eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
310 | 310 | 'position' => 1000 + $r, |
311 | - 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
312 | - 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
311 | + 'enabled' => 'isModEnabled("eventorganization")', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
312 | + 'perms' => '$user->hasRight("eventorganization", "read")', // Use 'perms'=>'$user->rights->eventorganization->level1->level2' if you want your menu with a permission rules |
|
313 | 313 | 'target' => '', |
314 | - 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
314 | + 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both |
|
315 | 315 | ); |
316 | 316 | /* END MODULEBUILDER LEFTMENU CONFERENCEORBOOTH */ |
317 | 317 | |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | $keyforelement = 'conferenceorboothattendee'; |
330 | 330 | include DOL_DOCUMENT_ROOT . '/core/commonfieldsinexport.inc.php'; |
331 | 331 | $this->export_entities_array[$r]['t.fk_invoice'] = 'invoice'; |
332 | - unset($this->export_fields_array[$r]['t.fk_project']); // Remove field so we can add it at end just after |
|
333 | - unset($this->export_fields_array[$r]['t.fk_soc']); // Remove field so we can add it at end just after |
|
332 | + unset($this->export_fields_array[$r]['t.fk_project']); // Remove field so we can add it at end just after |
|
333 | + unset($this->export_fields_array[$r]['t.fk_soc']); // Remove field so we can add it at end just after |
|
334 | 334 | $this->export_fields_array[$r]['t.fk_invoice'] = 'InvoiceId'; |
335 | 335 | $this->export_fields_array[$r]['t.fk_project'] = 'ProjectId'; |
336 | 336 | $this->export_fields_array[$r]['p.ref'] = 'ProjectRef'; |
@@ -362,16 +362,16 @@ discard block |
||
362 | 362 | /* BEGIN MODULEBUILDER EXPORT CONFERENCEORBOOTH */ |
363 | 363 | $langs->load("eventorganization"); |
364 | 364 | $this->export_code[$r] = $this->rights_class . '_' . $r; |
365 | - $this->export_label[$r] = 'ListOfConfOrBoothOfEvent'; // Translation key (used only if key ExportDataset_xxx_z not found) |
|
365 | + $this->export_label[$r] = 'ListOfConfOrBoothOfEvent'; // Translation key (used only if key ExportDataset_xxx_z not found) |
|
366 | 366 | $this->export_icon[$r] = 'conferenceorbooth'; |
367 | 367 | // Define $this->export_fields_array, $this->export_TypeFields_array and $this->export_entities_array |
368 | 368 | $keyforclass = 'ConferenceOrBooth'; |
369 | 369 | $keyforclassfile = '/eventorganization/class/conferenceorbooth.class.php'; |
370 | 370 | $keyforelement = 'conferenceorbooth'; |
371 | 371 | include DOL_DOCUMENT_ROOT . '/core/commonfieldsinexport.inc.php'; |
372 | - unset($this->export_fields_array[$r]['t.fk_action']); // Remove field so we can add it at end just after |
|
373 | - unset($this->export_fields_array[$r]['t.fk_project']); // Remove field so we can add it at end just after |
|
374 | - unset($this->export_fields_array[$r]['t.fk_soc']); // Remove field so we can add it at end just after |
|
372 | + unset($this->export_fields_array[$r]['t.fk_action']); // Remove field so we can add it at end just after |
|
373 | + unset($this->export_fields_array[$r]['t.fk_project']); // Remove field so we can add it at end just after |
|
374 | + unset($this->export_fields_array[$r]['t.fk_soc']); // Remove field so we can add it at end just after |
|
375 | 375 | $this->export_fields_array[$r]['t.fk_action'] = 'ConferenceOrBoothFormatID'; |
376 | 376 | $this->export_fields_array[$r]['ca.code'] = 'ConferenceOrBoothFormatCode'; |
377 | 377 | $this->export_fields_array[$r]['ca.libelle'] = 'ConferenceOrBoothFormatLabel'; |
@@ -471,10 +471,10 @@ discard block |
||
471 | 471 | } |
472 | 472 | |
473 | 473 | $sql = array_merge($sql, array( |
474 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int)$conf->entity), |
|
475 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . $this->db->escape(strtolower($myTmpObjectKey)) . "'," . ((int)$conf->entity) . ")", |
|
476 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'generic_" . strtolower($myTmpObjectKey) . "_odt' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int)$conf->entity), |
|
477 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . $this->db->escape(strtolower($myTmpObjectKey)) . "', " . ((int)$conf->entity) . ")" |
|
474 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int) $conf->entity), |
|
475 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . $this->db->escape(strtolower($myTmpObjectKey)) . "'," . ((int) $conf->entity) . ")", |
|
476 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'generic_" . strtolower($myTmpObjectKey) . "_odt' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int) $conf->entity), |
|
477 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . $this->db->escape(strtolower($myTmpObjectKey)) . "', " . ((int) $conf->entity) . ")" |
|
478 | 478 | )); |
479 | 479 | } |
480 | 480 | } |
@@ -287,8 +287,8 @@ |
||
287 | 287 | $sql = array(); |
288 | 288 | |
289 | 289 | $sql = array( |
290 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'reception' AND entity = " . ((int)$conf->entity), |
|
291 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','reception'," . ((int)$conf->entity) . ")", |
|
290 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'reception' AND entity = " . ((int) $conf->entity), |
|
291 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','reception'," . ((int) $conf->entity) . ")", |
|
292 | 292 | //"DELETE FROM ".MAIN_DB_PREFIX."const WHERE name IN ('STOCK_CALCULATE_ON_SUPPLIER_BILL', 'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', 'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', 'STOCK_CALCULATE_ON_RECEPTION', 'STOCK_CALCULATE_ON_RECEPTION_CLOSE') AND entity = ".((int) $conf->entity), |
293 | 293 | //"INSERT INTO ".MAIN_DB_PREFIX."const (name, value, entity) VALUES ('STOCK_CALCULATE_ON_RECEPTION_CLOSE', 1, ".((int) $conf->entity).")" |
294 | 294 | ); |
@@ -233,8 +233,8 @@ |
||
233 | 233 | $this->remove($options); |
234 | 234 | |
235 | 235 | $sql = array( |
236 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'ficheinter' AND entity = " . ((int)$conf->entity), |
|
237 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','ficheinter'," . ((int)$conf->entity) . ")", |
|
236 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'ficheinter' AND entity = " . ((int) $conf->entity), |
|
237 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','ficheinter'," . ((int) $conf->entity) . ")", |
|
238 | 238 | ); |
239 | 239 | |
240 | 240 | return $this->_init($sql, $options); |
@@ -448,21 +448,21 @@ |
||
448 | 448 | $res = $this->db->fetch_object($resql); |
449 | 449 | $nextid = $this->getNextId(); |
450 | 450 | if (empty($res)) { |
451 | - $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int)$nextid) . ", 'stocktransfer', 'internal', 'STRESP', 'Responsible for stock transfers', 1, NULL, 0)"); |
|
451 | + $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int) $nextid) . ", 'stocktransfer', 'internal', 'STRESP', 'Responsible for stock transfers', 1, NULL, 0)"); |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | $resql = $this->db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "c_type_contact WHERE code = 'STFROM' AND element = 'stocktransfer' AND source = 'external'"); |
455 | 455 | $res = $this->db->fetch_object($resql); |
456 | 456 | $nextid = $this->getNextId(); |
457 | 457 | if (empty($res)) { |
458 | - $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int)$nextid) . ", 'stocktransfer', 'external', 'STFROM', 'Contact sending the stock transfer', 1, NULL, 0)"); |
|
458 | + $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int) $nextid) . ", 'stocktransfer', 'external', 'STFROM', 'Contact sending the stock transfer', 1, NULL, 0)"); |
|
459 | 459 | } |
460 | 460 | |
461 | 461 | $resql = $this->db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "c_type_contact WHERE code = 'STDEST' AND element = 'stocktransfer' AND source = 'external'"); |
462 | 462 | $res = $this->db->fetch_object($resql); |
463 | 463 | $nextid = $this->getNextId(); |
464 | 464 | if (empty($res)) { |
465 | - $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int)$nextid) . ", 'stocktransfer', 'external', 'STDEST', 'Contact receiving the stock transfer', 1, NULL, 0)"); |
|
465 | + $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int) $nextid) . ", 'stocktransfer', 'external', 'STDEST', 'Contact receiving the stock transfer', 1, NULL, 0)"); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | return $this->_init($sql, $options); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function __construct($db) |
50 | 50 | { |
51 | - global $conf, $user; // $conf is required by /core/extrafieldsinexport.inc.php |
|
51 | + global $conf, $user; // $conf is required by /core/extrafieldsinexport.inc.php |
|
52 | 52 | |
53 | 53 | $this->db = $db; |
54 | 54 | $this->numero = 80; |
@@ -365,10 +365,10 @@ discard block |
||
365 | 365 | $sql = array(); |
366 | 366 | |
367 | 367 | $sql = array( |
368 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'shipping' AND entity = " . ((int)$conf->entity), |
|
369 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "', 'shipping', " . ((int)$conf->entity) . ")", |
|
370 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[3][2]) . "' AND type = 'delivery' AND entity = " . ((int)$conf->entity), |
|
371 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[3][2]) . "', 'delivery', " . ((int)$conf->entity) . ")", |
|
368 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'shipping' AND entity = " . ((int) $conf->entity), |
|
369 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "', 'shipping', " . ((int) $conf->entity) . ")", |
|
370 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[3][2]) . "' AND type = 'delivery' AND entity = " . ((int) $conf->entity), |
|
371 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[3][2]) . "', 'delivery', " . ((int) $conf->entity) . ")", |
|
372 | 372 | //"DELETE FROM ".MAIN_DB_PREFIX."const WHERE name IN ('STOCK_CALCULATE_ON_BILL', 'STOCK_CALCULATE_ON_VALIDATE_ORDER', 'STOCK_CALCULATE_ON_SHIPMENT', 'STOCK_CALCULATE_ON_SHIPMENT_CLOSE') AND entity = ".((int) $conf->entity), |
373 | 373 | //"INSERT INTO ".MAIN_DB_PREFIX."const (name, value, entity) VALUES ('STOCK_CALCULATE_ON_SHIPMENT_CLOSE', 1, ".((int) $conf->entity).")" |
374 | 374 | ); |
@@ -419,10 +419,10 @@ |
||
419 | 419 | } |
420 | 420 | |
421 | 421 | $sql = array_merge($sql, array( |
422 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int)$conf->entity), |
|
423 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . $this->db->escape(strtolower($myTmpObjectKey)) . "'," . ((int)$conf->entity) . ")", |
|
424 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'generic_" . strtolower($myTmpObjectKey) . "_odt' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int)$conf->entity), |
|
425 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . $this->db->escape(strtolower($myTmpObjectKey)) . "', " . ((int)$conf->entity) . ")" |
|
422 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int) $conf->entity), |
|
423 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . $this->db->escape(strtolower($myTmpObjectKey)) . "'," . ((int) $conf->entity) . ")", |
|
424 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'generic_" . strtolower($myTmpObjectKey) . "_odt' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int) $conf->entity), |
|
425 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . $this->db->escape(strtolower($myTmpObjectKey)) . "', " . ((int) $conf->entity) . ")" |
|
426 | 426 | )); |
427 | 427 | } |
428 | 428 | } |