Skip to content

Commit

Permalink
Evarisk#2757 [Accident] fix: minor tags inaccuracies
Browse files Browse the repository at this point in the history
  • Loading branch information
evarisk-micka committed Nov 23, 2023
1 parent 053576e commit da0e526
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
1 change: 0 additions & 1 deletion class/accident.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ public function createFromClone(User $user, int $fromID, array $options): int
foreach ($categories as $cat) {
$categoryIds[] = $cat->id;
}
$object->fetch($accidentId);
$object->setCategories($categoryIds);
}
}
Expand Down
32 changes: 16 additions & 16 deletions core/modules/modDigiriskDolibarr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1365,21 +1365,6 @@ public function __construct($db)
'user' => 0, // 0=Menu for internal users, 1=external users, 2=both
];

$this->menu[$r++] = [
'fk_menu' => 'fk_mainmenu=digiriskdolibarr,fk_leftmenu=digiriskaccident', // '' 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
'type' => 'left', // This is a Left menu entry
'titre' => '<i class="fas fa-search pictofixedwidth" style="padding-right: 4px;"></i>' . $langs->transnoentities('AccidentInvestigation'),
'mainmenu' => 'digiriskdolibarr',
'leftmenu' => 'digiriskaccidentinvestigation',
'url' => '/digiriskdolibarr/view/accidentinvestigation/accidentinvestigation_list.php',
'langs' => 'digiriskdolibarr@digiriskdolibarr', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position' => 100 + $r,
'enabled' => '$conf->digiriskdolibarr->enabled && $conf->saturne->enabled', // Define condition to show or hide menu entry. Use '$conf->digiriskdolibarr->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms' => '$user->rights->digiriskdolibarr->lire && $user->rights->digiriskdolibarr->accidentinvestigation->read', // Use 'perms'=>'$user->rights->digiriskdolibarr->level1->level2' if you want your menu with a permission rules
'target' => '',
'user' => 0, // 0=Menu for internal users, 1=external users, 2=both
];

$this->menu[$r++] = [
'fk_menu' => 'fk_mainmenu=digiriskdolibarr,fk_leftmenu=digiriskaccident',
'type' => 'left',
Expand All @@ -1388,13 +1373,28 @@ public function __construct($db)
'leftmenu' => 'digiriskdolibarr_accidenttags',
'url' => '/categories/index.php?type=accident',
'langs' => 'digiriskdolibarr@digiriskdolibarr',
'position' => 1000 + $r,
'position' => 100 + $r,
'enabled' => '$conf->digiriskdolibarr->enabled && $conf->categorie->enabled && $user->rights->digiriskdolibarr->accident->read',
'perms' => '$user->rights->digiriskdolibarr->accident->read',
'target' => '',
'user' => 0,
];

$this->menu[$r++] = [
'fk_menu' => 'fk_mainmenu=digiriskdolibarr', // '' 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
'type' => 'left', // This is a Left menu entry
'titre' => '<i class="fas fa-search pictofixedwidth"></i>' . $langs->transnoentities('AccidentInvestigation'),
'mainmenu' => 'digiriskdolibarr',
'leftmenu' => 'digiriskaccidentinvestigation',
'url' => '/digiriskdolibarr/view/accidentinvestigation/accidentinvestigation_list.php',
'langs' => 'digiriskdolibarr@digiriskdolibarr', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position' => 100 + $r,
'enabled' => '$conf->digiriskdolibarr->enabled && $conf->saturne->enabled', // Define condition to show or hide menu entry. Use '$conf->digiriskdolibarr->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms' => '$user->rights->digiriskdolibarr->lire && $user->rights->digiriskdolibarr->accidentinvestigation->read', // Use 'perms'=>'$user->rights->digiriskdolibarr->level1->level2' if you want your menu with a permission rules
'target' => '',
'user' => 0, // 0=Menu for internal users, 1=external users, 2=both
];

$this->menu[$r++] = [
'fk_menu' => 'fk_mainmenu=digiriskdolibarr', // '' 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
'type' => 'left', // This is a Left menu entry
Expand Down
1 change: 1 addition & 0 deletions langs/fr_FR/digiriskdolibarr.lang
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ CloneWorkStop = Cloner les arrêts de travail ?
CloneMetadata = Cloner les données complémentaires ?
CloneLesion = Cloner les données complémentaires des lésions ?
ClonePhotos = Cloner les photos ?
CloneCategories = Cloner les tags/catégories ?
CloneFrom = Clone de
AccidentInvestigationLinked = Enquête accident liée
AccidentInvestigationRole = Les rôles de l'enquête accident
Expand Down
2 changes: 1 addition & 1 deletion view/accident/accident_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@
if (!empty($conf->categorie->enabled)) {
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
$categoryArborescence = $form->select_all_categories('accident', '', 'parent', 64, 0, 1);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $categoryArborescence, GETPOST('categories', 'array'), '', 0, 'maxwidth500 widthcentpercentminusx');
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $categoryArborescence, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent maxwidth300 widthcentpercentminusx');
print '<a class="butActionNew" href="' . DOL_URL_ROOT . '/categories/index.php?type=accident&backtopage=' . urlencode($_SERVER['PHP_SELF'] . '?action=create') . '" target="_blank"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans('AddCategories') . '"></span></a>';
print "</td></tr>";
}
Expand Down

0 comments on commit da0e526

Please sign in to comment.