From a25c9f58e827c4b10c7f96227f7c19813d6db9f0 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 19 Jul 2023 16:24:59 +0200 Subject: [PATCH 01/21] product_card problem unexpected tocken --- htdocs/product/card.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 15a04ce4003..f80d131b1ec 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2054,11 +2054,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("DefaultWarehouse").''; print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); print $formproduct->selectWarehouses((GETPOSTISSET('fk_default_warehouse') ? GETPOST('fk_default_warehouse') : $object->fk_default_warehouse), 'fk_default_warehouse', 'warehouseopen', 1); -<<<<<<< HEAD - print ' '; -======= print ' '; ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git print ''; print ''; /* From 155848585f16eb5f7bd23d2c71edca1b99dfd28f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 27 Jul 2023 13:16:00 +0200 Subject: [PATCH 02/21] Update interface_20_all_Logevents.class.php $langs->load("users"); only once at the start --- .../interface_20_all_Logevents.class.php | 79 ++++++++++--------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index 3b9d59778e9..ab32870a8c8 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2009 Laurent Destailleur * Copyright (C) 2009-2017 Regis Houssin * Copyright (C) 2014 Marcos García + * Copyright (C) 2023 Udo Tamm * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ /** * \file htdocs/core/triggers/interface_20_all_Logevents.class.php * \ingroup core - * \brief Trigger file for + * \brief Trigger file for log events */ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; @@ -40,12 +41,11 @@ class InterfaceLogevents extends DolibarrTriggers { $this->db = $db; - $this->name = preg_replace('/^Interface/i', '', get_class($this)); - $this->family = "core"; - $this->description = "Triggers of this module allows to add security event records inside Dolibarr."; - // 'development', 'experimental', 'dolibarr' or version - $this->version = self::VERSION_DOLIBARR; - $this->picto = 'technic'; + $this->name = preg_replace('/^Interface/i', '', get_class($this)); + $this->family = "core"; + $this->description = "Triggers of this module allows to add security event records inside Dolibarr."; + $this->version = self::VERSION_DOLIBARR; // VERSION_ 'DEVELOPMENT' or 'EXPERMENTAL' or 'DOLIBARR' + $this->picto = 'technic'; } /** @@ -77,54 +77,58 @@ class InterfaceLogevents extends DolibarrTriggers $date = dol_now(); - // Actions + /* Actions */ + + $langs->load("users"); + + // USER_LOGIN if ($action == 'USER_LOGIN') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = "(UserLogged,".$object->login.")"; $text .= (empty($object->trigger_mesg) ? '' : ' - '.$object->trigger_mesg); $desc = "(UserLogged,".$object->login.")"; $desc .= (empty($object->trigger_mesg) ? '' : ' - '.$object->trigger_mesg); + + // USER_LOGIN_FAILED } elseif ($action == 'USER_LOGIN_FAILED') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $object->trigger_mesg; // Message direct $desc = $object->trigger_mesg; // Message direct + + // USER_LOGOUT } elseif ($action == 'USER_LOGOUT') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = "(UserLogoff,".$object->login.")"; $desc = "(UserLogoff,".$object->login.")"; + + // USER_CREATE } elseif ($action == 'USER_CREATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("NewUserCreated", $object->login); $desc = $langs->transnoentities("NewUserCreated", $object->login); + + // USER_MODIFY } elseif ($action == 'USER_MODIFY') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("EventUserModified", $object->login); $desc = $langs->transnoentities("EventUserModified", $object->login); + + // USER_NEW_PASSWORD } elseif ($action == 'USER_NEW_PASSWORD') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("NewUserPassword", $object->login); $desc = $langs->transnoentities("NewUserPassword", $object->login); + + // USER ENABLED/DISABLED } elseif ($action == 'USER_ENABLEDISABLE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) if ($object->statut == 0) { $text = $langs->transnoentities("UserEnabled", $object->login); $desc = $langs->transnoentities("UserEnabled", $object->login); @@ -133,29 +137,32 @@ class InterfaceLogevents extends DolibarrTriggers $text = $langs->transnoentities("UserDisabled", $object->login); $desc = $langs->transnoentities("UserDisabled", $object->login); } + + // USER_DELETE } elseif ($action == 'USER_DELETE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("UserDeleted", $object->login); $desc = $langs->transnoentities("UserDeleted", $object->login); + + // USERGROUP_CREATE } elseif ($action == 'USERGROUP_CREATE') { - // Groups dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("NewGroupCreated", $object->name); $desc = $langs->transnoentities("NewGroupCreated", $object->name); + + // USERGROUP_MODIFY } elseif ($action == 'USERGROUP_MODIFY') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("GroupModified", $object->name); $desc = $langs->transnoentities("GroupModified", $object->name); + + // USERGROUP_DELETE } elseif ($action == 'USERGROUP_DELETE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("GroupDeleted", $object->name); $desc = $langs->transnoentities("GroupDeleted", $object->name); } From 7c736dc85b36f7f693e44f0501f4dfe84f0ce4af Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 3 Aug 2023 16:14:00 +0200 Subject: [PATCH 03/21] new update when try to delete don --- htdocs/don/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 17d8e51dc60..247a03563c6 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -912,7 +912,7 @@ if (!empty($id) && $action != 'edit') { if ($object->statut == $object::STATUS_CANCELED || $object->statut == $object::STATUS_DRAFT) { print '"; } else { - print '"; + print '"; } } else { print '"; From a327f6fb525359cf684117ddb5c9058e50449566 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 3 Aug 2023 16:18:44 +0200 Subject: [PATCH 04/21] fix incohenrent --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 2e2839f8e41..c8ad5047fe7 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2057,7 +2057,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("DefaultWarehouse").''; print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); print $formproduct->selectWarehouses((GETPOSTISSET('fk_default_warehouse') ? GETPOST('fk_default_warehouse') : $object->fk_default_warehouse), 'fk_default_warehouse', 'warehouseopen', 1); - print ''; + print ' '; print ''; print ''; /* From 2e8525933c39111b0b2d1b3955e9ac093faeb8da Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 9 Aug 2023 12:37:20 +0200 Subject: [PATCH 05/21] Add new dictionary for modulebuilder (#25592) * product_card problem unexpected tocken * new update for function generate_doc * new function for create dictionnary * add function for create new dictionary * fix problem * update function for building correct string * optimize function and fix incoherences * optimize function and fix incoherences * Revert "optimize function and fix incoherences" This reverts commit ecbd902a9f8a221474d14651efd8955afff175ac. --- htdocs/core/lib/modulebuilder.lib.php | 113 ++++++++++++++++++++++++++ htdocs/langs/en_US/errors.lang | 2 +- htdocs/langs/en_US/modulebuilder.lang | 3 +- htdocs/langs/fr_FR/errors.lang | 1 + htdocs/langs/fr_FR/modulebuilder.lang | 1 + htdocs/modulebuilder/index.php | 39 +++++++-- 6 files changed, 150 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index de26ad0462d..1d930013c1c 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -1020,3 +1020,116 @@ function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action) return 1; }return -1; } + +/** + * Creates a new dictionary table. + * + * for creating a new dictionary table in Dolibarr. It generates the necessary SQL code to define the table structure, + * including columns such as 'rowid', 'code', 'label', 'position', 'use_default', 'active', etc. The table name is constructed based on the provided $namedic parameter. + * + * @param string $modulename The lowercase name of the module for which the dictionary table is being created. + * @param string $file The file path to the Dolibarr module builder file where the dictionaries are defined. + * @param string $namedic The name of the dictionary, which will also be used as the base for the table name. + * @param array|null $dictionnaires An optional array containing pre-existing dictionary data, including 'tabname', 'tablib', 'tabsql', etc. + * @return void + */ +function createNewDictionnary($modulename, $file, $namedic, $dictionnaires = null) +{ + global $db, $langs; + + if (empty($namedic)) { + setEventMessages($langs->trans("ErrorEmptyNameDic"), null, 'errors'); + return; + } + if (!file_exists($file)) { + return -1; + } + $modulename = strtolower($modulename); + + if (empty($dictionnaires)) { + $dictionnaires = array('tabname' => array(), 'tablib' => array(), 'tabsql' => array(), 'tabsqlsort' => array(), 'tabfield' => array(), 'tabfieldvalue' => array(), 'tabfieldinsert' => array(), 'tabrowid' => array(), 'tabcond' => array(), 'tabhelp' => array()); + } + + $columns = array( + 'rowid' => array('type' => 'integer(11)'), + 'code' => array('type' => 'varchar(255) NOT NULL'), + 'label' => array('type' => 'varchar(255) NOT NULL'), + 'position' => array('type' => 'integer(11) NULL'), + 'use_default' => array('type' => 'varchar(255) DEFAULT 1'), + 'active' => array('type' => 'integer') + ); + + + $primaryKey = 'rowid'; + foreach ($columns as $key => $value) { + if ($key === 'rowid') { + $primaryKey = 'rowid'; + break; + } + if (!array_key_exists('rowid', $columns)) { + $primaryKey = array_key_first($columns); + break; + } + } + // check if tablename exist in Database + $query = "SHOW TABLES LIKE '" . MAIN_DB_PREFIX.strtolower($namedic) . "'"; + $checkTable = $db->query($query); + if ($checkTable && $db->num_rows($checkTable) > 0) { + setEventMessages($langs->trans("ErrorTableExist", $namedic), null, 'errors'); + return; + } else { + $_results = $db->DDLCreateTable(MAIN_DB_PREFIX.strtolower($namedic), $columns, $primaryKey, "InnoDB"); + if ($_results < 0) { + dol_print_error($db); + $langs->load("errors"); + setEventMessages($langs->trans("ErrorTableNotFound", $namedic), null, 'errors'); + } + } + + // rewrite dictionnary if + $dictionnaires['tabname'][] = $namedic; + $dictionnaires['tablib'][] = ucfirst(substr($namedic, 2)); + $dictionnaires['tabsql'][] = 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.strtolower($namedic).' as f'; + $dictionnaires['tabsqlsort'][] = (array_key_exists('label', $columns) ? 'label ASC' : ''); + $dictionnaires['tabfield'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : ''); + $dictionnaires['tabfieldvalue'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : ''); + $dictionnaires['tabfieldinsert'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : ''); + $dictionnaires['tabrowid'][] = $primaryKey; + $dictionnaires['tabcond'][] = isModEnabled('$modulename'); + $dictionnaires['tabhelp'][] = (array_key_exists('code', $columns) ? array('code'=>$langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip') : ''); + + // Build the dictionary string + $dicData = "\t\t\$this->dictionaries=array(\n"; + + foreach ($dictionnaires as $key => $value) { + $dicData .= "\t\t\t'$key'=>"; + + if ($key === 'tabcond') { + $conditions = array_map(function ($val) use ($modulename) { + return ($val === true || $val === false) ? "isModEnabled('$modulename')" : $val; + }, $value); + $dicData .= "array(" . implode(",", $conditions) . ")"; + } elseif ($key === 'tabhelp') { + $helpItems = array(); + foreach ($value as $helpValue) { + $helpItems[] = "array('code'=>\$langs->trans('".$helpValue['code']."'), 'field2' => 'field2tooltip')"; + } + $dicData .= "array(" . implode(",", $helpItems) . ")"; + } else { + if (is_array($value)) { + $dicData .= "array(" . implode(",", array_map(function ($val) { + return "'$val'"; + }, $value)) . ")"; + } else { + $dicData .= "'$value'"; + } + } + $dicData .= ",\n"; + } + $dicData .= "\t\t);"; + $stringDic = getFromFile($file, '/* BEGIN MODULEBUILDER DICTIONARIES */', '/* END MODULEBUILDER DICTIONARIES */'); + $writeInfile = dolReplaceInFile($file, array($stringDic => $dicData."\n")); + if ($writeInfile > 0) { + setEventMessages($langs->trans("DictionariesCreated", ucfirst(substr($namedic, 2))), null); + } +} diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 571802e6d5f..01e944c4051 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -318,7 +318,7 @@ ErrorTheUrlOfYourDolInstanceDoesNotMatchURLIntoOAuthSetup=Error: The URL of you ErrorMenuExistValue=A Menu already exist with this Title or URL ErrorSVGFilesNotAllowedAsLinksWithout=SVG files are not allowed as external links without the option %s ErrorTypeMenu=Impossible to add another menu for the same module on the navbar, not handle yet - +ErrorTableExist=Table %s already exist # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 02fb5b5d6a9..4bd66be5d57 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -176,4 +176,5 @@ MenuUpdatedSuccessfuly=Menu has been successfully updated ApiObjectDeleted=API for object %s has been successfully deleted CRUDRead=Read CRUDCreateWrite=Create or Update -FailedToAddCodeIntoDescriptor=Failed to add code into descriptor. Check that the string comment "%s" is still present into the file. \ No newline at end of file +FailedToAddCodeIntoDescriptor=Failed to add code into descriptor. Check that the string comment "%s" is still present into the file. +DictionariesCreated=Dictionary %s created successfully \ No newline at end of file diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index d81be42b602..22d141795b0 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -317,6 +317,7 @@ ErrorTheUrlOfYourDolInstanceDoesNotMatchURLIntoOAuthSetup=Erreur : L'URL de vot ErrorMenuExistValue=Un menu existe déjà avec ce titre ou cette URL ErrorSVGFilesNotAllowedAsLinksWithout=Les fichiers SVG ne sont pas autorisés en tant que liens externes sans l'option %s ErrorTypeMenu=Impossible d'ajouter un autre menu pour le même module sur la barre de navigation, pas encore géré +ErrorTableExist=La table %s existe déja # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Votre paramètre PHP upload_max_filesize (%s) est supérieur au paramètre PHP post_max_size (%s). Ceci n'est pas une configuration cohérente. diff --git a/htdocs/langs/fr_FR/modulebuilder.lang b/htdocs/langs/fr_FR/modulebuilder.lang index 5fa2c474900..f5aefbc4e38 100644 --- a/htdocs/langs/fr_FR/modulebuilder.lang +++ b/htdocs/langs/fr_FR/modulebuilder.lang @@ -177,3 +177,4 @@ ApiObjectDeleted=L'API pour l'objet %s a été supprimée avec succès CRUDRead=Lire CRUDCreateWrite=Créer ou mettre à jour FailedToAddCodeIntoDescriptor=Échec de l'ajout de code dans le descripteur. Vérifiez que le commentaire de chaîne "%s" est toujours présent dans le fichier. +DictionariesCreated = Le dictionnaire %s a été créé avec succès \ No newline at end of file diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index edead052752..680e61730f3 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1553,15 +1553,39 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { // Add a dictionary if ($dirins && $action == 'initdic' && $module && $dicname) { + $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; + $destdir = $dirins.'/'.strtolower($module); + $moduledescriptorfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; + if (!$error) { $newdicname = $dicname; if (!preg_match('/^c_/', $newdicname)) { $newdicname = 'c_'.$dicname; } + dol_include_once($pathtofile); + $class = 'mod'.$module; - // TODO - - setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'errors'); + if (class_exists($class)) { + try { + $moduleobj = new $class($db); + } catch (Exception $e) { + $error++; + dol_print_error($db, $e->getMessage()); + } + } else { + $error++; + $langs->load("errors"); + dol_print_error($db, $langs->trans("ErrorFailedToLoadModuleDescriptorForXXX", $module)); + exit; + } + $dictionaries = $moduleobj->dictionaries; + createNewDictionnary($module, $moduledescriptorfile, $newdicname, $dictionaries); + if (function_exists('opcache_invalidate')) { + opcache_reset(); // remove the include cache hell ! + } + clearstatcache(true); + header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); + exit; } } @@ -4088,6 +4112,7 @@ if ($module == 'initmodule') { $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; $dicts = $moduleobj->dictionaries; + //var_dump($dicts);exit; if ($action != 'editfile' || empty($file)) { print ''; @@ -4217,11 +4242,11 @@ if ($module == 'initmodule') { print $dicts['tabfieldinsert'][$i]; print ''; - print ''; + print ''; print $dicts['tabrowid'][$i]; print ''; - print ''; + print ''; print $dicts['tabcond'][$i]; print ''; @@ -4250,8 +4275,8 @@ if ($module == 'initmodule') { print ''.$langs->trans("EnterNameOfDictionaryDesc").'

'; print '
'; - //print '
'; - //print '
'; + // print '
'; + // print '
'; print ''; /*print '
'; print '
'; From 3d5f649405376f0c0c773b38bdf3ee2b4691a620 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:55:24 +0200 Subject: [PATCH 06/21] Update booking_note.php (#25554) --- htdocs/bookcal/booking_note.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/bookcal/booking_note.php b/htdocs/bookcal/booking_note.php index a194d084fe1..b72c0fbe6d1 100644 --- a/htdocs/bookcal/booking_note.php +++ b/htdocs/bookcal/booking_note.php @@ -17,9 +17,9 @@ */ /** - * \file booking_note.php - * \ingroup bookcal - * \brief Tab for notes on Booking + * \file htdocs/bookcal/booking_note.php + * \ingroup bookcal + * \brief Tab for notes on Booking */ // Load Dolibarr environment @@ -31,9 +31,9 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; $langs->loadLangs(array("agenda", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); From 8f8bde08a420c3d895308240261f08f5a0bd074e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:55:37 +0200 Subject: [PATCH 07/21] Update booking_document.php (#25552) --- htdocs/bookcal/booking_document.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookcal/booking_document.php b/htdocs/bookcal/booking_document.php index 83031edec2b..d04258d54d2 100644 --- a/htdocs/bookcal/booking_document.php +++ b/htdocs/bookcal/booking_document.php @@ -17,9 +17,9 @@ */ /** - * \file booking_document.php - * \ingroup bookcal - * \brief Tab for documents linked to Booking + * \file htdocs/bookcal/booking_document.php + * \ingroup bookcal + * \brief Tab for documents linked to Booking */ // Load Dolibarr environment From 51f10627226dbac978b99181451b461338c4b194 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:55:51 +0200 Subject: [PATCH 08/21] Update booking_card.php (#25549) --- htdocs/bookcal/booking_card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookcal/booking_card.php b/htdocs/bookcal/booking_card.php index fd8ddbc4614..f85331cc801 100644 --- a/htdocs/bookcal/booking_card.php +++ b/htdocs/bookcal/booking_card.php @@ -17,9 +17,9 @@ */ /** - * \file booking_card.php - * \ingroup bookcal - * \brief Page to create/edit/view booking + * \file htdocs/bookcal/booking_card.php + * \ingroup bookcal + * \brief Page to create/edit/view booking */ // Load Dolibarr environment From 54151f91eeb38eb617c9b0b6e156f3225ddd559a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:56:01 +0200 Subject: [PATCH 09/21] Update booking_contact.php (#25550) --- htdocs/bookcal/booking_contact.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookcal/booking_contact.php b/htdocs/bookcal/booking_contact.php index e1954ce07a3..938e3287c70 100644 --- a/htdocs/bookcal/booking_contact.php +++ b/htdocs/bookcal/booking_contact.php @@ -17,9 +17,9 @@ */ /** - * \file booking_contact.php - * \ingroup bookcal - * \brief Tab for contacts linked to Booking + * \file htdocs/bookcal/booking_contact.php + * \ingroup bookcal + * \brief Tab for contacts linked to Booking */ // Load Dolibarr environment From 655b0d4a401a65c77c33a60330d553623f3d6689 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:56:25 +0200 Subject: [PATCH 10/21] Update booking_list.php (#25553) --- htdocs/bookcal/booking_list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php index d8c333a8f61..a141f33a909 100644 --- a/htdocs/bookcal/booking_list.php +++ b/htdocs/bookcal/booking_list.php @@ -17,9 +17,9 @@ */ /** - * \file booking_list.php - * \ingroup bookcal - * \brief List page for booking + * \file htdocs/bookcal/booking_list.php + * \ingroup bookcal + * \brief List page for booking */ // Load Dolibarr environment From 8225126582ae09a843da52376c6e9a31cb27783d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:56:36 +0200 Subject: [PATCH 11/21] Update availabilities_note.php (#25547) --- htdocs/bookcal/availabilities_note.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookcal/availabilities_note.php b/htdocs/bookcal/availabilities_note.php index dea5fee7625..7dd390d1fa2 100644 --- a/htdocs/bookcal/availabilities_note.php +++ b/htdocs/bookcal/availabilities_note.php @@ -17,9 +17,9 @@ */ /** - * \file availabilities_note.php - * \ingroup bookcal - * \brief Tab for notes on Availabilities + * \file htdocs/bookcal/availabilities_note.php + * \ingroup bookcal + * \brief Tab for notes on Availabilities */ // Load Dolibarr environment From 067748fc8a1f634e663736365997aa3e9759fb41 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:56:47 +0200 Subject: [PATCH 12/21] Update booking_agenda.php (#25548) --- htdocs/bookcal/booking_agenda.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php index af078bff0e1..62346d66721 100644 --- a/htdocs/bookcal/booking_agenda.php +++ b/htdocs/bookcal/booking_agenda.php @@ -17,9 +17,9 @@ */ /** - * \file booking_agenda.php - * \ingroup bookcal - * \brief Tab of events on Booking + * \file htdocs/bookcal/booking_agenda.php + * \ingroup bookcal + * \brief Tab of events on Booking */ // Load Dolibarr environment From 179a8f2c5b2f1f55b1eaf87c4c8c576310061ccd Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:56:58 +0200 Subject: [PATCH 13/21] Update availabilities_document.php (#25545) --- htdocs/bookcal/availabilities_document.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookcal/availabilities_document.php b/htdocs/bookcal/availabilities_document.php index 301ccdc2eae..830813d5fcb 100644 --- a/htdocs/bookcal/availabilities_document.php +++ b/htdocs/bookcal/availabilities_document.php @@ -17,9 +17,9 @@ */ /** - * \file availabilities_document.php - * \ingroup bookcal - * \brief Tab for documents linked to Availabilities + * \file htdocs/bookcal/availabilities_document.php + * \ingroup bookcal + * \brief Tab for documents linked to Availabilities */ // Load Dolibarr environment From fbea01dd4c35b70ffe1b5a78fd7b62765e5078f1 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:57:08 +0200 Subject: [PATCH 14/21] Update availabilities_list.php (#25546) --- htdocs/bookcal/availabilities_list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index c53ff3bd17d..cf79f93e96e 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -17,9 +17,9 @@ */ /** - * \file availabilities_list.php - * \ingroup bookcal - * \brief List page for availabilities + * \file htdocs/bookcal/availabilities_list.php + * \ingroup bookcal + * \brief List page for availabilities */ // Load Dolibarr environment From 383133c03a0a87c6a8af4c08bd1fb2bf13edc2e0 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 13:10:35 +0200 Subject: [PATCH 15/21] Update availabilities_contact.php (#25544) --- htdocs/bookcal/availabilities_contact.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookcal/availabilities_contact.php b/htdocs/bookcal/availabilities_contact.php index cef8bd0367c..4b24db76ad4 100644 --- a/htdocs/bookcal/availabilities_contact.php +++ b/htdocs/bookcal/availabilities_contact.php @@ -17,9 +17,9 @@ */ /** - * \file availabilities_contact.php - * \ingroup bookcal - * \brief Tab for contacts linked to Availabilities + * \file htdocs/bookcal/availabilities_contact.php + * \ingroup bookcal + * \brief Tab for contacts linked to Availabilities */ // Load Dolibarr environment From 029ce5e9dd8bd04f9d088ed12d64f39e95822a6e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 13:10:46 +0200 Subject: [PATCH 16/21] Update availabilities_card.php (#25543) --- htdocs/bookcal/availabilities_card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index f1ebb871af7..dc62fa0f2e0 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -17,9 +17,9 @@ */ /** - * \file availabilities_card.php - * \ingroup bookcal - * \brief Page to create/edit/view availabilities + * \file htdocs/bookcal/availabilities_card.php + * \ingroup bookcal + * \brief Page to create/edit/view availabilities */ // Load Dolibarr environment @@ -36,7 +36,7 @@ $langs->loadLangs(array("agenda", "other")); // Get parameters $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOST('lineid', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); From fa3d62cbbba0e9ebf17de6ac80de4b88ee41ea12 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 13:10:54 +0200 Subject: [PATCH 17/21] Update availabilities_agenda.php (#25542) --- htdocs/bookcal/availabilities_agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index 743eb5cb3b7..44cc15c3fdb 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -17,7 +17,7 @@ */ /** - * \file availabilities_agenda.php + * \file htdocs/bookcal/availabilities_agenda.php * \ingroup bookcal * \brief Tab of events on Availabilities */ From 60dfe4b60e1537ff1f86008694609a549dc95259 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 13:14:50 +0200 Subject: [PATCH 18/21] Update element.php (#25541) sorting of if (isModEnabled(' ')) { require_once merged two 'stock' entries --- htdocs/projet/element.php | 91 ++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 0669ba9f61b..bca52b73045 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -37,71 +37,72 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (isModEnabled('stock')) { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; + +if (isModEnabled('agenda')) { + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; } -if (isModEnabled("propal")) { - require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (isModEnabled('banque')) { + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; +} +if (isModEnabled('categorie')) { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +} +if (isModEnabled('commande')) { + require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +} +if (isModEnabled('contrat')) { + require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; +} +if (isModEnabled('deplacement')) { + require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; +} +if (isModEnabled('don')) { + require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; +} +if (isModEnabled('expedition')) { + require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; +} +if (isModEnabled('expensereport')) { + require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (isModEnabled('commande')) { - require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -} -if (isModEnabled('supplier_proposal')) { - require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; -} -if (isModEnabled("supplier_invoice")) { - require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -} -if (isModEnabled("supplier_order")) { - require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -} -if (isModEnabled('contrat')) { - require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -} if (isModEnabled('ficheinter')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } -if (isModEnabled("expedition")) { - require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; -} -if (isModEnabled('deplacement')) { - require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; -} -if (isModEnabled('expensereport')) { - require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; -} -if (isModEnabled('agenda')) { - require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -} -if (isModEnabled('don')) { - require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -} if (isModEnabled('loan')) { require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loanschedule.class.php'; } -if (isModEnabled('stock')) { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; +if (isModEnabled('mrp')) { + require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; } -if (isModEnabled('tax')) { - require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; -} -if (isModEnabled("banque")) { - require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; +if (isModEnabled('propal')) { + require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } if (isModEnabled('salaries')) { require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; } -if (isModEnabled('categorie')) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +if (isModEnabled('stock')) { + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; } -if (isModEnabled('mrp')) { - require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; +if (isModEnabled('supplier_invoice')) { + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; } +if (isModEnabled('supplier_order')) { + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +} +if (isModEnabled('supplier_proposal')) { + require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; +} +if (isModEnabled('tax')) { + require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +} + + // Load translation files required by the page $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta')); From 5c926d9876962bc8e647a75a7bd4e0d43feea282 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 13:15:22 +0200 Subject: [PATCH 19/21] Update comment.php (#25540) --- htdocs/projet/tasks/comment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 4540112f4c3..5199c026b93 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -18,9 +18,9 @@ */ /** - * \file htdocs/projet/tasks/task.php + * \file htdocs/projet/tasks/comment.php * \ingroup project - * \brief Page of a project task + * \brief Page of a project task comment */ require "../../main.inc.php"; From e532b1a894e9b5a28ec63e9f5dcf837795370d5a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 9 Aug 2023 13:15:36 +0200 Subject: [PATCH 20/21] Update comment.php (#25539) --- htdocs/projet/comment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index 7103916cdb4..fa71bc2aa72 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -18,9 +18,9 @@ */ /** - * \file htdocs/projet/tasks/task.php + * \file htdocs/projet/comment.php * \ingroup project - * \brief Page of a project task + * \brief Page of a project */ // Load Dolibarr environment From 10e2a35aa6340508cdbc9a424280f7cdcc700f84 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Aug 2023 13:21:56 +0200 Subject: [PATCH 21/21] Update interface_20_all_Logevents.class.php --- .../core/triggers/interface_20_all_Logevents.class.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index ab32870a8c8..acf250f9faa 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -79,6 +79,7 @@ class InterfaceLogevents extends DolibarrTriggers /* Actions */ + $txt = $action; $langs->load("users"); // USER_LOGIN @@ -167,15 +168,6 @@ class InterfaceLogevents extends DolibarrTriggers $desc = $langs->transnoentities("GroupDeleted", $object->name); } - // If not found - /* - else - { - dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action."); - return 0; - } - */ - // Add more information into desc from the context property if (!empty($desc) && !empty($object->context['audit'])) { $desc .= ' - '.$object->context['audit'];