Skip to content
Snippets Groups Projects
Commit 05389b0f authored by KHELIFA's avatar KHELIFA
Browse files

Merge branch '2024_rc' into '2024'

FIX - Fix affichage de l'aide

See merge request !5
parents 5dde372f 84086701
No related branches found
No related tags found
1 merge request!5FIX - Fix affichage de l'aide
Pipeline #6033 failed
......@@ -3,6 +3,9 @@ Le format du fichier est basé sur [Tenez un ChangeLog](http://keepachangelog.co
## [Non Distribué]
## [14.0.13] - 10-03-2025
- Fix affichage de l'aide
## [14.0.12] - 10-02-2025
- Compatibilité V21
......@@ -282,7 +285,8 @@ Le format du fichier est basé sur [Tenez un ChangeLog](http://keepachangelog.co
## [4.0.0] - 16-07-2018
- Version initial.
[Non Distribué]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/compare/14.0.12...HEAD
[Non Distribué]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/compare/14.0.13...HEAD
[14.0.13]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.13
[14.0.12]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.12
[14.0.11]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.11
[14.0.10]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.10
......
14.0.12
14.0.13
\ No newline at end of file
......@@ -25,54 +25,90 @@ dol_include_once('advancedictionaries/lib/advancedictionaries.lib.php');
class ActionsAdvanceDictionaries
{
/**
* Overloading the updateSession function : replacing the parent's function with the one below
*
* @param array() $parameters Hook metadatas (context, etc...)
* @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string &$action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
/**
* @var DoliDB Database handler.
*/
public $db;
/**
* @var string Error
*/
public $error = '';
/**
* @var array Errors
*/
public $errors = array();
/**
* @var array Hook results. Propagated to $hookmanager->resArray for later reuse
*/
public $results = array();
/**
* @var string String displayed by executeHook() immediately after return
*/
public $resprints;
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct($db)
{
$this->db = $db;
}
/**
* Overloading the updateSession function : replacing the parent's function with the one below
*
* @param array $parameters Hook metadatas (context, etc...)
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string $action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
public function updateSession($parameters, &$object, &$action, $hookmanager)
{
return $this->_redirection($parameters, $object, $action, $hookmanager);
}
{
return $this->_redirection($parameters, $object, $action, $hookmanager);
}
/**
* Overloading the afterLogin function : replacing the parent's function with the one below
*
* @param array() $parameters Hook metadatas (context, etc...)
* @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string &$action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
/**
* Overloading the afterLogin function : replacing the parent's function with the one below
*
* @param array $parameters Hook metadatas (context, etc...)
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string $action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
public function afterLogin($parameters, &$object, &$action, $hookmanager)
{
return $this->_redirection($parameters, $object, $action, $hookmanager);
}
{
return $this->_redirection($parameters, $object, $action, $hookmanager);
}
/**
* _redirection function
*
* @param array() $parameters Hook metadatas (context, etc...)
* @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string &$action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
private function _redirection($parameters, &$object, &$action, $hookmanager) {
global $conf;
/**
* _redirection function
*
* @param array $parameters Hook metadatas (context, etc...)
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string $action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
private function _redirection($parameters, &$object, &$action, $hookmanager)
{
global $conf;
// redirect old dictionaries page
if (!empty($conf->global->ADVANCEDICTIONARIES_REPLACE_OLD_DICTIONARIES_PAGE) &&
preg_match('/\/admin\/dict.php/i', $_SERVER["PHP_SELF"])) {
$id = GETPOST('id', 'int');
header("Location: " . dol_buildpath('/advancedictionaries/admin/dictionaries.php', 2) . '?id=' . $id);
exit;
}
// redirect old dictionaries page
if (!empty($conf->global->ADVANCEDICTIONARIES_REPLACE_OLD_DICTIONARIES_PAGE) &&
preg_match('/\/admin\/dict.php/i', $_SERVER["PHP_SELF"])) {
$id = GETPOST('id', 'int');
header("Location: " . dol_buildpath('/advancedictionaries/admin/dictionaries.php', 2) . '?id=' . $id);
exit;
}
return 0; // or return 1 to replace standard code
}
return 0; // or return 1 to replace standard code
}
}
\ No newline at end of file
......@@ -119,9 +119,9 @@ if (isset($dictionary) && $dictionary->enabled) {
}
if (!empty($field['help'])) {
if (preg_match('/^http(s*):/i', $field['help'])) $input_label .= '<a href="' . $field['help'] . '" target="_blank">' . $label . ' ' . img_help(1, $label) . '</a>';
else $input_label .= $form->textwithpicto($label, $langs->trans($field['help'])); // Tooltip on hover
else $input_label .= $form->textwithpicto($label, $langs->transnoentitiesnoconv($field['help'])); // Tooltip on hover
} elseif (!empty($field['help_button'])) {
$input_label .= $form->textwithpicto($label, $langs->trans($field['help_button']), 1, 'help', '', 0, 2, $fieldName); // Tooltip on click
$input_label .= $form->textwithpicto($label, $langs->transnoentitiesnoconv($field['help_button']), 1, 'help', '', 0, 2, $fieldName); // Tooltip on click
$input_label .= <<<SCRIPT
<script type="text/javascript">
jQuery(document).ready(function () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment