diff --git a/ChangeLog b/ChangeLog index 8b6ecb874e1..60efdf1093b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -64,7 +64,7 @@ FIX: bad timezone for the start/end date of an event FIX: Better test on validity of compute field syntax with parenthesis FIX: close #28279 FIX: Count of virtual stock at Services and MoLine with disabled stock change (#28580) -FIX: disabled pito of menu must be greyed. +FIX: disabled picto of menu must be greyed. FIX: Don't display column when it's out of date (#28271) FIX: duplicate with lines: 414-416 (#28358) FIX: edit bank suggested for credit transfer payment in invoice setup diff --git a/build/exe/doliwamp/Languages/MyFrench.isl b/build/exe/doliwamp/Languages/MyFrench.isl index ca38aa599e3..2fb684657a5 100644 --- a/build/exe/doliwamp/Languages/MyFrench.isl +++ b/build/exe/doliwamp/Languages/MyFrench.isl @@ -2,47 +2,47 @@ [CustomMessages] NameAndVersion=%1 version %2 -AdditionalIcons=Icônes supplémentaires : -CreateDesktopIcon=Créer une icône sur le &Bureau -CreateQuickLaunchIcon=Créer une icône dans la barre de &Lancement rapide +AdditionalIcons=Icônes supplémentaires : +CreateDesktopIcon=Créer une icône sur le &Bureau +CreateQuickLaunchIcon=Créer une icône dans la barre de &Lancement rapide ProgramOnTheWeb=Page d'accueil de %1 -UninstallProgram=Désinstaller %1 -LaunchProgram=Exécuter %1 +UninstallProgram=Désinstaller %1 +LaunchProgram=Exécuter %1 AssocFileExtension=&Associer %1 avec l'extension de fichier %2 AssocingFileExtension=Associe %1 avec l'extension de fichier %2... -YouWillInstallDoliWamp=Vous allez installer DoliWamp sur votre ordinateur (donc Dolibarr + tous ses composants prérequis comme Apache, Mysql et PHP). -ThisAssistantInstallOrUpgrade=AVERTISSEMENT: L'utilisation d'un ERP CRM installé sur un ordinateur local peut être dangereuse: si votre ordinateur tombe en panne, vous pouvez perdre toutes vos données. Faites-le si vous êtes prêt à gérer les sauvegardes vous-même sérieusement. Sinon, utilisez plutôt une installation en Saas (voir https://saas.dolibarr.org). -IfYouHaveTechnicalKnowledge=De plus, si vous avez des compétences techniques et envisagez de partager votre Apache, Mysql et PHP avec d''autres applications que Dolibarr, vous ne devriez pas utiliser cet assistant mais faire plutôt une installation manuelle de Dolibarr sur un serveur existant équipé de Apache, Mysql et PHP. -ButIfYouLook=Mais si vous recherchez une installation clé en main automatisée sur une poste local, vous êtes sur la bonne voie... -DoYouWantToStart=Voulez-vous démarrer le processus d'installation ? +YouWillInstallDoliWamp=Vous allez installer DoliWamp sur votre ordinateur (donc Dolibarr + tous ses composants prérequis comme Apache, Mysql et PHP). +ThisAssistantInstallOrUpgrade=AVERTISSEMENT: L'utilisation d'un ERP CRM installé sur un ordinateur local peut être dangereuse: si votre ordinateur tombe en panne, vous pouvez perdre toutes vos données. Faites-le si vous êtes prêt à gérer les sauvegardes vous-même sérieusement. Sinon, utilisez plutôt une installation en Saas (voir https://saas.dolibarr.org). +IfYouHaveTechnicalKnowledge=De plus, si vous avez des compétences techniques et envisagez de partager votre Apache, Mysql et PHP avec d''autres applications que Dolibarr, vous ne devriez pas utiliser cet assistant mais faire plutôt une installation manuelle de Dolibarr sur un serveur existant équipé de Apache, Mysql et PHP. +ButIfYouLook=Mais si vous recherchez une installation clé en main automatisée sur une poste local, vous êtes sur la bonne voie... +DoYouWantToStart=Voulez-vous démarrer le processus d'installation ? -TechnicalParameters=Paramètres techniques -IfFirstInstall=S'il s'agit de la première installation, merci de spécifier ces quelques paramètres techniques. Si vous ne les comprennez pas, êtes non sûr, ou procédez à une mise à jour, laissez les champs avec les valeurs proposées par défaut. +TechnicalParameters=Paramètres techniques +IfFirstInstall=S'il s'agit de la première installation, merci de spécifier ces quelques paramètres techniques. Si vous ne les comprennez pas, êtes non sûr, ou procédez à une mise à jour, laissez les champs avec les valeurs proposées par défaut. ; WARNING !!! STRINGS FOR THIS 4 STRINGS MUST BE LOWER THAN 70 CHARACTERS -SMTPServer=Serveur SMTP (le votre ou de votre FAI, première installation uniquement): -ApachePort=Port Apache (première installation uniquement, le choix standard est 80): -MySqlPort=Port Mysql (première installation uniquement, le choix standard est 3306): -MySqlPassword=Mot de passe serveur+base MySql de root (première installation uniquement): +SMTPServer=Serveur SMTP (le votre ou de votre FAI, première installation uniquement): +ApachePort=Port Apache (première installation uniquement, le choix standard est 80): +MySqlPort=Port Mysql (première installation uniquement, le choix standard est 3306): +MySqlPassword=Mot de passe serveur+base MySql de root (première installation uniquement): -FailedToDeleteLock=Echec de la suppression du fichier %1/www/dolibarr/install.lock. Vous pouvez ignorer l'avertissement mais il est possible que vous deviez le supprimer manuellement plus tard. Dans ce cas, cela vous sera signalé. Cliquez sur OK pour continuer... +FailedToDeleteLock=Echec de la suppression du fichier %1/www/dolibarr/install.lock. Vous pouvez ignorer l'avertissement mais il est possible que vous deviez le supprimer manuellement plus tard. Dans ce cas, cela vous sera signalé. Cliquez sur OK pour continuer... -PortAlreadyInUse=Le port %1 semble déjà utilisé. Il est recommandé d'annuler pour revenir en arrière et spécifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ? +PortAlreadyInUse=Le port %1 semble déjà utilisé. Il est recommandé d'annuler pour revenir en arrière et spécifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ? -FirefoxDetected=Firefox a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? -ChromeDetected=Chrome a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? -ChooseDefaultBrowser=Merci de choisir votre navigateur par défaut (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Si vous n'êtes pas sûr, cliquez simplement sur Ouvrir : +FirefoxDetected=Firefox a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? +ChromeDetected=Chrome a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? +ChooseDefaultBrowser=Merci de choisir votre navigateur par défaut (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Si vous n'êtes pas sûr, cliquez simplement sur Ouvrir : LaunchNow=Lancer Dolibarr maintenant -ProgramHasBeenRemoved=Les fichiers du programme Dolibarr ont été supprimés. Toutefois, tous vos fichiers de données sont toujours dans le répertoire %1. Vous devez supprimer ce répertoire manuellement pour avoir une désinstallation complète. +ProgramHasBeenRemoved=Les fichiers du programme Dolibarr ont été supprimés. Toutefois, tous vos fichiers de données sont toujours dans le répertoire %1. Vous devez supprimer ce répertoire manuellement pour avoir une désinstallation complète. -DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant démarrer ou redémarrer Apache et Mysql, ceci peut durer de quelques secondes à une minute après cette confirmation. Démarrer l'installation ou mise à jour du serveur web et base de données requis par Dolibarr ? +DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant démarrer ou redémarrer Apache et Mysql, ceci peut durer de quelques secondes à une minute après cette confirmation. Démarrer l'installation ou mise à jour du serveur web et base de données requis par Dolibarr ? -OldVersionFoundAndMoveInNew=Une ancienne version de base a été trouvée et déplacée pour fonctionner avec la nouvelle version de Dolibarr. -OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a été trouvée mais ne peut être déplacée pour être utilisée avec la nouvelle version de Dolibarr. +OldVersionFoundAndMoveInNew=Une ancienne version de base a été trouvée et déplacée pour fonctionner avec la nouvelle version de Dolibarr. +OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a été trouvée mais ne peut être déplacée pour être utilisée avec la nouvelle version de Dolibarr. -DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2017". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après. -ContinueAnyway=Continuer malgré tout (le process d'installaton échouera) +DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2017". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après. +ContinueAnyway=Continuer malgré tout (le process d'installaton échouera) diff --git a/dev/tools/codespell/codespell-dict.txt b/dev/tools/codespell/codespell-dict.txt index f6d51c0b68d..047de65a4a8 100644 --- a/dev/tools/codespell/codespell-dict.txt +++ b/dev/tools/codespell/codespell-dict.txt @@ -9,6 +9,7 @@ aploha->alpha aplohanothtml->alphanohtml aplphanothtml->alphanohtml choosed->chosen +cumuled->cumulative dokument->document dolibar->dolibarr dolibarrr->dolibarr diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 1d8a2f6f467..21d410a9665 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -497,7 +497,7 @@ return [ // 'PhanTypeMismatchDimAssignment', // 'PhanPluginDescriptionlessCommentOnProtectedMethod', // 'PhanPluginPrintfIncompatibleArgumentTypeWeak', - 'PhanUndeclaredVariableAssignOp', + // 'PhanUndeclaredVariableAssignOp', // 'PhanTypeExpectedObjectOrClassName', 'PhanEmptyFQSENInClasslike', // 'PhanTypeMismatchArgumentInternalReal', diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index db569da428c..10adfea0bc8 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -80,7 +80,7 @@ llxHeader('', $langs->trans("AccountancyArea"), $help_url); if (isModEnabled('accounting')) { $step = 0; - $resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) + $helpisexpanded = empty($resultboxes['boxactivated']) || (empty($resultboxes['boxlista']) && empty($resultboxes['boxlistb'])); // If there is no widget, the tooltip help is expanded by default. $showtutorial = ''; @@ -263,33 +263,6 @@ if (isModEnabled('accounting')) { print ''; print '
'; - - print '
'; - - /* - * Show boxes - */ - $boxlist = '
'; - - $boxlist .= '
'; - - $boxlist .= $resultboxes['boxlista']; - - $boxlist .= '
'; - - $boxlist .= '
'; - - $boxlist .= $resultboxes['boxlistb']; - - $boxlist .= '
'; - $boxlist .= "\n"; - - $boxlist .= '
'; - - - print $boxlist; - - print '
'; } elseif (isModEnabled('comptabilite')) { print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); @@ -300,6 +273,21 @@ if (isModEnabled('accounting')) { print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); } +/* + * Show boxes + */ +$resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) +$boxlist = '
'; +$boxlist .= '
'; +$boxlist .= $resultboxes['boxlista']; +$boxlist .= '
'; +$boxlist .= '
'; +$boxlist .= $resultboxes['boxlistb']; +$boxlist .= '
'; +$boxlist .= "\n"; +$boxlist .= '
'; +print $boxlist; + // End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index ae1f8bf67d1..546427463da 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -681,7 +681,7 @@ if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu // Confirm deletion of record if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&code='.urlencode($code).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } @@ -1101,7 +1101,7 @@ if ($num) { } print "\n"; - print ''; + print ''; print ''; $fieldsforcontent = array('topic', 'email_from','joinfiles', 'content'); diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index e122150571b..14121aebab8 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -39,6 +39,7 @@ if (!$user->admin) { accessforbidden(); } +$table = GETPOST('table', 'aZ09'); $action = GETPOST('action', 'aZ09'); @@ -46,16 +47,20 @@ $action = GETPOST('action', 'aZ09'); * Actions */ -if ($action == 'convert') { - $sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB"; +if ($action == 'convert') { // Convert engine into innodb + $sql = "ALTER TABLE ".$db->sanitize($table)." ENGINE=INNODB"; $db->query($sql); } if ($action == 'convertutf8') { - $sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci"; + $sql = "ALTER TABLE ".$db->sanitize($table)." CHARACTER SET utf8 COLLATE utf8_unicode_ci"; + $db->query($sql); +} +if ($action == 'convertutf8mb4') { + $sql = "ALTER TABLE ".$db->sanitize($table)." CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"; $db->query($sql); } if ($action == 'convertdynamic') { - $sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ROW_FORMAT=DYNAMIC;"; + $sql = "ALTER TABLE ".$db->sanitize($table)." ROW_FORMAT=DYNAMIC;"; $db->query($sql); } @@ -160,16 +165,24 @@ if (!$base) { print '
'.$langs->trans("Convert").' Dynamic'; } print ''; - print ''.$obj->Rows.''; - print ''.$obj->Avg_row_length.''; - print ''.$obj->Data_length.''; - print ''.$obj->Max_data_length.''; - print ''.$obj->Index_length.''; - print ''.$obj->Auto_increment.''; - print ''.$obj->Check_time.''; - print ''.$obj->Collation; - if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci")))) { - print '
'.$langs->trans("Convert").' UTF8'; + print ''.$obj->Rows.''; + print ''.$obj->Avg_row_length.''; + print ''.$obj->Data_length.''; + print ''.$obj->Max_data_length.''; + print ''.$obj->Index_length.''; + print ''.$obj->Auto_increment.''; + print ''.$obj->Check_time.''; + print ''.$obj->Collation; + // Link to convert collation + if (isset($obj->Collation)) { + print '
'.$langs->trans("ConvertInto"); + if (!in_array($obj->Collation, array("utf8_unicode_ci"))) { + print ' utf8'; + } + if (!in_array($obj->Collation, array("utf8mb4_unicode_ci"))) { + print ' utf8mb4'; + } + print ''; } print ''; print ''; diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index c7e7c5baa5e..2cec477994f 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -33,7 +33,57 @@ if (!$user->admin) { accessforbidden(); } -$table = GETPOST('table', 'alpha'); +$table = GETPOST('table', 'aZ09'); +$field = GETPOST('field', 'aZ09'); +$action = GETPOST('action', 'aZ09'); + + +/* + * Actions + */ + +if ($action == 'convertutf8') { + $sql = "SHOW FULL COLUMNS IN ".$db->sanitize($table); + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $row = $db->fetch_row($resql); + if ($row[0] == $field) { + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." CHARACTER SET utf8"; // We must not sanitize the $row[1] + $db->query($sql); + + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." COLLATE utf8_unicode_ci"; // We must not sanitize the $row[1] + $db->query($sql); + + break; + } + } + } +} +if ($action == 'convertutf8mb4') { + $sql = "SHOW FULL COLUMNS IN ".$db->sanitize($table); + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $row = $db->fetch_row($resql); + if ($row[0] == $field) { + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." CHARACTER SET utf8mb4"; // We must not sanitize the $row[1] + $db->query($sql); + + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." COLLATE utf8mb4_unicode_ci"; // We must not sanitize the $row[1] + $db->query($sql); + + break; + } + } + } +} /* @@ -48,7 +98,7 @@ print load_fiche_titre($langs->trans("Table")." ".$table, '', 'title_setup'); // Define request to get table description $base = 0; if (preg_match('/mysql/i', $conf->db->type)) { - $sql = "SHOW TABLE STATUS LIKE '".$db->escape($table)."'"; + $sql = "SHOW TABLE STATUS LIKE '".$db->escape($db->escapeforlike($table))."'"; $base = 1; } elseif ($conf->db->type == 'pgsql') { $sql = "SELECT conname,contype FROM pg_constraint"; @@ -99,7 +149,7 @@ if (!$base) { print ''; // $sql = "DESCRIBE ".$table; - $sql = "SHOW FULL COLUMNS IN ".$db->escape($table); + $sql = "SHOW FULL COLUMNS IN ".$db->sanitize($table); $resql = $db->query($sql); if ($resql) { @@ -109,12 +159,46 @@ if (!$base) { $row = $db->fetch_row($resql); print ''; + // field print "".$row[0].""; + // type - print "".$row[1].""; + print ""; + $proptype = $row[1]; + $pictoType = ''; + $matches = array(); + if (preg_match('/^varchar/', $proptype, $matches)) { + $pictoType = 'varchar'; + } elseif (strpos($proptype, 'int') === 0 || strpos($proptype, 'tinyint') === 0 || strpos($proptype, 'bigint') === 0) { + $pictoType = 'int'; + } elseif (strpos($proptype, 'timestamp') === 0) { + $pictoType = 'datetime'; + } elseif (strpos($proptype, 'real') === 0) { + $pictoType = 'double'; + } + print(!empty($pictoType) ? getPictoForType($pictoType) : getPictoForType($proptype)).''.dol_escape_htmltag($proptype).''; + print ""; + // collation - print "".$row[2].""; + print "".(empty($row[2]) ? ' ' : $row[2]); + + // Link to convert collation + if (isset($row[2])) { + print '
'.$langs->trans("ConvertInto"); + if (!in_array($row[2], array("utf8_unicode_ci"))) { + print ' utf8'; + } + if (!in_array($row[2], array("utf8mb4_unicode_ci"))) { + print ' utf8mb4'; + } + print ''; + } else { + print '
 '; + } + + print ""; + // null print "".$row[3].""; // key diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 648f7706ad9..d68b7c054ef 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -158,7 +158,7 @@ $workflowcodes = array( 'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array( 'family' => 'classify_shipping', 'position' => 90, - 'enabled' => isModEnabled("expedition") && isModEnabled("facture"), + 'enabled' => isModEnabled("shipping") && isModEnabled("invoice"), 'picto' => 'shipment', 'deprecated' => 1 ), diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index d0efa85599e..9c512bfc047 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1491,6 +1491,7 @@ if ($action == 'create') { print ''; // List of files $listofpaths = dol_dir_list($upload_dir, 'all', 0, '', '', 'name', SORT_ASC, 0); + $out = ''; // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript $out .= ''."\n"; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 7296c3dd820..86898548291 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1573,6 +1573,7 @@ if (empty($reshook)) { $TTotalByTva[$line->tva_tx] += $line->total_ttc; } + $amount_ttc_diff = 0.; foreach ($TTotalByTva as $tva => &$total) { $coef = $total / $srcobject->total_ttc; // Calc coef $am = $amount * $coef; diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index af4e1463ae3..ecb946e6686 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -253,6 +253,7 @@ if ($action == 'create') { $total = 0; $totalrecu = 0; + $total_ttc = 0.; while ($i < $num) { $objp = $tva; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 2cc21fb215d..e3a3eb07439 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -83,6 +83,9 @@ class BonPrelevement extends CommonObject public $factures = array(); + /** + * @var array + */ public $methodes_trans = array(); public $invoice_in_error = array(); @@ -171,6 +174,9 @@ class BonPrelevement extends CommonObject public $credite; public $note; public $date_trans; + /** + * @var int Current transport method, index to $methodes_trans + */ public $method_trans; public $fk_user_trans; public $date_credit; diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 1fe40efa05e..1dc1fd3d76d 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -274,10 +274,10 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; + $param = "&id=".((int) $id); if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } - $param = "&id=".urlencode((string) ($id)); // Lines of title fields print '
'; @@ -325,10 +325,14 @@ if ($resql) { while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); - if ($salaryBonPl) { + $itemurl = ''; + $partyurl = ''; + if ($salaryBonPl && ($salarytmp instanceof Salary) && ($user instanceof User)) { $salarytmp->fetch($obj->salaryid); $usertmp->fetch($obj->userid); - } else { + $itemurl = $salarytmp->getNomUrl(1); + $partyurl = $usertmp->getNomUrl(1); + } elseif ($invoicetmp instanceof Facture && $invoicetmpsupplier instanceof FactureFournisseur) { if ($obj->type == 'bank-transfer') { $invoicetmp = $invoicetmpsupplier; } else { @@ -337,22 +341,24 @@ if ($resql) { $invoicetmp->fetch($obj->facid); $thirdpartytmp->fetch($obj->socid); + $itemurl = $invoicetmp->getNomUrl(1); + $partyurl = $thirdpartytmp->getNomUrl(1); } print ''; print ''; - print($salaryBonPl ? $salarytmp->getNomUrl(1) : $invoicetmp->getNomUrl(1)); + print $itemurl; print "\n"; - if ($object->type == 'bank-transfer' && !$salaryBonPl) { + if ($object->type == 'bank-transfer' && !$salaryBonPl && $invoicetmp instanceof Facture) { print ''; print dol_escape_htmltag($invoicetmp->ref_supplier); print "\n"; } print ''; - print($salaryBonPl ? $usertmp->getNomUrl(-1) : $thirdpartytmp->getNomUrl(1)); + print $partyurl; print "\n"; // Amount of invoice diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index d0ca5f7142e..4d8c4f8fadd 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -130,8 +130,8 @@ $dolibarr_main_db_user=''; // dolibarr_main_db_pass // ===================== // This parameter contains password used to read and write into Dolibarr database. -// If content is 'crypted:...', the password is encrypted/decrypted with dol_encode/dol_decode. -// If content is 'dolcrypt:...', the password is encrypted/decrypted with dolEncrypt/dolDecrypt. +// If content is 'crypted:...', the password is encrypted/decrypted with dol_encode/dol_decode. +// If content is 'dolcrypt:...', the password is encrypted/decrypted with dolEncrypt/dolDecrypt. // // Examples: // $dolibarr_main_db_pass='myadminpass'; @@ -160,6 +160,7 @@ $dolibarr_main_db_type=''; // Default value: depends on database driver // Examples: // dolibarr_main_db_character_set='utf8'; +// dolibarr_main_db_character_set='utf8mb4'; // $dolibarr_main_db_character_set='utf8'; @@ -455,5 +456,3 @@ $dolibarr_cron_allow_cli='0'; //############################## // External modules //############################## - - diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index affca98a90d..61b31bfb5fd 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -172,19 +172,19 @@ if ($action == 'add') { //In sellist we have only one line and it can have come to do SQL expression if ($type == 'sellist' || $type == 'chkbxlst') { foreach ($parameters_array as $param_ligne) { - $params['options'] = array($parameters=>null); + $params['options'] = array($parameters => null); } } else { // Else it's separated key/value and coma list foreach ($parameters_array as $param_ligne) { - if (strpos($param_ligne, ',')!==false) { + if (strpos($param_ligne, ',') !== false) { list($key, $value) = explode(',', $param_ligne); if (!array_key_exists('options', $params)) { $params['options'] = array(); } } else { - $key=$param_ligne; - $value=null; + $key = $param_ligne; + $value = null; } $params['options'][$key] = $value; } @@ -345,7 +345,7 @@ if ($action == 'update') { //In sellist we have only one line and it can have come to do SQL expression if ($type == 'sellist' || $type == 'chkbxlst') { foreach ($parameters_array as $param_ligne) { - $params['options'] = array($parameters=>null); + $params['options'] = array($parameters => null); } } else { //Else it's separated key/value and coma list @@ -447,7 +447,7 @@ if ($action == 'encrypt') { if ($extrafields->attributes[$elementtype]['entityid'][$attributekey] == $conf->entity || empty($extrafields->attributes[$elementtype]['entityid'][$attributekey])) { dol_syslog("Loop on each extafields of table ".$arrayofelement['table_element']); - $sql .= "SELECT te.rowid, te.".$attributekey; + $sql = "SELECT te.rowid, te.".$attributekey; $sql .= " FROM ".MAIN_DB_PREFIX.$arrayofelement['table_element']." as t, ".MAIN_DB_PREFIX.$arrayofelement['table_element'].'_extrafields as te'; $sql .= " WHERE te.fk_object = t.rowid"; $sql .= " AND te.".$attributekey." NOT LIKE 'dolcrypt:%'"; @@ -462,7 +462,7 @@ if ($action == 'encrypt') { $resql = $db->query($sql); if ($resql) { $num_rows = $db->num_rows($resql); - $i=0; + $i = 0; while ($i < $num_rows) { $objtmp = $db->fetch_object($resql); $id = $objtmp->rowid; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 0bfbb65529a..78c04ba5e88 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -292,7 +292,7 @@ class CMailFile // This convert an embedded file with src="data:image... into a cid link + attached file $resultImageData = $this->findHtmlImagesIsSrcData($upload_dir_tmp); if ($resultImageData < 0) { - dol_syslog("CMailFile::CMailfile: Error on findHtmlImagesInSrcData"); + dol_syslog("CMailFile::CMailfile: Error on findHtmlImagesInSrcData code=".$resultImageData." upload_dir_tmp=".$upload_dir_tmp); $this->error = 'ErrorInAddAttachementsImageBaseOnMedia'; return; } @@ -1983,6 +1983,10 @@ class CMailFile // Build the array of image extensions $extensions = array_keys($this->image_types); + if (empty($images_dir)) { + $images_dir = $conf->admin->dir_output.'/temp/'.uniqid('cmailfile'); + } + if ($images_dir && !dol_is_dir($images_dir)) { dol_mkdir($images_dir, DOL_DATA_ROOT); } @@ -2005,7 +2009,7 @@ class CMailFile if (!empty($matches) && !empty($matches[1])) { if (empty($images_dir)) { // No temp directory provided, so we are not able to support conversion of data:image into physical images. - $this->error = 'NoTempDirProvidedInCMailConstructorSoCantConvertDataImgOnDisk'; + $this->errors[] = 'NoTempDirProvidedInCMailConstructorSoCantConvertDataImgOnDisk'; return -1; } @@ -2027,7 +2031,7 @@ class CMailFile dolChmod($destfiletmp); } else { $this->errors[] = "Failed to open file '".$destfiletmp."' for write"; - return -1; + return -2; } } diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 4fa8ee3eac6..471cffd2a84 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1661,10 +1661,14 @@ class FormTicket $texttooltip .= '

'.$langs->trans("ForEmailMessageWillBeCompletedWith").'...'; } if (getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO')) { - $texttooltip .= '
'.$langs->trans("TicketMessageMailIntro").'
'.getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO'); + $mail_intro = make_substitutions(getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO'), $this->substit); + print ''; + $texttooltip .= '
'.$langs->trans("TicketMessageMailIntro").'
'.$mail_intro; } if (getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE')) { - $texttooltip .= '

'.$langs->trans("TicketMessageMailFooter").'
'.getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'); + $mail_signature = make_substitutions(getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'), $this->substit); + print ''; + $texttooltip .= '

'.$langs->trans("TicketMessageMailFooter").'
'.$mail_signature; } print $form->textwithpicto('', $texttooltip, 1, 'help'); } diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 9498ed91d9c..d6e4f788500 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -390,6 +390,7 @@ if ($action == 'viewgraph') { // Get all possible values of fields when a 'group by' is set, and save this into $arrayofvaluesforgroupby // $arrayofvaluesforgroupby will be used to forge lael of each grouped series if (is_array($search_groupby) && count($search_groupby)) { + $fieldtocount = ''; foreach ($search_groupby as $gkey => $gval) { $gvalwithoutprefix = preg_replace('/^[a-z]+\./', '', $gval); diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 8024bb4aa5b..ff63113e47b 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -125,11 +125,15 @@ class DoliDBMysqli extends DoliDB dol_syslog(get_class($this)."::DoliDBMysqli You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database ".$this->db->character_set_name(), LOG_WARNING); $this->db->set_charset($clientmustbe); // This set charset, but with a bad collation } catch (Exception $e) { - print 'Failed to force character set to '.$clientmustbe." according to setup to match the one of the server database.
\n"; + print 'Failed to force character_set_client to '.$clientmustbe." (according to setup) to match the one of the server database.
\n"; print $e->getMessage(); print "
\n"; if ($clientmustbe != 'utf8') { - print 'Edit conf/conf.php file to set a charset "utf8" instead of "'.$clientmustbe.'".'."\n"; + print 'Edit conf/conf.php file to set a charset "utf8"'; + if ($clientmustbe != 'utf8mb4') { + print ' or "utf8mb4"'; + } + print ' instead of "'.$clientmustbe.'".'."\n"; } exit; } diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index a76fbfb6857..ecb9b0f0df9 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -724,7 +724,7 @@ class DoliDBPgsql extends DoliDB */ public function escape($stringtoencode) { - return pg_escape_string($stringtoencode); + return pg_escape_string($this->db, $stringtoencode); } /** diff --git a/htdocs/core/get_info.php b/htdocs/core/get_info.php index 28434f7d405..2b5fc8f69d4 100644 --- a/htdocs/core/get_info.php +++ b/htdocs/core/get_info.php @@ -88,6 +88,8 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { } $logouttext = ''; +$logouthtmltext = ''; +$toprightmenu = ''; if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { //$logouthtmltext=$appli.'
'; if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') { diff --git a/htdocs/core/lib/emaillayout.lib.php b/htdocs/core/lib/emaillayout.lib.php index 1240c2fa664..75b7b589c44 100644 --- a/htdocs/core/lib/emaillayout.lib.php +++ b/htdocs/core/lib/emaillayout.lib.php @@ -30,28 +30,28 @@ */ function getHtmlOfLayout($name) { + global $conf, $mysoc, $user, $langs; + if ($name == 'basic') { $out = '
-
- Gray rectangle -
-

Lorem, ipsum dolor sit amet consectetur adipisicing elit.

-

Lorem, ipsum dolor sit amet consectetur

- +
'; + if (!empty($mysoc->logo)) { + if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $out .= ''; + } + } else { + $out .= 'Gray rectangle'; + } + $out .= '
+

'.$langs->trans('TitleOfMailHolder').'

- - - - Gray rectangle - -
'; +

'.$langs->trans('ContentOfMailHolder').'

+ '; + if (!(empty($user->signature))) { + $out .= '

'.dol_htmlentities($user->signature).'

'; + } + $out .= ''; } elseif ($name == 'news') { $out = '

Lorem, ipsum dolor sit amet consectetur adipisicing elit sit amet consectetur

diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2f8f3266009..4a1beee4bcf 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5437,7 +5437,7 @@ function img_mime($file, $titlealt = '', $morecss = '') */ function img_search($titlealt = 'default', $other = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') { $titlealt = $langs->trans('Search'); @@ -5460,7 +5460,7 @@ function img_search($titlealt = 'default', $other = '') */ function img_searchclear($titlealt = 'default', $other = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') { $titlealt = $langs->trans('Search'); @@ -5682,7 +5682,7 @@ function dol_print_error($db = null, $error = '', $errors = null) */ function dol_print_error_email($prefixcode, $errormessage = '', $errormessages = array(), $morecss = 'error', $email = '') { - global $langs, $conf; + global $langs; if (empty($email)) { $email = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); @@ -5745,7 +5745,7 @@ function print_liste_field_titre($name, $file = "", $field = "", $begin = "", $m */ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin = "", $moreparam = "", $moreattrib = "", $sortfield = "", $sortorder = "", $prefix = "", $disablesortlink = 0, $tooltip = '', $forcenowrapcolumntitle = 0) { - global $conf, $langs, $form; + global $langs, $form; //print "$name, $file, $field, $begin, $options, $moreattrib, $sortfield, $sortorder
\n"; if ($moreattrib == 'class="right"') { @@ -11766,8 +11766,8 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * @param string|array $url Url for link or array of subbutton description ('label'=>, 'url'=>, 'lang'=>, 'perm'=> ) * Example when an array is used: $arrayforbutaction = array( * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - * 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("commande"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - * 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("facture"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("invoice"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), * ); * @param string $id Attribute id of action button. Example 'action-delete'. This can be used for full ajax confirm if this code is reused into the ->formconfirm() method. * @param int|boolean $userRight User action right @@ -13931,3 +13931,71 @@ function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto' return '&' . http_build_query($TParam); } + +/** + * Displays an error page when a record is not found. It allows customization of the message, + * whether to include the header and footer, and if only the message should be shown without additional details. + * The function also supports executing additional hooks for customized handling of error pages. + * + * @param string $message Custom error message to display. If empty, a default "Record Not Found" message is shown. + * @param int $printheader Determines if the page header should be printed (1 = yes, 0 = no). + * @param int $printfooter Determines if the page footer should be printed (1 = yes, 0 = no). + * @param int $showonlymessage If set to 1, only the error message is displayed without any additional information or hooks. + * @param mixed $params Optional parameters to pass to hooks for further processing or customization. + * @global object $conf Dolibarr configuration object (global) + * @global object $db Database connection object (global) + * @global object $user Current user object (global) + * @global Translate $langs Language translation object, initialized within the function if not already. + * @global object $hookmanager Hook manager object, initialized within the function if not already for executing hooks. + * @global string $action Current action, can be modified by hooks. + * @global object $object Current object, can be modified by hooks. + * @return void This function terminates script execution after outputting the error page. + */ +function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $showonlymessage = 0, $params = null) +{ + global $conf, $db, $user, $langs, $hookmanager; + global $action, $object; + + if (!is_object($langs)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; + $langs = new Translate('', $conf); + $langs->setDefaultLang(); + } + + $langs->load("errors"); + + if ($printheader) { + if (function_exists("llxHeader")) { + llxHeader(''); + } elseif (function_exists("llxHeaderVierge")) { + llxHeaderVierge(''); + } + } + + print '
'; + if (empty($message)) { + print $langs->trans("ErrorRecordNotFound"); + } else { + print $langs->trans($message); + } + print '
'; + print '
'; + + if (empty($showonlymessage)) { + if (empty($hookmanager)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + $hookmanager->initHooks(array('main')); + } + + $parameters = array('message'=>$message, 'params'=>$params); + $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + print $hookmanager->resPrint; + } + + if ($printfooter && function_exists("llxFooter")) { + llxFooter(); + } + exit(0); +} diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index cfe406a7684..36cb26e4b6d 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1589,8 +1589,9 @@ function check_value($mask, $value) function binhex($bin, $pad = false, $upper = false) { $last = dol_strlen($bin) - 1; + $x = 0; for ($i = 0; $i <= $last; $i++) { - $x += $bin[$last - $i] * pow(2, $i); + $x += ($bin[$last - $i] ? 1 : 0) << $i; } $x = dechex($x); if ($pad) { diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index e661fb3db4c..d177030b841 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -18,7 +18,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 16__+MAX_llx_menu__, 'bom|mrp', 'isModEnabled("bom") || isModEnabled("mrp")', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'TMenuMRP', -1, 'mrp', '$user->hasRight("bom","read") || $user->hasRight("mrp","read")', '', 0, 31, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 7__+MAX_llx_menu__, 'projet', 'isModEnabled("project")', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->hasRight("projet","lire")', '', 2, 32, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', 'isModEnabled("propal") || isModEnabled("commande") || isModEnabled("supplier_order") || isModEnabled("contrat") || isModEnabled("ficheinter")', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->hasRight("societe","lire") || $user->hasRight("societe","contact","lire")', '', 2, 40, __ENTITY__, ''); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("facture") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->hasRight("facture","lire") || $user->hasRight("don","lire") || $user->hasRight("tax","charges","lire") || $user->hasRight("salaries","read") || $user->hasRight("loan","read") || $user->hasRight("banque","lire") || $user->hasRight("fournisseur","facture","lire") || $user->hasRight("supplier_invoice","read")', '', 2, 50, __ENTITY__, ''); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("invoice") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->hasRight("facture","lire") || $user->hasRight("don","lire") || $user->hasRight("tax","charges","lire") || $user->hasRight("salaries","read") || $user->hasRight("loan","read") || $user->hasRight("banque","lire") || $user->hasRight("fournisseur","facture","lire") || $user->hasRight("supplier_invoice","read")', '', 2, 50, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 14__+MAX_llx_menu__, 'banque|prelevement', 'isModEnabled("banque") || isModEnabled("prelevement")', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->hasRight("banque","lire") || $user->hasRight("prelevement","bons","lire")', '', 0, 52, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("asset")', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","mouvements","lire") || $user->hasRight("asset","read")', '', 2, 54, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 8__+MAX_llx_menu__, '', '', __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__, ''); @@ -231,23 +231,23 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); -- Billing - Customer invoice -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_draft&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_notpaid&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_paid&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_canceled&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_draft&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_notpaid&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_paid&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_canceled&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); -- Billing - Orders to bill -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&leftmenu=orders&search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("order")', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&leftmenu=orders&search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); -- Donations insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("don")', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?mainmenu=billing&leftmenu=donations', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); @@ -316,9 +316,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__); -- Binding -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 7, __ENTITY__); @@ -379,9 +379,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3006__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy', 'MenuListTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->hasRight("asset","model_advance","read"):$user->hasRight("asset","read"))', '', 0, 25, __ENTITY__); -- Check deposit -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->hasRight("banque","lire")', '', 2, 9, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->hasRight("banque","lire")', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&leftmenu=checks', 'List', 1, 'bills', '$user->hasRight("banque","lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->hasRight("banque","lire")', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->hasRight("banque","lire")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&leftmenu=checks', 'List', 1, 'bills', '$user->hasRight("banque","lire")', '', 2, 1, __ENTITY__); -- PaymentByDirectDebit insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2500__+MAX_llx_menu__, 'accountancy', 'withdraw', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=withdraw', 'PaymentByDirectDebit', 0, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 9, __ENTITY__); diff --git a/htdocs/core/multicompany_page.php b/htdocs/core/multicompany_page.php index 864dd76cc3d..9286e3efaaa 100644 --- a/htdocs/core/multicompany_page.php +++ b/htdocs/core/multicompany_page.php @@ -91,7 +91,9 @@ print ''."\n"; print '
'; //print '
'; - +if (!isset($bookmarkList)) { + $bookmarkList = ''; +} if (!isModEnabled('multicompany')) { $langs->load("admin"); $bookmarkList .= '
'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("MultiCompany")).''; @@ -128,7 +130,7 @@ if (!isModEnabled('multicompany')) { // Execute hook printBookmarks - $parameters = array('multicompany'=>$multicompanyList); + $parameters = array('multicompany' => $multicompanyList); $reshook = $hookmanager->executeHooks('printMultiCompanyEntities', $parameters); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { $multicompanyList .= $hookmanager->resPrint; diff --git a/htdocs/core/triggers/dolibarrtriggers.class.php b/htdocs/core/triggers/dolibarrtriggers.class.php index e1eb9be0c0c..fd3004a9c9d 100644 --- a/htdocs/core/triggers/dolibarrtriggers.class.php +++ b/htdocs/core/triggers/dolibarrtriggers.class.php @@ -186,5 +186,5 @@ abstract class DolibarrTriggers * @param conf $conf Object conf * @return int if KO: <0 || if no trigger ran: 0 || if OK: >0 */ - abstract public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf); + abstract public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf); } diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index 47432eeb75c..adc63815e33 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -88,7 +88,7 @@ class InterfaceLogevents extends DolibarrTriggers * @return int if KO: <0, if no trigger ran: 0, if OK: >0 * @throws Exception dol_syslog can throw Exceptions */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (getDolGlobalString('MAIN_LOGEVENTS_DISABLE_ALL')) { return 0; // Log events is disabled (hidden features) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 96da2886c32..1edea428b6f 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -62,7 +62,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->workflow) || empty($conf->workflow->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 034a052ce0c..4d6a062e38b 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -77,7 +77,7 @@ class InterfaceActionsAuto extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (!isModEnabled('agenda')) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index 68cfccb49d5..a27ee6b7d66 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -56,7 +56,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->blockedlog) || empty($conf->blockedlog->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php b/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php index f54615a2aaf..445bbf4ac3c 100644 --- a/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php +++ b/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php @@ -69,7 +69,7 @@ class InterfaceEventOrganization extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->eventorganization) || empty($conf->eventorganization->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index 105739fa5de..1a92bca5b66 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -59,7 +59,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->ldap) || empty($conf->ldap->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index a73a0eb2eb4..5b746b971cb 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -57,7 +57,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->mailmanspip) || empty($conf->mailmanspip->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 602c3798c97..b9a009f7c0a 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -64,7 +64,7 @@ class InterfaceNotification extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { global $hookmanager; diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index b37bd6ced34..08a24e1fc63 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -59,7 +59,7 @@ class InterfaceTicketEmail extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { global $mysoc; diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 2d2b6db94c9..7178f29654c 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -64,7 +64,7 @@ class InterfaceStripe extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { // Put here code you want to execute when a Dolibarr business event occurs. // Data and type of action are stored into $object and $action diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php index 7c3047b03d3..6906157f6ef 100644 --- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php +++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php @@ -65,7 +65,7 @@ class InterfaceContactRoles extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if ($action === 'PROPAL_CREATE' || $action === 'ORDER_CREATE' || $action === 'BILL_CREATE' || $action === 'ORDER_SUPPLIER_CREATE' || $action === 'BILL_SUPPLIER_CREATE' || $action === 'PROPOSAL_SUPPLIER_CREATE' diff --git a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php index 70777a03ed4..c78c99fc304 100644 --- a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php @@ -65,7 +65,7 @@ class InterfaceWebhookTriggers extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->webhook) || empty($conf->webhook->enabled)) { return 0; // If module is not enabled, we do nothing diff --git a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php index 701cfeec3fd..bfb4cf8ada3 100644 --- a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php @@ -58,7 +58,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->zapier) || empty($conf->zapier->enabled)) { // Module not active, we do nothing diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index a71b364cdac..69980c72d1e 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -62,7 +62,7 @@ $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state"); $search_country = GETPOSTINT("search_country"); $search_type_thirdparty = GETPOSTINT("search_type_thirdparty"); -$search_billed = GETPOSTINT("search_billed"); +$search_billed = GETPOST("search_billed", 'intcomma'); $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datedelivery_startmonth'), GETPOSTINT('search_datedelivery_startday'), GETPOSTINT('search_datedelivery_startyear')); $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datedelivery_endmonth'), GETPOSTINT('search_datedelivery_endday'), GETPOSTINT('search_datedelivery_endyear')); $search_datereceipt_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datereceipt_startmonth'), GETPOSTINT('search_datereceipt_startday'), GETPOSTINT('search_datereceipt_startyear')); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 97f21ccb533..db8b2f6c8e6 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1172,6 +1172,7 @@ if (empty($reshook)) { $TTotalByTva[$line->tva_tx] += $line->total_ttc; } + $amount_ttc_diff = 0.; foreach ($TTotalByTva as $tva => &$total) { $coef = $total / $srcobject->total_ttc; // Calc coef $am = $amount * $coef; diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index cbbb6d34cdc..acd230f65cb 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -5,7 +5,7 @@ -- -- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y -- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y --- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; -- Note that "RENAME TO" is both compatible mysql/postgesql, not "RENAME" alone. -- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; -- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); -- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; @@ -227,8 +227,8 @@ ALTER TABLE llx_product ADD COLUMN last_main_doc varchar(255); ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtext; -ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME llx_receptiondet_batch_extrafields; -ALTER TABLE llx_commande_fournisseur_dispatch RENAME llx_receptiondet_batch; +ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields; +ALTER TABLE llx_commande_fournisseur_dispatch RENAME TO llx_receptiondet_batch; -- Rename const to add customer categories on not customer/prospect third-party if enabled UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER'; diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 3611ae2c51e..132163b1f89 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -113,20 +113,20 @@ else $result=restrictedArea($user, 'produit|service', '', '', '', '', '', $objca // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'i.ref'=>"Ref", - 'pfi.ref_fourn'=>"RefSupplier", - 'i.label'=>"ProductLabel", - 'i.description'=>"Description", - "i.note"=>"Note", + 'i.ref' => "Ref", + 'pfi.ref_fourn' => "RefSupplier", + 'i.label' => "ProductLabel", + 'i.description' => "Description", + "i.note" => "Note", ); $isInEEC = isInEEC($mysoc); // Definition of fields for lists $arrayfields = array( - 'i.ref' => array('label'=>$langs->trans("Ref"), 'checked'=>1), - 'i.label' => array('label'=>$langs->trans("Label"), 'checked'=>1), - 'i.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(isModEnabled("product") && isModEnabled("service"))), + 'i.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1), + 'i.label' => array('label' => $langs->trans("Label"), 'checked' => 1), + 'i.fk_product_type' => array('label' => $langs->trans("Type"), 'checked' => 0, 'enabled' => (isModEnabled("product") && isModEnabled("service"))), ); /* @@ -360,7 +360,7 @@ $param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), //'builddoc'=>$langs->trans("PDFMerge"), //'presend'=>$langs->trans("SendByMail"), ); @@ -415,6 +415,9 @@ if ($search_all) { $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +if (!isset($moreforfilter)) { + $moreforfilter = ''; +} if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { @@ -470,7 +473,7 @@ if (!empty($arrayfields['customerorsupplier']['checked'])) { if (!empty($arrayfields['i.fk_product_type']['checked'])) { print ''; - $array = array('-1'=>' ', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service')); + $array = array('-1' => ' ', '0' => $langs->trans('Product'), '1' => $langs->trans('Service')); print $form->selectarray('search_type', $array, $search_type); print ''; } @@ -480,7 +483,7 @@ if (!empty($arrayfields['i.fk_product_type']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; */ // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -532,7 +535,7 @@ if (!empty($arrayfields['i.fk_product_type']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; */ // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['i.datec']['checked'])) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f20f46f5c03..ed6431ff1d6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1666,7 +1666,7 @@ LDAPDescUsers=This page allows you to define LDAP attributes name in LDAP tree f LDAPDescGroups=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr groups. LDAPDescMembers=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members module. LDAPDescMembersTypes=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members types. -LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use thoose values and OpenLDAP, modify your LDAP config file slapd.conf to have all thoose schemas loaded. +LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use those values and OpenLDAP, modify your LDAP config file slapd.conf to have all those schemas loaded. ForANonAnonymousAccess=For an authenticated access (for a write access for example) PerfDolibarr=Performance setup/optimizing report YouMayFindPerfAdviceHere=This page provides some checks or advice related to performance. @@ -2452,3 +2452,4 @@ VideoGeneration=Video generation AudioText=Audio - Text AIPromptForFeatures=AI custom prompts for features EnterAnIP=Enter an IP address +ConvertInto=Convert into diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 9d3b5c5fb08..e0e26dc460b 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -27,6 +27,7 @@ EventOrganizationMenuLeft = Organized events EventOrganizationConferenceOrBoothMenuLeft = Conference Or Booth PaymentEvent=Payment of event +EventFee=Event fee # # Admin page diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index d2e29b3941a..da25fc5a5f9 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -191,3 +191,5 @@ helpWithAi=Generate message from AI YouCanMakeSomeInstructionForEmail=You can make some instructions for your Email (Example: generate image in email template...) ModelTemplate=Email template YouCanChooseAModelForYouMailContent= You can choose one of template models or generate one with AI +TitleOfMailHolder=Title of the e-mail goes here +ContentOfMailHolder=Content of email goes here... diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php index db9cb264f7b..32a980784e1 100644 --- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php +++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php @@ -65,7 +65,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (!isModEnabled('mymodule')) { return 0; // If module is not enabled, we do nothing @@ -139,7 +139,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'ORDER_DELETE': //case 'ORDER_CANCEL': //case 'ORDER_SENTBYMAIL': - //case 'ORDER_CLASSIFY_BILLED': + //case 'ORDER_CLASSIFY_BILLED': // TODO Replace it with ORDER_BILLED + //case 'ORDER_CLASSIFY_UNBILLED': // TODO Replace it with ORDER_UNBILLED //case 'ORDER_SETDRAFT': //case 'LINEORDER_INSERT': //case 'LINEORDER_UPDATE': @@ -151,6 +152,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'ORDER_SUPPLIER_VALIDATE': //case 'ORDER_SUPPLIER_DELETE': //case 'ORDER_SUPPLIER_APPROVE': + //case 'ORDER_SUPPLIER_CLASSIFY_BILLED': // TODO Replace with ORDER_SUPPLIER_BILLED + //case 'ORDER_SUPPLIER_CLASSIFY_UNBILLED': // TODO Replace with ORDER_SUPPLIER_UNBILLED //case 'ORDER_SUPPLIER_REFUSE': //case 'ORDER_SUPPLIER_CANCEL': //case 'ORDER_SUPPLIER_SENTBYMAIL': @@ -165,6 +168,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'PROPAL_MODIFY': //case 'PROPAL_VALIDATE': //case 'PROPAL_SENTBYMAIL': + //case 'PROPAL_CLASSIFY_BILLED': // TODO Replace it with PROPAL_BILLED + //case 'PROPAL_CLASSIFY_UNBILLED': // TODO Replace it with PROPAL_UNBILLED //case 'PROPAL_CLOSE_SIGNED': //case 'PROPAL_CLOSE_REFUSED': //case 'PROPAL_DELETE': @@ -240,6 +245,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'FICHINTER_CREATE': //case 'FICHINTER_MODIFY': //case 'FICHINTER_VALIDATE': + //case 'FICHINTER_CLASSIFY_BILLED': // TODO Replace it with FICHINTER_BILLED + //case 'FICHINTER_CLASSIFY_UNBILLED': // TODO Replace it with FICHINTER_UNBILLED //case 'FICHINTER_DELETE': //case 'LINEFICHINTER_CREATE': //case 'LINEFICHINTER_UPDATE': diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index 3eca1f0e68f..ff15655c5ff 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -38,6 +38,7 @@ $_SESSION["formatsondage"] = "D"; $erreur = false; $erreurNbchoice = 0; +$choixdate = ''; /* * Actions @@ -178,7 +179,7 @@ if (GETPOST('confirmation')) { // Add survey into database if (!$erreur && $erreurNb == 0) { - $_SESSION["toutchoix"] = substr("$choixdate", 1); + $_SESSION["toutchoix"] = substr($choixdate, 1); unset($_SESSION["nbrecaseshoraires"]); ajouter_sondage(); diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 327b8e7988e..ccbda2e2e62 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -862,6 +862,7 @@ $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); +$textlate = ''; while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); if (empty($obj)) { diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 3d6db67046d..3eb22bceb3a 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -510,6 +510,8 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // TODO Use default language of $thirdparty->default_lang to build $outputlang + $outputlangs->loadLangs(array("eventorganization")); + // Get product to use for invoice $productforinvoicerow = new Product($db); $productforinvoicerow->id = 0; @@ -629,7 +631,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "eventorganization")); // Get email content from template $arraydefaultmessage = null; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index f5950f629d7..f66f83bb61b 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1434,7 +1434,9 @@ if ($ispaymentok) { $listofmimes = array(dol_mimetype($file)); } - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml); + $trackid = 'inv'.$object->id; + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -1636,8 +1638,9 @@ if ($ispaymentok) { $urlback = $_SERVER["REQUEST_URI"]; $ishtml = dol_textishtml($texttosend); // May contain urls + $trackid = 'inv'.$invoice->id; - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -1855,10 +1858,7 @@ if ($ispaymentok) { print $conf->global->$key; } - $sendemail = ''; - if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { - $sendemail = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL'); - } + $sendemail = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL'); $tmptag = dolExplodeIntoArray($fulltag, '.', '='); @@ -1938,9 +1938,10 @@ if ($ispaymentok) { $ishtml = dol_textishtml($content); // May contain urls + $trackid = ''; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -2019,9 +2020,10 @@ if ($ispaymentok) { $ishtml = dol_textishtml($content); // May contain urls + $trackid = ''; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 7d5df469aac..60c91239254 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -59,6 +59,7 @@ $langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox // Security check // No check on module enabled. Done later according to $validpaymentmethod +$errmsg = ''; $action = GETPOST('action', 'aZ09'); $id = GETPOSTINT('id'); $securekeyreceived = GETPOST("securekey", 'alpha'); diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index c436a2ead90..90b56165cc2 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -66,6 +66,7 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", // Security check // No check on module enabled. Done later according to $validpaymentmethod +$errmsg = ''; $action = GETPOST('action', 'aZ09'); $id = GETPOST('id'); $securekeyreceived = GETPOST("securekey"); @@ -172,7 +173,7 @@ if (strlen($idvote)) { // Has not already voted $conforbooth = new ActionComm($db); $resultconforbooth = $conforbooth->fetch($idvote); - if ($resultconforbooth<=0) { + if ($resultconforbooth <= 0) { $error++; $errmsg .= $conforbooth->error; } else { @@ -188,11 +189,11 @@ if (strlen($idvote)) { } } } - if ($votestatus=="ok") { + if ($votestatus == "ok") { setEventMessage($langs->trans("VoteOk"), 'mesgs'); - } elseif ($votestatus=="ko") { + } elseif ($votestatus == "ko") { setEventMessage($langs->trans("AlreadyVoted"), 'warnings'); - } elseif ($votestatus=="err") { + } elseif ($votestatus == "err") { setEventMessage($langs->trans("VoteError"), 'warnings'); } header("Refresh:0;url=".dol_buildpath('/public/project/viewandvote.php?id='.$id.'&securekey=', 1).$securekeyreceived); diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 71639adc51b..838052dac5b 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -68,27 +68,27 @@ if (empty($usedolheader)) { use_javascript_ajax)) { include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } @@ -201,10 +204,10 @@ if ($filtert) { if ($socid) { $nav .= ''; } -if ($showbirthday) { +if (isset($showbirthday) && $showbirthday) { $nav .= ''; } -if ($pid) { +if (isset($pid) && $pid) { $nav .= ''; } if ($type) { @@ -213,7 +216,7 @@ if ($type) { if ($usergroup) { $nav .= ''; } -$nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0); +$nav .= $form->selectDate($dateselect ?? '', 'dateselect', 0, 0, 1, '', 1, 0); $nav .= ' '; $nav .= ''; @@ -222,25 +225,25 @@ print_barre_liste('Title of my list', 12, $_SERVER["PHP_SELF"], '', '', '', 'Tex $moreforfilter .= '
'; $moreforfilter .= $langs->trans('This is a select list for a filter A (no combo forced)').': '; -$cate_arbo = array('field1'=>'value1a into the select list A', 'field2'=>'value2a'); +$cate_arbo = array('field1' => 'value1a into the select list A', 'field2' => 'value2a'); $moreforfilter .= $form->selectarray('search_aaa', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', 0); // List with no js combo $moreforfilter .= '
'; $moreforfilter .= '
'; $moreforfilter .= $langs->trans('This is a select list for a filter B (auto combo)').': '; -$cate_arbo = array('field1'=>'value1b into the select list B', 'field2'=>'value2b'); +$cate_arbo = array('field1' => 'value1b into the select list B', 'field2' => 'value2b'); $moreforfilter .= $form->selectarray('search_bbb', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', -1); // List with js combo auto $moreforfilter .= '
'; $moreforfilter .= '
'; $moreforfilter .= $langs->trans('This is a select list for a filter C (combo forced)').': '; -$cate_arbo = array('field1'=>'value1c into the select list C', 'field2'=>'value2c'); +$cate_arbo = array('field1' => 'value1c into the select list C', 'field2' => 'value2c'); $moreforfilter .= $form->selectarray('search_ccc', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', 1); // List with js combo forced $moreforfilter .= '
'; $moreforfilter .= '
'; $moreforfilter .= $langs->trans('This is a select list for a filter D (combo forced)').': '; -$cate_arbo = array('field1'=>'value1d into the select list D', 'field2'=>'value2d'); +$cate_arbo = array('field1' => 'value1d into the select list D', 'field2' => 'value2d'); $moreforfilter .= $form->selectarray('search_ddd', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', 1); // List with js combo forced $moreforfilter .= '
'; @@ -328,7 +331,7 @@ $(document).ready(function(){ use_javascript_ajax)) { include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index f6242c6ee14..20b9262923f 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -75,7 +75,7 @@ $search_date_create_endmonth = GETPOSTINT('search_date_create_endmonth'); $search_date_create_endyear = GETPOSTINT('search_date_create_endyear'); $search_date_create_start = dol_mktime(0, 0, 0, $search_date_create_startmonth, $search_date_create_startday, $search_date_create_startyear); // Use tzserver $search_date_create_end = dol_mktime(23, 59, 59, $search_date_create_endmonth, $search_date_create_endday, $search_date_create_endyear); -$search_billed = GETPOSTINT("search_billed"); +$search_billed = GETPOST("search_billed", 'intcomma'); $search_status = GETPOST('search_status', 'intcomma'); $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 6e5b19c857e..5f3165ed14b 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -264,6 +264,7 @@ if ($action == 'create') { print "\n"; $total = 0; + $total_ttc = 0.; $totalrecu = 0; while ($i < $num) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 52921b28c80..3cc208d270d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -142,9 +142,7 @@ if ($socid > 0) { } if (!($object->id > 0) && $action == 'view') { - $langs->load("errors"); - print($langs->trans('ErrorRecordNotFound')); - exit; + recordNotFound(); } // Get object canvas (By default, this is not defined, so standard usage of dolibarr) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index a1d1f03cb54..f9d7e96cb4f 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -567,6 +567,7 @@ if (empty($reshook)) { echo ""; if ($nbofsuggested > 0) { + $quantityToBeDelivered = 0; echo "
".$langs->trans("SearchIntoBatch").": $nbofsuggested

"; foreach ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch as $dbatch) { // $dbatch is instance of Productbatch $batchStock = + $dbatch->qty; // To get a numeric @@ -1604,6 +1605,7 @@ if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categorie = new Categorie($db); $categories = $categorie->get_full_arbo('product'); + $htmlforlines = ''; foreach ($categories as $row) { if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { $htmlforlines .= '
textwithpicto(''.$langs->trans("TicketMessageSubstitutionReplacedByGenericValues").'', $help, 1, 'helpclickable', '', 0, 3, 'helpsubstitution'); print '
'; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 2b622531dac..d64888743cb 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -683,7 +683,7 @@ if ($action == 'adddir' && $permtouploadfile) } */ -// Add site +// Add a website if ($action == 'addsite' && $usercanedit) { $db->begin();