Skip to content

Commit

Permalink
Evarisk#903 [NumberingModule] fix: improve to take object type in con…
Browse files Browse the repository at this point in the history
…sideration
  • Loading branch information
evarisk-micka committed Apr 11, 2024
1 parent f76aeb6 commit 11d5cdd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions admin/object.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@
$permissiontoread = $user->rights->$moduleNameLowerCase->adminpage->read;
saturne_check_access($permissiontoread);

/*
* Action
*/

// Actions set_mod, update_mask
require_once __DIR__ . '/../../saturne/core/tpl/actions/admin_conf_actions.tpl.php';

/*
* View
*/
Expand Down
6 changes: 3 additions & 3 deletions core/modules/saturne/modules_saturne.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ public function info($mode = 'standard'): string

if ($mode == 'custom') {
$modName = explode('_', $className);
$type = dol_strtoupper($modName[1]);
$confName = strtoupper(dol_strtoupper($moduleNameLowerCase) . '_' . $type . '_CUSTOM_ADDON');
$type = $modName[1];
$confName = dol_strtoupper($moduleNameLowerCase . '_' . $type . '_CUSTOM_ADDON');

$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities(ucfirst($modName[1])), $langs->transnoentities(ucfirst($modName[1])));
$tooltip .= $langs->trans("GenericMaskCodes2");
Expand All @@ -256,7 +256,7 @@ public function info($mode = 'standard'): string
}

$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
$texte .= '<form action="' . $_SERVER['PHP_SELF'] . '?module_name=' . $moduleNameLowerCase . '" method="POST">';
$texte .= '<form action="' . $_SERVER['PHP_SELF'] . '?module_name=' . $moduleNameLowerCase . '&object_type=' . $type . '" method="POST">';
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="action" value="update_mask">';
$texte .= '<input type="hidden" name="mask" value="'. $confName .'">';
Expand Down
2 changes: 1 addition & 1 deletion core/tpl/actions/admin_conf_actions.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
} else {
dolibarr_set_const($db, $documentMaskConst, $documentMask, 'chaine', 0, '', $conf->entity);
setEventMessage('SavedConfig');
header('Location: ' . $_SERVER['PHP_SELF'] . '?module_name=' . $moduleName);
header('Location: ' . $_SERVER['PHP_SELF'] . '?module_name=' . $moduleName . '&object_type=' . $objectType);
exit;
}
}

0 comments on commit 11d5cdd

Please sign in to comment.