From a254462bc9e360b047c2d3b44f510cdc207f64ac Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 2 Feb 2023 17:58:54 +0100 Subject: [PATCH 01/50] FIX : Sub-BOM's services prices were not good --- htdocs/bom/tpl/objectline_view.tpl.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index ac277f6e880..6208abcbf6d 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -172,7 +172,8 @@ print ''; $coldisplay++; if (!empty($line->fk_bom_child)) { echo ''.price($tmpbom->total_cost * $line->qty).''; -} else { +} +else { echo ''.price($line->total_cost).''; } print ''; @@ -301,6 +302,16 @@ if ($resql) { $sub_bom->calculateCosts(); print ''.price(price2num($sub_bom->total_cost * $sub_bom_line->qty * $line->qty, 'MT')).''; $total_cost+= $sub_bom->total_cost * $sub_bom_line->qty * $line->qty; + } elseif($sub_bom_product->type == Product::TYPE_SERVICE && isModEnabled('workstation') && !empty($sub_bom_product->fk_default_workstation)) { + //Convert qty to hour + $unit = measuringUnitString($sub_bom_line->fk_unit, '', '', 1); + $qty = convertDurationtoHour($sub_bom_line->qty, $unit); + $workstation = new Workstation($this->db); + $res = $workstation->fetch($sub_bom_product->fk_default_workstation); + if ($res > 0) $sub_bom_line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); + + print ''.price(price2num($sub_bom_line->total_cost, 'MT')).''; + $this->total_cost += $line->total_cost; } elseif ($sub_bom_product->cost_price > 0) { print ''.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).''; $total_cost+= $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty; From a07916858f7740dd6260ec2242fb15839bdf4ad7 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 2 Feb 2023 21:36:41 +0100 Subject: [PATCH 02/50] fix whitepage if modCategorie is not enabled --- htdocs/projet/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 32192114a4c..1113cf06b9e 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -152,7 +152,9 @@ $search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int'); $search_date_end_endyear = GETPOST('search_date_end_endyear', 'int'); $search_date_end_endday = GETPOST('search_date_end_endday', 'int'); $search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver -$search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); +if (isModEnabled('categorie')) { + $search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); +} if ($search_status == '') { $search_status = -1; // -1 or 1 From 38eee02272cbe06ada74cfb7b2d56f6cb7024db1 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 8 Feb 2023 17:34:50 +0100 Subject: [PATCH 03/50] FIX : Make bom_net_needs list standard --- htdocs/bom/bom_net_needs.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index 60736d085da..f6644590a2e 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -218,6 +218,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1).''; print ''.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).''; print ''; + + print ''; + print ''; if (!empty($TChildBom)) { if ($action == 'treeview') { foreach ($TChildBom as $fk_bom => $TProduct) { @@ -266,7 +269,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } } - print ''; + print ''; print ''; From e5de31a7dea24c89164a6e870a400d77dd758737 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Feb 2023 18:23:19 +0100 Subject: [PATCH 04/50] Fix size of ref --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 2a1a9ee2fd5..744c000294b 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -393,3 +393,6 @@ ALTER TABLE llx_opensurvey_user_studs ADD COLUMN date_creation datetime NULL; ALTER TABLE llx_opensurvey_comments ADD COLUMN date_creation datetime NULL; ALTER TABLE llx_c_tva ADD COLUMN use_default tinyint DEFAULT 0; + +ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN ref varchar(128); +ALTER TABLE llx_facture_fourn_det MODIFY COLUMN ref varchar(128); From e9ce09f9d1a987e812c29198033a0f369c37743b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Feb 2023 18:50:22 +0100 Subject: [PATCH 05/50] Doc --- htdocs/core/lib/functions.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3a51575ef57..9311adb11ef 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -411,6 +411,9 @@ function dol_shutdown() /** * Return true if we are in a context of submitting the parameter $paramname from a POST of a form. + * Warning: + * For action=add, use: $var = GETPOST('var'); // No GETPOSTISSET, so GETPOST always called and default value is retreived if not a form POST, and value of form is retreived if it is a form POST. + * For action=update, use: $var = GETPOSTISSET('var') ? GETPOST('var') : $object->var; * * @param string $paramname Name or parameter to test * @return boolean True if we have just submit a POST or GET request with the parameter provided (even if param is empty) From c28f0d9386e1693c51c9ea2059765bc4bef2313a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Feb 2023 19:24:16 +0100 Subject: [PATCH 06/50] FIX #23860 --- htdocs/compta/facture/card.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 80d3ed2b436..3aa43556e43 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3119,7 +3119,11 @@ if ($action == 'create') { } // when bank account is empty (means not override by payment mode form a other object, like third-party), try to use default value - $fk_account = GETPOSTISSET("fk_account") ? GETPOST("fk_account", 'int') : $fk_account; + if ($socid > 0 && $fk_account) { // A company has already been set and it has a default fk_account + $fk_account = GETPOSTISSET('fk_account') ? GETPOST("fk_account", 'int') : $fk_account; // The GETPOST is used only if form was posted to avoid to take default value, because in such case, the default must be the one of the company + } else { // No company forced + $fk_account = GETPOST("fk_account", 'int'); + } if (!empty($soc->id)) { $absolute_discount = $soc->getAvailableDiscounts(); From 081ede08ec540694ad407edafb402bd068388d33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Feb 2023 19:24:42 +0100 Subject: [PATCH 07/50] Fix label --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 01a72c6c7f3..cbc0a3d5975 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -235,7 +235,7 @@ class Societe extends CommonObject 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270), 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>440), 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>445), - 'fk_account' =>array('type'=>'integer', 'label'=>'AccountingAccount', 'enabled'=>1, 'visible'=>-1, 'position'=>450), + 'fk_account' =>array('type'=>'integer', 'label'=>'PaymentBankAccount', 'enabled'=>1, 'visible'=>-1, 'position'=>450), 'fk_warehouse' =>array('type'=>'integer', 'label'=>'Warehouse', 'enabled'=>1, 'visible'=>-1, 'position'=>455), 'logo' =>array('type'=>'varchar(255)', 'label'=>'Logo', 'enabled'=>1, 'visible'=>-1, 'position'=>400), 'logo_squarred' =>array('type'=>'varchar(255)', 'label'=>'Logo squarred', 'enabled'=>1, 'visible'=>-1, 'position'=>401), From 5ef4aa78e9f7a29d0a7bfbcbb01b067a094995f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Feb 2023 23:16:34 +0100 Subject: [PATCH 08/50] Fix filter using != --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9311adb11ef..bb69fd4966d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9768,7 +9768,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) $value = preg_replace('/\*/', '%', $value); // Replace * with % } if ($mode == 1) { - $value = preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"), '/').'\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do + $value = preg_replace('/([!<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"), '/').'\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do } $value = preg_replace('/\s*\|\s*/', '|', $value); @@ -9788,10 +9788,10 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) foreach ($fields as $field) { if ($mode == 1) { $operator = '='; - $newcrit = preg_replace('/([<>=]+)/', '', $crit); + $newcrit = preg_replace('/([!<>=]+)/', '', $crit); $reg = array(); - preg_match('/([<>=]+)/', $crit, $reg); + preg_match('/([!<>=]+)/', $crit, $reg); if (!empty($reg[1])) { $operator = $reg[1]; } From 65982c16753840aa88837ba2550e16e77f1b8ca7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Feb 2023 23:17:18 +0100 Subject: [PATCH 09/50] css --- htdocs/admin/emailcollector_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 10e7ea300f8..d140dd39ce2 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -723,7 +723,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Add operation print ''; print ''; - print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300', 1); + print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'minwidth150 maxwidth300', 1); print ''; //print ''; $htmltext = $langs->transnoentitiesnoconv("OperationParamDesc"); From 616b006f2a053d2a589990adb0c0c3f15a353518 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 10 Feb 2023 10:56:55 +0100 Subject: [PATCH 10/50] fix : Warning: Undefined property: stdClass:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/modules/facture/mod_facture_mercure.php on line 80 --- htdocs/core/modules/facture/mod_facture_mercure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 321741ea8a0..1e96c32129a 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -77,7 +77,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Setting the prefix $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; From 3e7879c88671c24d5733c742cefdd8b80b13dac3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 11:00:07 +0100 Subject: [PATCH 11/50] Debug v17 --- htdocs/projet/card.php | 3 ++- htdocs/projet/class/project.class.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 501cdcc5f4b..00b0c11deaf 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1060,7 +1060,8 @@ if ($action == 'create' && $user->rights->projet->creer) { if (!empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) { $filteronlist = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; } - $text = $form->select_company($object->thirdparty->id, 'socid', $filteronlist, 'None', 1, 0, array(), 0, 'minwidth300'); + $text = img_picto('', 'company', 'class="pictofixedwidth"'); + $text .= $form->select_company($object->thirdparty->id, 'socid', $filteronlist, 'None', 1, 0, array(), 0, 'minwidth300'); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) { $texthelp = $langs->trans("IfNeedToUseOtherObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index c8d3be0163d..0d6df2ddc98 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -293,8 +293,8 @@ class Project extends CommonObject 'usage_task' =>array('type'=>'integer', 'label'=>'UsageTasks', 'enabled'=>1, 'visible'=>-1, 'position'=>140), 'usage_organize_event' =>array('type'=>'integer', 'label'=>'UsageOrganizeEvent', 'enabled'=>1, 'visible'=>-1, 'position'=>145), // Properties for event organization - 'date_start_event' =>array('type'=>'date', 'label'=>'DateStartEvent', 'enabled'=>1, 'visible'=>1, 'position'=>200), - 'date_end_event' =>array('type'=>'date', 'label'=>'DateEndEvent', 'enabled'=>1, 'visible'=>1, 'position'=>201), + 'date_start_event' =>array('type'=>'date', 'label'=>'DateStartEvent', 'enabled'=>"isModEnabled('eventorganization')", 'visible'=>1, 'position'=>200), + 'date_end_event' =>array('type'=>'date', 'label'=>'DateEndEvent', 'enabled'=>"isModEnabled('eventorganization')", 'visible'=>1, 'position'=>201), 'location' =>array('type'=>'text', 'label'=>'Location', 'enabled'=>1, 'visible'=>3, 'position'=>55, 'searchall'=>202), 'accept_conference_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestConf', 'enabled'=>1, 'visible'=>-1, 'position'=>210), 'accept_booth_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>211), From b52de45f73926958a7f7eecd978b7bed868c1b19 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 10 Feb 2023 11:01:09 +0100 Subject: [PATCH 12/50] fix : Warning: Undefined property: stdClass:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/modules/facture/mod_facture_mercure.php on line 88 --- htdocs/core/modules/facture/mod_facture_mercure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 1e96c32129a..890d56e874b 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -85,7 +85,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Prefix setting of replacement invoices $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; // Prefix setting of credit note From f1c929abd0f28aaaeaf3d6d466e5f179832053bc Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 10 Feb 2023 11:03:31 +0100 Subject: [PATCH 13/50] fix : Warning: Undefined property: stdClass:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/modules/facture/mod_facture_mercure.php on line 93 --- htdocs/core/modules/facture/mod_facture_mercure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 890d56e874b..65594470c30 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -90,7 +90,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Prefix setting of credit note $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; // Prefix setting of deposit From 4a826d47e93d30a0ec9e0308876169b410cbbbe5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 10 Feb 2023 11:17:02 +0100 Subject: [PATCH 14/50] fix : Warning: Undefined property: stdClass:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/modules/facture/mod_facture_mercure.php on line 98 --- htdocs/core/modules/facture/mod_facture_mercure.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 65594470c30..e624487c9cf 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -77,7 +77,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Setting the prefix $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -85,7 +85,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Prefix setting of replacement invoices $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; // Prefix setting of credit note From 2e0b7fe4e8da235d76bd64156a83a3029920cc9d Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 10 Feb 2023 10:21:39 +0000 Subject: [PATCH 15/50] Fixing style errors. --- htdocs/core/modules/facture/mod_facture_mercure.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index e624487c9cf..4185a8a08b6 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -77,7 +77,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Setting the prefix $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -85,7 +85,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Prefix setting of replacement invoices $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; // Prefix setting of credit note From 5acefe2e72162f52d95fe2dfc309daa02e16f949 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 10 Feb 2023 11:33:34 +0100 Subject: [PATCH 16/50] cleaning my previous --- htdocs/core/modules/facture/mod_facture_mercure.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index e624487c9cf..1f516fa08f6 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -77,7 +77,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Setting the prefix $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -85,17 +85,17 @@ class mod_facture_mercure extends ModeleNumRefFactures // Prefix setting of replacement invoices $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; // Prefix setting of credit note $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; // Prefix setting of deposit $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; $texte .= ''; From fa856424a4f5a50486ffca16dcc7fcc7decca3aa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 10 Feb 2023 11:43:01 +0100 Subject: [PATCH 17/50] fix : Warning: Undefined property: Facture:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/modules/facture/doc/pdf_sponge.modules.php on line 1620 --- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 5edfc3f6157..1d106f6f024 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1617,7 +1617,7 @@ class pdf_sponge extends ModelePDFFactures // Get Total HT - $total_ht = (isModEnabled("multicurrency") && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); // Total remise $total_line_remise = 0; From 02475369e638333dfecad09b58e5f84ab7e314a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 12:58:49 +0100 Subject: [PATCH 18/50] Fix bad link --- htdocs/projet/agenda.php | 2 +- htdocs/projet/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/agenda.php b/htdocs/projet/agenda.php index a3c120d0a23..071e9eb2e9a 100644 --- a/htdocs/projet/agenda.php +++ b/htdocs/projet/agenda.php @@ -180,7 +180,7 @@ if (!empty($object->id)) { $morehtmlcenter .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); // Show link to change view in agenda - $messagingUrl = DOL_URL_ROOT.'/projet/info.php?id='.$object->id; + $messagingUrl = DOL_URL_ROOT.'/projet/agenda.php?id='.$object->id; $morehtmlcenter .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 00b0c11deaf..e954f429781 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1614,7 +1614,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/projet/info.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/projet/messaging.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; From d37c5ed6b1936f02179c3fd6bdee474179bedbc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 14:16:30 +0100 Subject: [PATCH 19/50] Debug v17 --- htdocs/admin/mails_templates.php | 31 +++++++++++++++---------------- htdocs/core/lib/functions.lib.php | 8 ++++---- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/btn.inc.php | 9 ++++++--- htdocs/theme/md/style.css.php | 5 +---- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index e462b7854ac..25a1ba101ad 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -675,17 +675,27 @@ if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu } -// Confirmation de la suppression de la ligne +// Confirm deletion of record if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$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).'&code='.urlencode($code).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } - - $fieldlist = explode(',', $tabfield[$id]); if ($action == 'create') { + // If data was already input, we define them in obj to populate input fields. + $obj = new stdClass(); + $obj->label = GETPOST('label'); + $obj->lang = GETPOST('lang'); + $obj->type_template = GETPOST('type_template'); + $obj->fk_user = GETPOST('fk_user', 'int'); + $obj->private = GETPOST('private', 'int'); + $obj->position = GETPOST('position'); + $obj->topic = GETPOST('topic'); + $obj->joinfiles = GETPOST('joinfiles'); + $obj->content = GETPOST('content', 'restricthtml'); + // Form to add a new line print '
'; print ''; @@ -761,16 +771,6 @@ if ($action == 'create') { print ''; print ''; - $obj = new stdClass(); - // If data was already input, we define them in obj to populate input fields. - if (GETPOST('actionadd')) { - foreach ($fieldlist as $key => $val) { - if (GETPOST($val) != '') { - $obj->$val = GETPOST($val); - } - } - } - $tmpaction = 'create'; $parameters = array( 'fieldlist' => $fieldlist, @@ -828,7 +828,6 @@ if ($action == 'create') { if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { $okforextended = false; } - $doleditor = new DolEditor($tmpfieldlist, (!empty($obj->$tmpfieldlist) ? $obj->$tmpfieldlist : ''), '', 180, 'dolibarr_mailings', 'In', false, $acceptlocallinktomedia, $okforextended, ROWS_4, '90%'); print $doleditor->Create(1); } @@ -848,7 +847,7 @@ if ($action == 'create') { print ''; print '
'; print '

'; -} // END IF not edit +} // List of available record in database dol_syslog("htdocs/admin/dict", LOG_DEBUG); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bb69fd4966d..37949215357 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5371,10 +5371,10 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict $return .= '
'.$titre.'
'; $return .= ''; if (dol_strlen($morehtmlcenter)) { - $return .= ''.$morehtmlcenter.''; + $return .= ''.$morehtmlcenter.''; } if (dol_strlen($morehtmlright)) { - $return .= ''.$morehtmlright.''; + $return .= ''.$morehtmlright.''; } $return .= ''."\n"; @@ -5446,11 +5446,11 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', // Center if ($morehtmlcenter) { - print ''.$morehtmlcenter.''; + print ''.$morehtmlcenter.''; } // Right - print ''; + print ''; print ''; if ($sortfield) { $options .= "&sortfield=".urlencode($sortfield); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 10617a51d72..8f7d4b1ef1e 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4879,7 +4879,7 @@ div.titre { color: var(--colortexttitlenotab2); } -table.table-fiche-title .col-title div.titre{ +table.table-fiche-title .col-title div.titre, .col-right .btnTitle-icon { line-height: 40px; } table.table-fiche-title { diff --git a/htdocs/theme/md/btn.inc.php b/htdocs/theme/md/btn.inc.php index 5ccd2e100dd..fdd9668c7d3 100644 --- a/htdocs/theme/md/btn.inc.php +++ b/htdocs/theme/md/btn.inc.php @@ -342,8 +342,8 @@ a.btnTitle.btnTitleSelected { position: relative; margin: 0 0 0 10px; text-align: center; - color: #ffffff; - background-color: rgb(); + color: #000; + background-color: #eee; font-size: 12px; text-decoration: none; box-shadow: none; @@ -373,7 +373,10 @@ div.pagination .btnTitle:hover .btnTitle-label{ } .paginationafterarrows a.btnTitlePlus, .titre_right a.btnTitlePlus { - border: 1px solid var(--colorbackbody); + border: 1px solid var(--btncolorborder); +} +.paginationafterarrows a.btnTitlePlus:hover, .titre_right a.btnTitlePlus:hover { + border-color: #ddd; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 780059e3a8f..47a35f8d0bf 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4168,9 +4168,6 @@ table.hidepaginationprevious .paginationprevious { table.hidepaginationnext .paginationnext { display: none; } -.paginationafterarrows a.btnTitlePlus { - border: 1px solid var(--btncolorborder); -} .paginationafterarrows a.btnTitlePlus:hover span:before { /* text-shadow: 0px 0px 5px #ccc; */ /* filter: invert(0.3); */ @@ -4906,7 +4903,7 @@ div.titre { table.centpercent.notopnoleftnoright.table-fiche-title { margin-bottom: 10px !important; } -table.table-fiche-title .col-title div.titre{ +table.table-fiche-title .col-title div.titre, .col-right .btnTitle-icon { line-height: 40px; } From c3a7cf57fcba3e4eafd3f6d1d51d47f93fcc9e14 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 14:47:39 +0100 Subject: [PATCH 20/50] Debug v17 --- htdocs/theme/md/style.css.php | 32 ++++++++++++++---------------- htdocs/theme/md/theme_vars.inc.php | 4 ++-- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 47a35f8d0bf..6d56e452898 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1803,14 +1803,13 @@ tr.nobottom td { /* ============================================================================== */ /* Styles to hide objects */ /* ============================================================================== */ - .clearboth { clear:both; } .hideobject { display: none; } .minwidth25 { min-width: 25px; } .minwidth50 { min-width: 50px; } .minwidth75 { min-width: 75px; } /* rule for not too small screen only */ -@media only screen and (min-width: px) +@media only screen and (min-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) { .width20 { width: 20px; } .width25 { width: 25px; } @@ -3192,7 +3191,7 @@ a.aversion { .alogin, .alogin:hover { color: #888 !important; font-weight: normal !important; - font-size: px !important; + font-size: !important; } .alogin:hover, .atoplogin:hover { text-decoration:underline !important; @@ -3282,16 +3281,16 @@ div.vmenu, td.vmenu { .searchform .bordertransp { border: 0; } a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu, span.vsmenu { - white-space: nowrap; font-size:px; font-family: ; text-align: ; font-weight: bold; + white-space: nowrap; font-size:; font-family: ; text-align: ; font-weight: bold; } -span.vmenudisabled, font.vmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: bold; color: #aaa; margin-left: 4px; white-space: nowrap; } +span.vmenudisabled, font.vmenudisabled { font-size:; font-family: ; text-align: ; font-weight: bold; color: #aaa; margin-left: 4px; white-space: nowrap; } a.vmenu:link, a.vmenu:visited { color: var(--colortextbackvmenu); } -a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; } +a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; } span.vsmenudisabled:not(.spanlilevel0), font.vsmenudisabled:not(.spanlilevel0) { - font-size:px; + font-size:; } span.vsmenudisabled, font.vsmenudisabled { font-family: ; @@ -5002,7 +5001,7 @@ div#card-errors { .ui-dialog-titlebar { } .ui-dialog-content { - font-size: px !important; + font-size: !important; } .ui-dialog.ui-corner-all.ui-widget.ui-widget-content.ui-front.ui-draggable { z-index: 1002 !important; /* Default 101 with ui-jquery, top menu have a z-index of 1000 */ @@ -7466,13 +7465,12 @@ div.clipboardCPValue.hidewithsize { width: px; } -/* nboftopmenuentries = , fontsize= */ -/* disableimages = */ -/* rule to reduce top menu - 1st reduction */ -@media only screen and (max-width: px) +/* nboftopmenuentries = , fontsize= */ +/* rule to reduce top menu - 1st reduction: Reduce width of top menu icons */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1) ? round($nbtopmenuentries * 90, 0) + 340 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1; ?>px) /* reduction 1 */ { div.tmenucenter { - max-width: px; /* size of viewport */ + max-width: 56px; /* size of viewport */ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -7496,16 +7494,16 @@ div.clipboardCPValue.hidewithsize { display: none; } } -/* rule to reduce top menu - 2nd reduction */ -@media only screen and (max-width: px) +/* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ { li.tmenucompanylogo { display: none; } div.tmenucenter { - max-width: px; /* size of viewport */ - text-overflow: clip; + max-width: 24px; /* size of viewport */ + text-overflow: clip; } .mainmenuaspan { font-size: 10px; diff --git a/htdocs/theme/md/theme_vars.inc.php b/htdocs/theme/md/theme_vars.inc.php index 5f26d0d83bd..84a1065f781 100644 --- a/htdocs/theme/md/theme_vars.inc.php +++ b/htdocs/theme/md/theme_vars.inc.php @@ -64,8 +64,8 @@ $colortexttitle = '20,20,20'; $colortexttitlelink = '0,0,120'; $colortext = '0,0,0'; $colortextlink = '0,0,120'; -$fontsize = '14'; -$fontsizesmaller = '11'; +$fontsize = '0.94em'; +$fontsizesmaller = '0.75em'; $topMenuFontSize = '1.1em'; $toolTipBgColor = 'rgba(255, 255, 255, 0.96)'; $toolTipFontColor = '#333'; From 218d7cf148804d4dc0a3a86fb9007560a5819250 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 10 Feb 2023 13:47:46 +0000 Subject: [PATCH 21/50] Fixing style errors. --- htdocs/bom/tpl/objectline_view.tpl.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 6208abcbf6d..95bbed79784 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -172,8 +172,7 @@ print ''; $coldisplay++; if (!empty($line->fk_bom_child)) { echo ''.price($tmpbom->total_cost * $line->qty).''; -} -else { +} else { echo ''.price($line->total_cost).''; } print ''; @@ -302,7 +301,7 @@ if ($resql) { $sub_bom->calculateCosts(); print ''.price(price2num($sub_bom->total_cost * $sub_bom_line->qty * $line->qty, 'MT')).''; $total_cost+= $sub_bom->total_cost * $sub_bom_line->qty * $line->qty; - } elseif($sub_bom_product->type == Product::TYPE_SERVICE && isModEnabled('workstation') && !empty($sub_bom_product->fk_default_workstation)) { + } elseif ($sub_bom_product->type == Product::TYPE_SERVICE && isModEnabled('workstation') && !empty($sub_bom_product->fk_default_workstation)) { //Convert qty to hour $unit = measuringUnitString($sub_bom_line->fk_unit, '', '', 1); $qty = convertDurationtoHour($sub_bom_line->qty, $unit); From 49f093daefec960a3c4e632fcb557dd9a93441a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 14:57:27 +0100 Subject: [PATCH 22/50] css --- htdocs/theme/md/info-box.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index e2179b96162..9938225eebb 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -153,7 +153,7 @@ a.info-box-text-a i.fa.fa-exclamation-triangle { margin-bottom: 15px; border: 1px solid #e9e9e9; } -.info-box.info-box-sm{ +.info-box.info-box-sm { min-height: 80px; margin-bottom: 10px; } @@ -213,6 +213,10 @@ a.info-box-text-a i.fa.fa-exclamation-triangle { font-size: 25px; line-height: 92px; } +.info-box-module .info-box-icon { + padding-top: 4px; + padding-bottom: 4px; +} .opened-dash-board-wrap .info-box .info-box-icon { font-size: 2em; } From 0cc8b5d7f2e6acc146d9eb51dd2b05179260c1c0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 10 Feb 2023 15:02:11 +0100 Subject: [PATCH 23/50] fix : Warning: Undefined variable in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/class/html.formfile.class.php on line 924 --- htdocs/core/class/html.formfile.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index bc06d1517dc..ca058603ce1 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -920,6 +920,9 @@ class FormFile } if (is_object($hookmanager)) { + $addcolumforpicto = ($delallowed || $printer || $morepicto); + $colspan = (4 + ($addcolumforpicto ? 1 : 0)); + $colspanmore = 0; $parameters = array('colspan'=>($colspan + $colspanmore), 'socid'=>(isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id'=>(isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'modulepart'=>$modulepart, 'relativepath'=>$relativepath); $res = $hookmanager->executeHooks('formBuilddocLineOptions', $parameters, $file); if (empty($res)) { From 26ec131048fa28f3c690cdf48302279c1af04ee7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 10 Feb 2023 15:24:46 +0100 Subject: [PATCH 24/50] fix : Warning: Undefined property: stdClass:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/compta/facture/card-rec.php on line 122 --- htdocs/compta/facture/card-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index b2f3521111e..580b585c28f 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -119,7 +119,7 @@ $usercanreopen = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights $usercanunvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->unvalidate))); $usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)); -$usercancreatemargin = $user->rights->margins->creer; +$usercancreatemargin = $user->hasRight("margins", "creer"); $usercanreadallmargin = $user->rights->margins->liretous; $usercancreatewithdrarequest = $user->rights->prelevement->bons->creer; From 66015cb11d754a2404a9a426e44b6187d566e14a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 10 Feb 2023 15:30:34 +0100 Subject: [PATCH 25/50] fix : Warning: Undefined property: stdClass:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/compta/facture/card-rec.php on line 123 Warning: Attempt to read property liretous on null in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/compta/facture/card-rec.php on line 123 --- htdocs/compta/facture/card-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 580b585c28f..39763375fd2 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -120,7 +120,7 @@ $usercanunvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($ $usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)); $usercancreatemargin = $user->hasRight("margins", "creer"); -$usercanreadallmargin = $user->rights->margins->liretous; +$usercanreadallmargin = $user->hasRight("margins", "liretous"); $usercancreatewithdrarequest = $user->rights->prelevement->bons->creer; $now = dol_now(); From 457e6883e249938eee7ac1d0f1a4164a337fb5ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 15:34:47 +0100 Subject: [PATCH 26/50] Fix excessive hooks log --- htdocs/core/ajax/selectsearchbox.php | 1 - htdocs/core/class/hookmanager.class.php | 6 +++++- htdocs/main.inc.php | 14 +++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 38c363654d3..d2379f46966 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -58,7 +58,6 @@ if (!isset($usedbyinclude) || empty($usedbyinclude)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; -//global $hookmanager; $hookmanager->initHooks(array('searchform')); $search_boxvalue = GETPOST('q', 'restricthtml'); diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 191887e1725..c9c559fce41 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -127,6 +127,7 @@ class HookManager } } } + // Log the init of hook but only for hooks thare are declared to be managed if (count($arraytolog) > 0) { dol_syslog(get_class($this)."::initHooks Loading hooks: ".join(', ', $arraytolog), LOG_DEBUG); } @@ -275,7 +276,10 @@ class HookManager $actionclassinstance->error = 0; $actionclassinstance->errors = array(); - dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".get_class($actionclassinstance).'->'.$method.", context=".$context.", module=".$module.", action=".$action.((is_object($object) && property_exists($object, 'id')) ? ', object id='.$object->id : '').((is_object($object) && property_exists($object, 'element')) ? ', object element='.$object->element : ''), LOG_DEBUG); + if (getDolGlobalInt('MAIN_DEBUG_SHOW_EACH_QUALIFIED_HOOK_CALL') >= 2) { + // This his too much verbose, enabled in develop only + dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".get_class($actionclassinstance).'->'.$method.", context=".$context.", module=".$module.", action=".$action.((is_object($object) && property_exists($object, 'id')) ? ', object id='.$object->id : '').((is_object($object) && property_exists($object, 'element')) ? ', object element='.$object->element : ''), LOG_DEBUG); + } // Add current context to avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return; // Note: The hook can use the $currentcontext in its code to avoid to be ran twice or be ran for one given context only diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 37d018a21ce..f476c9bafed 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2870,14 +2870,9 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ if (empty($conf->dol_hide_leftmenu) && (!defined('NOREQUIREMENU') || !constant('NOREQUIREMENU'))) { // Instantiate hooks for external modules - $hookmanager->initHooks(array('searchform', 'leftblock')); + $hookmanager->initHooks(array('leftblock')); print "\n".''."\n".'
'."\n"; - - if ($conf->browser->layout == 'phone') { - $conf->global->MAIN_USE_OLD_SEARCH_FORM = 1; // Select into select2 is awfull on smartphone. TODO Is this still true with select2 v4 ? - } - print "\n"; if (!is_object($form)) { @@ -2885,9 +2880,14 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ } $selected = -1; if (empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) { + // Select into select2 is awfull on smartphone. TODO Is this still true with select2 v4 ? + if ($conf->browser->layout == 'phone') { + $conf->global->MAIN_USE_OLD_SEARCH_FORM = 1; + } + $usedbyinclude = 1; $arrayresult = null; - include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php'; // This set $arrayresult + include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php'; // This make initHooks('searchform') then set $arrayresult if ($conf->use_javascript_ajax && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) { $searchform .= $form->selectArrayFilter('searchselectcombo', $arrayresult, $selected, '', 1, 0, (empty($conf->global->MAIN_SEARCHBOX_CONTENT_LOADED_BEFORE_KEY) ? 1 : 0), 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1); From d183773ace1f036f1d128294e6c1ac3795031b05 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 10 Feb 2023 15:34:56 +0100 Subject: [PATCH 27/50] fix : Warning: Undefined property: stdClass:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/compta/facture/card-rec.php on line 124 --- htdocs/compta/facture/card-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 39763375fd2..96924f3bdd0 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -121,7 +121,7 @@ $usercanunvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($ $usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)); $usercancreatemargin = $user->hasRight("margins", "creer"); $usercanreadallmargin = $user->hasRight("margins", "liretous"); -$usercancreatewithdrarequest = $user->rights->prelevement->bons->creer; +$usercancreatewithdrarequest = $user->hasRight("prelevement", "bons","creer"); $now = dol_now(); From 1d9afa4808a64794970a9baaa52a06dc5ececc45 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 10 Feb 2023 14:45:03 +0000 Subject: [PATCH 28/50] Fixing style errors. --- htdocs/compta/facture/card-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 96924f3bdd0..06e9a762bca 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -121,7 +121,7 @@ $usercanunvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($ $usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)); $usercancreatemargin = $user->hasRight("margins", "creer"); $usercanreadallmargin = $user->hasRight("margins", "liretous"); -$usercancreatewithdrarequest = $user->hasRight("prelevement", "bons","creer"); +$usercancreatewithdrarequest = $user->hasRight("prelevement", "bons", "creer"); $now = dol_now(); From fb4077ef95de43de60990235a979c1c2d9fc2f58 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 10 Feb 2023 16:07:55 +0100 Subject: [PATCH 29/50] Remove double code --- htdocs/core/photos_resize.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index efbb3ba9c19..9bb974d75b3 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -453,7 +453,6 @@ if ($action == 'confirm_crop') { if ($result < 0) { setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); } - $result = $ecmfile->create($user); } if ($backtourl) { From 8299501800d27661caf468133979f14c91a27c8f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 16:14:32 +0100 Subject: [PATCH 30/50] Fix subrequest inside a loop --- htdocs/core/class/commonobject.class.php | 7 ++-- htdocs/projet/list.php | 49 ++++++++++++++++-------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b5bcbe3ef8f..38202a0938a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1354,12 +1354,13 @@ abstract class CommonObject * * @param int $statusoflink Status of links to get (-1=all). Not used. * @param string $source Source of contact: 'external' or 'thirdparty' (llx_socpeople) or 'internal' (llx_user) - * @param int $list 0:Return array contains all properties, 1:Return array contains just id + * @param int $list 0:Returned array contains all properties, 1:Return array contains just id * @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...) * @param int $status Status of user or company + * @param array $arrayoftcids Array with ID of type of contacts. If we provide this, we can make a ec.fk_c_type_contact in ($arrayoftcids) to avoid link on tc table. TODO Not implemented. * @return array|int Array of contacts, -1 if error */ - public function liste_contact($statusoflink = -1, $source = 'external', $list = 0, $code = '', $status = -1) + public function liste_contact($statusoflink = -1, $source = 'external', $list = 0, $code = '', $status = -1, $typecontectids = array()) { // phpcs:enable global $langs; @@ -1401,7 +1402,7 @@ abstract class CommonObject $sql .= " AND t.statut = ".((int) $status); // t is llx_socpeople } } - $sql .= " AND tc.active=1"; + $sql .= " AND tc.active = 1"; if ($statusoflink >= 0) { $sql .= " AND ec.statut = ".((int) $statusoflink); } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 32192114a4c..6574cf8d09d 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1331,6 +1331,7 @@ while ($i < $imaxinloop) { $userAccess = $object->restrictedProjectArea($user); // why this ? if ($userAccess >= 0) { + // Thirdparty $companystatic->id = $obj->socid; $companystatic->name = $obj->name; $companystatic->name_alias = $obj->alias; @@ -1343,6 +1344,21 @@ while ($i < $imaxinloop) { $companystatic->town = $obj->town; $companystatic->country_code = $obj->country_code; + // Author + $userstatic->id = $obj->fk_user_creat; + $userstatic->login = $obj->login; + $userstatic->lastname = $obj->lastname; + $userstatic->firstname = $obj->firstname; + $userstatic->email = $obj->user_email; + $userstatic->statut = $obj->user_statut; + $userstatic->entity = $obj->entity; + $userstatic->photo = $obj->photo; + $userstatic->office_phone = $obj->office_phone; + $userstatic->office_fax = $obj->office_fax; + $userstatic->user_mobile = $obj->user_mobile; + $userstatic->job = $obj->job; + $userstatic->gender = $obj->gender; + print ''; // Action column @@ -1496,12 +1512,25 @@ while ($i < $imaxinloop) { if (!empty($numcontact)) { foreach ($tab as $contactproject) { //var_dump($contacttask); + $cid = $contactproject['id']; if ($source == 'internal') { - $c = new User($db); + if (empty($conf->cache['user'][$cid])) { + $c = new User($db); + $c->fetch($cid); + $conf->cache['user'][$cid] = $c; + } else { + $c = $conf->cache['user'][$cid]; + } } else { - $c = new Contact($db); + if (empty($conf->cache['contact'][$cid])) { + $c = new Contact($db); + $c->fetch($cid); + $conf->cache['contact'][$cid] = $c; + } else { + $c = $conf->cache['contact'][$cid]; + } } - $c->fetch($contactproject['id']); + if (!empty($c->photo)) { if (get_class($c) == 'User') { print $c->getNomUrl(-2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst')); @@ -1703,20 +1732,6 @@ while ($i < $imaxinloop) { $totalarray['pos'][$totalarray['nbfield']] = 'p.price_booth'; } } - // Author - $userstatic->id = $obj->fk_user_creat; - $userstatic->login = $obj->login; - $userstatic->lastname = $obj->lastname; - $userstatic->firstname = $obj->firstname; - $userstatic->email = $obj->user_email; - $userstatic->statut = $obj->user_statut; - $userstatic->entity = $obj->entity; - $userstatic->photo = $obj->photo; - $userstatic->office_phone = $obj->office_phone; - $userstatic->office_fax = $obj->office_fax; - $userstatic->user_mobile = $obj->user_mobile; - $userstatic->job = $obj->job; - $userstatic->gender = $obj->gender; if (!empty($arrayfields['u.login']['checked'])) { print ''; From 36b0b7f03cd4cb380683466a884067d4d3874afd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 16:15:05 +0100 Subject: [PATCH 31/50] Fix somes subrequests inside the loop --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 38202a0938a..9eb66fa0745 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1360,7 +1360,7 @@ abstract class CommonObject * @param array $arrayoftcids Array with ID of type of contacts. If we provide this, we can make a ec.fk_c_type_contact in ($arrayoftcids) to avoid link on tc table. TODO Not implemented. * @return array|int Array of contacts, -1 if error */ - public function liste_contact($statusoflink = -1, $source = 'external', $list = 0, $code = '', $status = -1, $typecontectids = array()) + public function liste_contact($statusoflink = -1, $source = 'external', $list = 0, $code = '', $status = -1, $arrayoftcids = array()) { // phpcs:enable global $langs; From a3d32fc7eb8bb0f7c590552aefb8ba43cb0bcfeb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 16:53:16 +0100 Subject: [PATCH 32/50] Trans --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 6f09e734406..f494dddb082 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -1005,7 +1005,7 @@ if ($type == Categorie::TYPE_PROJECT) { print ''; print ''; print ''; print ''; From 0235e24e0e6d1f01e8d9b8097a35aacad4fa67e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 17:54:07 +0100 Subject: [PATCH 33/50] Fix css multiseclect --- htdocs/core/class/html.form.class.php | 9 +++++++-- htdocs/theme/eldy/global.inc.php | 8 ++++++++ htdocs/theme/md/style.css.php | 8 ++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6f0023548b9..1a15abe53bc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8408,8 +8408,13 @@ class Form } } - // Try also magic suggest - $out .= ''."\n"; if (is_array($array) && !empty($array)) { if ($value_as_key) { $array = array_combine($array, $array); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 8f7d4b1ef1e..12d068168d0 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6514,6 +6514,14 @@ ul.select2-results__options li { font-size: 0.95em; } +select.multiselectononeline { + padding: 0; + vertical-align: middle; + height: 28px !important; + opacity: 0; + /* width: 1px !important; */ +} + @media only screen and (min-width: 767px) { /* CSS to have the dropdown boxes larger that the input search area */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 6d56e452898..20349be0b4e 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6421,6 +6421,14 @@ ul.select2-results__options li { font-size: 0.95em; } +select.multiselectononeline { + padding: 0; + vertical-align: middle; + height: 28px !important; + opacity: 0; + /* width: 1px !important; */ +} + @media only screen and (min-width: 767px) { /* CSS to have the dropdown boxes larger that the input search area */ From c21be771f87ea516ede1f2cd3cebccc8e614a295 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 18:05:05 +0100 Subject: [PATCH 34/50] CSS --- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 12d068168d0..23bb38e8d5a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6517,6 +6517,7 @@ ul.select2-results__options li { select.multiselectononeline { padding: 0; vertical-align: middle; + min-height: unset; height: 28px !important; opacity: 0; /* width: 1px !important; */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 20349be0b4e..8c2934fb227 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6424,6 +6424,7 @@ ul.select2-results__options li { select.multiselectononeline { padding: 0; vertical-align: middle; + min-height: unset; height: 28px !important; opacity: 0; /* width: 1px !important; */ From 211bda455d18e9e4d95d24097fe1b534202e026f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 19:00:44 +0100 Subject: [PATCH 35/50] Debug v17 --- htdocs/core/js/lib_notification.js.php | 35 ++++++++++++++++++-------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index d7e1932ca27..c33dbe2a3bd 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -66,6 +66,8 @@ print "jQuery(document).ready(function () {\n"; print ' var nowtime = Date.now();'; print ' var time_auto_update = '.max(1, getDolGlobalInt('MAIN_BROWSER_NOTIFICATION_FREQUENCY')).';'."\n"; // Always defined print ' var time_js_next_test;'."\n"; +print ' var dolnotif_nb_test_for_page = 0;'."\n"; +print ' var dolnotif_idinterval = null;'."\n"; ?> /* Check if Notification is supported */ @@ -82,7 +84,7 @@ if ("Notification" in window) { //var time_first_execution = (time_auto_update + (time_js_next_test - nowtime)) * 1000; //need milliseconds var time_first_execution = global->MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION) ? 0 : $conf->global->MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION); ?>; - setTimeout(first_execution, time_first_execution * 1000); + setTimeout(first_execution, time_first_execution * 1000); // Launch a first execution after a time_first_execution delay time_js_next_test = nowtime + time_first_execution; console.log("Launch browser notif check: setTimeout is set to launch 'first_execution' function after a wait of time_first_execution="+time_first_execution+". nowtime (time php page generation) = "+nowtime+" time_js_next_check = "+time_js_next_test); } else { @@ -91,14 +93,16 @@ if ("Notification" in window) { function first_execution() { - console.log("Call first_execution then set repeat time to time_auto_update = MAIN_BROWSER_NOTIFICATION_FREQUENCY = "+time_auto_update); - check_events(); //one check before setting the new time for other checks - setInterval(check_events, time_auto_update * 1000); // Set new time to run next check events + console.log("Call first_execution"); + result = check_events(); //one check before setting the new time for other checks + if (result > 0) { + console.log("Program a repeated run with a time_auto_update = MAIN_BROWSER_NOTIFICATION_FREQUENCY = "+time_auto_update+"s"); + dolnotif_idinterval = setInterval(check_events, time_auto_update * 1000); // Set new time to run next check events. time_auto_update=nb of seconds + } } function check_events() { - if (Notification.permission === "granted") - { + if (Notification.permission === "granted") { var currentToken = 'notrequired'; const allMeta = document.getElementsByTagName("meta"); for (let i = 0; i < allMeta.length; i++) { @@ -108,7 +112,9 @@ function check_events() { } } time_js_next_test += time_auto_update; - console.log("Call ajax to check events with time_js_next_test = "+time_js_next_test); + dolnotif_nb_test_for_page += 1; + + console.log("Call ajax to check events with time_js_next_test = "+time_js_next_test+" dolnotif_nb_test_for_page="+dolnotif_nb_test_for_page); $.ajax("", { type: "post", // Usually post or get @@ -188,10 +194,17 @@ function check_events() { } } }); - } - else - { - console.log("Cancel check_events. Useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https)."); + + if (dolnotif_nb_test_for_page > 10) { + console.log("We did "+dolnotif_nb_test_for_page+" consecutive test on this page. We stop checking now from here by clearing dolnotif_idinterval="+dolnotif_idinterval); + clearInterval(dolnotif_idinterval); + } + + return 1; + } else { + console.log("Cancel check_events and timer. Useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https)."); + + return 0; } } Date: Fri, 10 Feb 2023 19:08:03 +0100 Subject: [PATCH 36/50] Log --- htdocs/core/js/lib_notification.js.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index c33dbe2a3bd..2659b812bc6 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -93,7 +93,7 @@ if ("Notification" in window) { function first_execution() { - console.log("Call first_execution"); + console.log("Call first_execution of check_events()"); result = check_events(); //one check before setting the new time for other checks if (result > 0) { console.log("Program a repeated run with a time_auto_update = MAIN_BROWSER_NOTIFICATION_FREQUENCY = "+time_auto_update+"s"); @@ -190,12 +190,12 @@ function check_events() { data: { time_js_next_test: time_js_next_test, token: currentToken } }); } else { - console.log("No reminder to do found, next search at "+time_js_next_test); + console.log("No remind to do found, next search at "+time_js_next_test); } } }); - if (dolnotif_nb_test_for_page > 10) { + if (dolnotif_nb_test_for_page > 5) { console.log("We did "+dolnotif_nb_test_for_page+" consecutive test on this page. We stop checking now from here by clearing dolnotif_idinterval="+dolnotif_idinterval); clearInterval(dolnotif_idinterval); } From 582cb35ae4fed24edf935950788ee7537174f252 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 19:15:14 +0100 Subject: [PATCH 37/50] Fix allow time to answer notification permission --- htdocs/core/js/lib_notification.js.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index 2659b812bc6..9724dc8c447 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -96,7 +96,7 @@ function first_execution() { console.log("Call first_execution of check_events()"); result = check_events(); //one check before setting the new time for other checks if (result > 0) { - console.log("Program a repeated run with a time_auto_update = MAIN_BROWSER_NOTIFICATION_FREQUENCY = "+time_auto_update+"s"); + console.log("check_events() is scheduled as a repeated task with a time_auto_update = MAIN_BROWSER_NOTIFICATION_FREQUENCY = "+time_auto_update+"s"); dolnotif_idinterval = setInterval(check_events, time_auto_update * 1000); // Set new time to run next check events. time_auto_update=nb of seconds } } @@ -204,7 +204,7 @@ function check_events() { } else { console.log("Cancel check_events and timer. Useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https)."); - return 0; + return 2; // We return a positive so the repeated check will done even if authroization is not yet allowed may be after this check) } } Date: Fri, 10 Feb 2023 19:15:54 +0100 Subject: [PATCH 38/50] Log --- htdocs/core/js/lib_notification.js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index 9724dc8c447..67423200405 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -202,7 +202,7 @@ function check_events() { return 1; } else { - console.log("Cancel check_events and timer. Useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https)."); + console.log("Cancel check_events. Check is useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https)."); return 2; // We return a positive so the repeated check will done even if authroization is not yet allowed may be after this check) } From 78201454e8e1fe8cc14a52b771e1e44d832d3b2c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 19:19:11 +0100 Subject: [PATCH 39/50] Fix stop of timer is done also when checks fail --- htdocs/core/js/lib_notification.js.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index 67423200405..102f760122a 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -102,6 +102,9 @@ function first_execution() { } function check_events() { + var result = 0; + dolnotif_nb_test_for_page += 1; + if (Notification.permission === "granted") { var currentToken = 'notrequired'; const allMeta = document.getElementsByTagName("meta"); @@ -112,7 +115,6 @@ function check_events() { } } time_js_next_test += time_auto_update; - dolnotif_nb_test_for_page += 1; console.log("Call ajax to check events with time_js_next_test = "+time_js_next_test+" dolnotif_nb_test_for_page="+dolnotif_nb_test_for_page); @@ -195,17 +197,19 @@ function check_events() { } }); - if (dolnotif_nb_test_for_page > 5) { - console.log("We did "+dolnotif_nb_test_for_page+" consecutive test on this page. We stop checking now from here by clearing dolnotif_idinterval="+dolnotif_idinterval); - clearInterval(dolnotif_idinterval); - } - - return 1; + result = 1; } else { - console.log("Cancel check_events. Check is useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https)."); + console.log("Cancel check_events() with dolnotif_nb_test_for_page="+dolnotif_nb_test_for_page+". Check is useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https)."); - return 2; // We return a positive so the repeated check will done even if authroization is not yet allowed may be after this check) + result = 2; // We return a positive so the repeated check will done even if authroization is not yet allowed may be after this check) } + + if (dolnotif_nb_test_for_page > 5) { + console.log("We did "+dolnotif_nb_test_for_page+" consecutive test on this page. We stop checking now from here by clearing dolnotif_idinterval="+dolnotif_idinterval); + clearInterval(dolnotif_idinterval); + } + + return result; } Date: Fri, 10 Feb 2023 19:24:50 +0100 Subject: [PATCH 40/50] Fix end of loop --- htdocs/core/js/lib_notification.js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index 102f760122a..c2f7096432f 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -204,7 +204,7 @@ function check_events() { result = 2; // We return a positive so the repeated check will done even if authroization is not yet allowed may be after this check) } - if (dolnotif_nb_test_for_page > 5) { + if (dolnotif_nb_test_for_page >= 5) { console.log("We did "+dolnotif_nb_test_for_page+" consecutive test on this page. We stop checking now from here by clearing dolnotif_idinterval="+dolnotif_idinterval); clearInterval(dolnotif_idinterval); } From ba1d3c9d8c6d56c691d4f36054aa446a12184bc5 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Fri, 10 Feb 2023 19:49:51 +0100 Subject: [PATCH 41/50] Update llx_accounting_account_fr.sql If you import this by hand, a key violation occurs. the 3352 account is named 3552, which collides which the 3552 below. I propose to fix that easily ;) --- htdocs/install/mysql/data/llx_accounting_account_fr.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_fr.sql b/htdocs/install/mysql/data/llx_accounting_account_fr.sql index 4520969f82b..4c24d63e5b1 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_fr.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_fr.sql @@ -824,7 +824,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5317,'PCG14-DEV','STOCK','3312',5315,'Produits en cours P 2','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5318,'PCG14-DEV','STOCK','335',5314,'Travaux en cours','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5319,'PCG14-DEV','STOCK','3351',5318,'Travaux en cours T 1','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5320,'PCG14-DEV','STOCK','3552',5318,'Travaux en cours T 2','1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5320,'PCG14-DEV','STOCK','3352',5318,'Travaux en cours T 2','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5321,'PCG14-DEV','STOCK','34',5969,'En-cours de production de services','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5322,'PCG14-DEV','STOCK','341',5321,'Etudes en cours','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5323,'PCG14-DEV','STOCK','3411',5322,'Etudes en cours E 1','1'); From 4a8223ae297b54292f3eab5a3085c4268ea35d99 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 11 Feb 2023 11:59:48 +0100 Subject: [PATCH 42/50] FIX look and feel --- htdocs/core/class/html.form.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1a15abe53bc..a672709cc48 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5115,10 +5115,12 @@ class Form $i = 0; foreach ($input['values'] as $selkey => $selval) { $more .= '
'; - if ($i == 0) { - $more .= '
'.$input['label'].'
'; - } else { - $more .= '
 
'; + if (isset($input['label'])) { + if ($i == 0) { + $more .= '
'.$input['label'].'
'; + } else { + $more .= '
 
'; + } } $more .= '
Date: Sat, 11 Feb 2023 12:28:23 +0100 Subject: [PATCH 43/50] Debug v17 --- htdocs/core/lib/functions.lib.php | 10 ++++--- htdocs/core/menus/standard/eldy.lib.php | 2 +- .../modules/mailings/contacts1.modules.php | 2 +- htdocs/fourn/facture/card.php | 14 ++++----- htdocs/hrm/admin/job_extrafields.php | 2 +- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/class/position.class.php | 2 +- htdocs/hrm/compare.php | 2 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/evaluation_card.php | 2 +- htdocs/hrm/evaluation_contact.php | 2 +- htdocs/hrm/evaluation_document.php | 2 +- htdocs/hrm/evaluation_note.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/lib/hrm_job.lib.php | 2 +- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/position_card.php | 2 +- htdocs/hrm/position_document.php | 2 +- htdocs/hrm/position_note.php | 2 +- htdocs/langs/en_US/hrm.lang | 6 ++-- htdocs/user/list.php | 30 +++++++++++++++++-- 21 files changed, 60 insertions(+), 34 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 37949215357..0f42862b724 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4098,7 +4098,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus', 'gears', 'generate', 'globe', 'globe-americas', 'graph', 'grip', 'grip_title', 'group', 'help', 'holiday', - 'images', 'incoterm', 'info', 'intervention', 'inventory', 'intracommreport', 'knowledgemanagement', + 'images', 'incoterm', 'info', 'intervention', 'inventory', 'intracommreport', 'jobprofile', + 'knowledgemanagement', 'label', 'language', 'line', 'link', 'list', 'list-alt', 'listlight', 'loan', 'lock', 'lot', 'long-arrow-alt-right', 'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'movement', 'mrp', 'note', 'next', 'off', 'on', 'order', @@ -4113,7 +4114,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'technic', 'ticket', 'error', 'warning', 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss', - 'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', + 'shapes', 'skill', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', 'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private', 'conferenceorbooth', 'eventorganization', @@ -4145,7 +4146,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'email'=>'at', 'establishment'=>'building', 'edit'=>'pencil-alt', 'entity'=>'globe', 'graph'=>'chart-line', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle', 'generic'=>'file', 'holiday'=>'umbrella-beach', - 'info'=>'info-circle', 'inventory'=>'boxes', 'intracommreport'=>'globe-europe', 'knowledgemanagement'=>'ticket-alt', 'label'=>'layer-group', 'line'=>'bars', 'loan'=>'money-bill-alt', + 'info'=>'info-circle', 'inventory'=>'boxes', 'intracommreport'=>'globe-europe', 'jobprofile'=>'cogs', + 'knowledgemanagement'=>'ticket-alt', 'label'=>'layer-group', 'line'=>'bars', 'loan'=>'money-bill-alt', 'member'=>'user-alt', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right', 'trip'=>'wallet', 'expensereport'=>'wallet', 'group'=>'users', 'movement'=>'people-carry', 'sign-out'=>'sign-out-alt', @@ -4161,7 +4163,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'refresh'=>'redo', 'region'=>'map-marked', 'replacement'=>'exchange-alt', 'resource'=>'laptop-house', 'recurring'=>'history', 'service'=>'concierge-bell', - 'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', + 'skill'=>'shapes', 'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', 'supplier'=>'building', 'technic'=>'cogs', 'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index d04cf9edc1a..b534a998107 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2270,7 +2270,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = //$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'all', 'read')); // Job (Description of work to do and skills required) - $newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("JobsPosition"), 1, $user->hasRight('hrm', 'all', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("JobsProfiles"), 1, $user->hasRight('hrm', 'all', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); //$newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->hasRight('hrm', 'all', 'write')); //$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'all', 'read')); diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 36be5bf40b3..71cbe6e6199 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -463,7 +463,7 @@ class mailing_contacts1 extends MailingTargets 'other' => ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. ($langs->transnoentities("UserTitle").'='.($obj->civility_id ? $langs->transnoentities("Civility".$obj->civility_id) : '')).';'. - ($langs->transnoentities("JobPosition").'='.$obj->jobposition), + ($langs->transnoentities("PostOrFunction").'='.$obj->jobposition), 'source_url' => $this->url($obj->id), 'source_id' => $obj->id, 'source_type' => 'contact' diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 7eedcc29403..246f65c19f9 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2199,7 +2199,7 @@ if ($action == 'create') { // Standard invoice print '
'; $tmp = ' '; - $desc = $form->textwithpicto($tmp.$langs->trans("InvoiceStandardAsk"), $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3); + $desc = $form->textwithpicto($tmp.'', $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3); print $desc; print '
'; @@ -2377,7 +2377,7 @@ if ($action == 'create') { }); }); '; - $text = $tmp.$langs->transnoentities("InvoiceAvoirAsk").' '; + $text = $tmp.' '; // $text.=''; $text .= '
'; - // Payment term print ''; + // Due date + print ''; + // Payment mode print '
'; - print $langs->trans("AddProjectIntoCategory").'  '; + print $langs->trans("AddObjectIntoCategory").'  '; $form->selectProjects('', 'elemid'); print '
'.$langs->trans('DateMaxPayment').''; - print $form->selectDate($datedue, 'ech', '', '', '', "add", 1, 1); - print '
'.$langs->trans('PaymentConditionsShort').''; print $form->getSelectConditionsPaiements(GETPOSTISSET('cond_reglement_id') ?GETPOST('cond_reglement_id', 'int') : $cond_reglement_id, 'cond_reglement_id'); print '
'.$langs->trans('DateMaxPayment').''; + print $form->selectDate($datedue, 'ech', '', '', '', "add", 1, 1); + print '
'.$langs->trans('PaymentMode').''; print img_picto('', 'bank', 'class="pictofixedwidth"'); diff --git a/htdocs/hrm/admin/job_extrafields.php b/htdocs/hrm/admin/job_extrafields.php index 6ac0773c00f..8b30b1c7051 100644 --- a/htdocs/hrm/admin/job_extrafields.php +++ b/htdocs/hrm/admin/job_extrafields.php @@ -67,7 +67,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; * View */ -$textobject = $langs->transnoentitiesnoconv("JobPosition"); +$textobject = $langs->transnoentitiesnoconv("JobProfile"); $help_url = ''; $page_name = "HrmSetup"; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 51f8c8bc985..039888258b8 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -119,7 +119,7 @@ class Evaluation extends CommonObject 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'default'=>0, 'visible'=>5, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '6' => 'Closed'),), 'date_eval' => array('type'=>'date', 'label'=>'DateEval', 'enabled'=>'1', 'position'=>502, 'notnull'=>1, 'visible'=>1,), 'fk_user' => array('type'=>'integer:User:user/class/user.class.php:0', 'label'=>'User', 'enabled'=>'1', 'position'=>504, 'notnull'=>1, 'visible'=>1,), - 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobPosition', 'enabled'=>'1', 'position'=>505, 'notnull'=>1, 'visible'=>1,), + 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobProfile', 'enabled'=>'1', 'position'=>505, 'notnull'=>1, 'visible'=>1,), ); public $rowid; public $ref; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index b685147a9b9..27c7643abe5 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -110,7 +110,7 @@ class Position extends CommonObject 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), 'fk_contrat' => array('type'=>'integer:Contrat:contrat/class/contrat.class.php', 'label'=>'fk_contrat', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>0,), 'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Employee', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'default'=>0), - 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobPosition', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,), + 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobProfile', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,), 'date_start' => array('type'=>'date', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>51, 'notnull'=>1, 'visible'=>1,), 'date_end' => array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>52, 'notnull'=>0, 'visible'=>1,), 'abort_comment' => array('type'=>'varchar(255)', 'label'=>'AbandonmentComment', 'enabled'=>'getDolGlobalInt("HRM_JOB_POSITON_ENDING_COMMENT")', 'position'=>502, 'notnull'=>0, 'visible'=>1,), diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php index beee61ca6fa..a9fbb3a1903 100644 --- a/htdocs/hrm/compare.php +++ b/htdocs/hrm/compare.php @@ -155,7 +155,7 @@ $fk_usergroup1 = GETPOST('fk_usergroup1'); $TJobs[$j->id] = $j->label; } - print $form->selectarray('fk_job', $TJobs, $fk_job, 1); + print img_picto('', 'jobprofile', 'class="pictofixedwidth"').$form->selectarray('fk_job', $TJobs, $fk_job, 1); ?>
diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index cc314bd9bce..31607e01b28 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -158,7 +158,7 @@ if ($object->id > 0) { $morehtmlref .= '
'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); $morehtmlref .= '
'; diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 101873a69e4..8f513d654f3 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -410,7 +410,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= '
'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); $morehtmlref .= '
'; diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index 4ea2e8e81be..c96f562afc7 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -145,7 +145,7 @@ if ($object->id) { $morehtmlref .= '
'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); $morehtmlref .= ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php index 84bc6023291..7935ea7602c 100644 --- a/htdocs/hrm/evaluation_document.php +++ b/htdocs/hrm/evaluation_document.php @@ -138,7 +138,7 @@ if ($object->id) { $morehtmlref .= '
'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); $morehtmlref .= ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php index 3f0d41e946a..1164a9642b1 100644 --- a/htdocs/hrm/evaluation_note.php +++ b/htdocs/hrm/evaluation_note.php @@ -113,7 +113,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); $morehtmlref .= ''; diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 6cb1a4bf62c..0261c968d4c 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -207,7 +207,7 @@ $now = dol_now(); //$help_url="EN:Module_Job|FR:Module_Job_FR|ES:Módulo_Job"; $help_url = ''; -$title = $langs->trans("JobsPosition"); +$title = $langs->trans("JobsProfiles"); $morejs = array(); $morecss = array(); diff --git a/htdocs/hrm/lib/hrm_job.lib.php b/htdocs/hrm/lib/hrm_job.lib.php index 6a948b00439..cff07ef5e67 100644 --- a/htdocs/hrm/lib/hrm_job.lib.php +++ b/htdocs/hrm/lib/hrm_job.lib.php @@ -40,7 +40,7 @@ function jobPrepareHead($object) $head = array(); $head[$h][0] = DOL_URL_ROOT."/hrm/job_card.php?id=".$object->id; - $head[$h][1] = $langs->trans("JobPosition"); + $head[$h][1] = $langs->trans("JobProfile"); $head[$h][2] = 'job_card'; $h++; diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index af60ddea1b8..210f8974b68 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -158,7 +158,7 @@ if ($object->id > 0) { $morehtmlref .= ($u_position->id > 0 ? $u_position->getNomUrl(1) : $langs->trans('Employee').' : '); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); $morehtmlref .= ''; diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index fae9efd76ba..9004e8d2b13 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -288,7 +288,7 @@ function displayPositionCard(&$object) $morehtmlref .= ($u_position->id > 0 ? $u_position->getNomUrl(1) : $langs->trans('Employee').' : '); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); $morehtmlref .= ''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php index 521d6b0ec24..60c0e87c788 100644 --- a/htdocs/hrm/position_document.php +++ b/htdocs/hrm/position_document.php @@ -136,7 +136,7 @@ if ($object->id) { $morehtmlref .= ($u_position->id > 0 ? $u_position->getNomUrl(1) : $langs->trans('Employee').' : '); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); $morehtmlref .= ''; diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php index a09b0e99699..fba8cd2067c 100644 --- a/htdocs/hrm/position_note.php +++ b/htdocs/hrm/position_note.php @@ -111,7 +111,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= ($u_position->id > 0 ? $u_position->getNomUrl(1) : $langs->trans('Employee').' : '); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); $morehtmlref .= ''; diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index 592009b8697..475e11131f4 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -26,8 +26,8 @@ HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created deplacement=Shift DateEval=Evaluation date JobCard=Job card -JobPosition=Job profile -JobsPosition=Job profiles +JobProfile=Job profile +JobsProfiles=Job profiles NewSkill=New Skill SkillType=Skill type Skilldets=List of ranks for this skill @@ -53,7 +53,7 @@ EmployeePositions=Employee positions EmployeesInThisPosition=Employees in this position group1ToCompare=Usergroup to analyze group2ToCompare=Second usergroup for comparison -OrJobToCompare=Compare to job skills requirements +OrJobToCompare=Compare to skill requirements of a job profile difference=Difference CompetenceAcquiredByOneOrMore=Competence acquired by one or more users but not requested by the second comparator MaxlevelGreaterThan=Max level greater than the one requested diff --git a/htdocs/user/list.php b/htdocs/user/list.php index d3139b438e2..a269a93fb7b 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -131,6 +131,7 @@ $arrayfields = array( 'u.email'=>array('label'=>"EMail", 'checked'=>1, 'position'=>35), 'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>(!empty($conf->api->enabled) && $user->admin)), 'u.fk_soc'=>array('label'=>"Company", 'checked'=>($contextpage == 'employeelist' ? 0 : 1), 'position'=>45), + 'u.job'=>array('label'=>"PostOrFunction", 'checked'=>-1, 'position'=>50), 'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>(!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall"))), 'u.datelastlogin'=>array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100), 'u.datepreviouslogin'=>array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110), @@ -159,6 +160,7 @@ $search_email = GETPOST('search_email', 'alpha'); $search_api_key = GETPOST('search_api_key', 'alphanohtml'); $search_statut = GETPOST('search_statut', 'intcomma'); $search_thirdparty = GETPOST('search_thirdparty', 'alpha'); +$search_job = GETPOST('search_job', 'alpha'); $search_warehouse = GETPOST('search_warehouse', 'alpha'); $search_supervisor = GETPOST('search_supervisor', 'intcomma'); $search_categ = GETPOST("search_categ", 'int'); @@ -250,6 +252,7 @@ if (empty($reshook)) { $search_email = ""; $search_statut = ""; $search_thirdparty = ""; + $search_job = ""; $search_warehouse = ""; $search_supervisor = ""; $search_api_key = ""; @@ -357,7 +360,7 @@ $morehtmlright = ""; // Build and execute select // -------------------------------------------------------------------- $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.office_phone, u.user_mobile, u.email, u.api_key, u.accountancy_code, u.gender, u.employee, u.photo,"; -$sql .= " u.salary, u.datelastlogin, u.datepreviouslogin,"; +$sql .= " u.job, u.salary, u.datelastlogin, u.datepreviouslogin,"; $sql .= " u.ldap_sid, u.statut as status, u.entity,"; $sql .= " u.tms as date_update, u.datec as date_creation,"; $sql .= " u2.rowid as id2, u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2, u2.admin as admin2, u2.fk_soc as fk_soc2, u2.office_phone as ofice_phone2, u2.user_mobile as user_mobile2, u2.email as email2, u2.gender as gender2, u2.photo as photo2, u2.entity as entity2, u2.statut as status2,"; @@ -433,6 +436,9 @@ if ($search_email != '') { if ($search_api_key != '') { $sql .= natural_search("u.api_key", $search_api_key); } +if ($search_job != '') { + $sql .= natural_search(array('u.job'), $search_job); +} if ($search_statut != '' && $search_statut >= 0) { $sql .= " AND u.statut IN (".$db->sanitize($search_statut).")"; } @@ -772,6 +778,9 @@ if (!empty($arrayfields['u.fk_soc']['checked'])) { if (!empty($arrayfields['u.entity']['checked'])) { print ''; } +if (!empty($arrayfields['u.job']['checked'])) { + print ''; +} if (!empty($arrayfields['u.salary']['checked'])) { print ''; } @@ -823,7 +832,7 @@ if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { $totalarray['nbfield']++; } if (!empty($arrayfields['u.login']['checked'])) { - print_liste_field_titre("Login", $_SERVER['PHP_SELF'], "u.login", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER['PHP_SELF'], "u.login", $param, "", "", $sortfield, $sortorder); $totalarray['nbfield']++; } if (!empty($arrayfields['u.lastname']['checked'])) { @@ -871,7 +880,11 @@ if (!empty($arrayfields['u.fk_soc']['checked'])) { $totalarray['nbfield']++; } if (!empty($arrayfields['u.entity']['checked'])) { - print_liste_field_titre("Entity", $_SERVER['PHP_SELF'], "u.entity", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre($arrayfields['u.entity']['label'], $_SERVER['PHP_SELF'], "u.entity", $param, "", "", $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['u.job']['checked'])) { + print_liste_field_titre($arrayfields['u.job']['label'], $_SERVER['PHP_SELF'], "u.job", $param, "", "", $sortfield, $sortorder); $totalarray['nbfield']++; } if (!empty($arrayfields['u.salary']['checked'])) { @@ -948,6 +961,7 @@ while ($i < $imaxinloop) { $object->status = $obj->status; $object->office_phone = $obj->office_phone; $object->user_mobile = $obj->user_mobile; + $object->job = $obj->job; $object->email = $obj->email; $object->gender = $obj->gender; $object->socid = $obj->fk_soc; @@ -1160,6 +1174,16 @@ while ($i < $imaxinloop) { } } + // Job position + if (!empty($arrayfields['u.job']['checked'])) { + print ''; + print dol_escape_htmltag($obj->job); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Salary if (!empty($arrayfields['u.salary']['checked'])) { print ''; From 1b3b7c93297118d84f23dd86b99401f8daf43c42 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Feb 2023 12:34:21 +0100 Subject: [PATCH 44/50] Fix default values --- htdocs/admin/defaultvalues.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 6903571d394..4baddd8b29b 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -147,12 +147,12 @@ if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('ac $object->value=$defaultvalue; $object->entity=$conf->entity; $result=$object->create($user); - if ($result<0) { + if ($result < 0) { $action = ''; setEventMessages($object->error, $object->errors, 'errors'); } else { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); - $action = ""; + $action = ''; $defaulturl = ''; $defaultkey = ''; $defaultvalue = ''; @@ -324,16 +324,16 @@ print "\n"; print ''; // Page print ''; -print ''; +print ''; print ''."\n"; // Field print ''; -print ''; +print ''; print ''; // Value if ($mode != 'focus' && $mode != 'mandatory') { print ''; - print ''; + print ''; print ''; } // Limit to superadmin From c02113de6a36601ee26af2bc9390da006bd018db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Feb 2023 13:04:23 +0100 Subject: [PATCH 45/50] Debug v17 --- htdocs/hrm/evaluation_agenda.php | 28 +++++++++------ htdocs/hrm/evaluation_card.php | 2 +- htdocs/hrm/evaluation_contact.php | 2 +- htdocs/hrm/evaluation_document.php | 2 +- htdocs/hrm/evaluation_note.php | 2 +- htdocs/langs/en_US/hrm.lang | 2 +- .../template/myobject_agenda.php | 15 +++++--- htdocs/societe/agenda.php | 35 +++++++++++-------- 8 files changed, 52 insertions(+), 36 deletions(-) diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index 31607e01b28..28f4e33e4d4 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -96,8 +96,10 @@ $permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); -//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->hrm->enabled)) accessforbidden(); +//restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft); +if (!isModEnabled('hrm')) { + accessforbidden(); +} if (!$permissiontoread) accessforbidden(); @@ -155,7 +157,7 @@ if ($object->id > 0) { $morehtmlref .= $langs->trans('Label').' : '.$object->label; $u_position = new User(($db)); $u_position->fetch($object->fk_user); - $morehtmlref .= '
'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $morehtmlref .= '
'.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); @@ -196,21 +198,25 @@ if ($object->id > 0) { //$out.=""; } + $morehtmlright = ''; - print '
'; + //$messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id; + //$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); + //$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; + //$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { - print ''.$langs->trans("AddAction").''; + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } else { - print ''.$langs->trans("AddAction").''; + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0); } } - print '
'; - if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { - $param = '&id='.$object->id.'&socid='.(!empty($socid) ? '&socid='.$socid : ''); + print '
'; + + $param = '&id='.$object->id.(!empty($socid) ? '&socid='.$socid : ''); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -218,8 +224,8 @@ if ($object->id > 0) { $param .= '&limit='.urlencode($limit); } - - //print load_fiche_titre($langs->trans("ActionsOnEvaluation"), '', ''); + //print load_fiche_titre($langs->trans("ActionsOnMyObject"), '', ''); + print_barre_liste($langs->trans("Actions"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); // List of all actions $filters = array(); diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 8f513d654f3..e59ba7db462 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -407,7 +407,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= $langs->trans('Label').' : '.$object->label; $u_position = new User(($db)); $u_position->fetch($object->fk_user); - $morehtmlref .= '
'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $morehtmlref .= '
'.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index c96f562afc7..ff41c152080 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -142,7 +142,7 @@ if ($object->id) { $morehtmlref .= $langs->trans('Label').' : '.$object->label; $u_position = new User(($db)); $u_position->fetch($object->fk_user); - $morehtmlref .= '
'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $morehtmlref .= '
'.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php index 7935ea7602c..a707913c3c3 100644 --- a/htdocs/hrm/evaluation_document.php +++ b/htdocs/hrm/evaluation_document.php @@ -135,7 +135,7 @@ if ($object->id) { $morehtmlref .= $langs->trans('Label').' : '.$object->label; $u_position = new User(($db)); $u_position->fetch($object->fk_user); - $morehtmlref .= '
'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $morehtmlref .= '
'.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php index 1164a9642b1..ba0ec02d616 100644 --- a/htdocs/hrm/evaluation_note.php +++ b/htdocs/hrm/evaluation_note.php @@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $langs->trans('Label').' : '.$object->label; $u_position = new User(($db)); $u_position->fetch($object->fk_user); - $morehtmlref .= '
'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $morehtmlref .= '
'.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); $morehtmlref .= '
'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1); diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index 475e11131f4..b31df5ee605 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -46,7 +46,7 @@ NewEval=New evaluation ValidateEvaluation=Validate evaluation ConfirmValidateEvaluation=Are you sure you want to validate this evaluation with reference %s? EvaluationCard=Evaluation card -RequiredRank=Required rank for this job +RequiredRank=Required rank for the job profile EmployeeRank=Employee rank for this skill EmployeePosition=Employee position EmployeePositions=Employee positions diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index d7b84707b95..5cdcc27eade 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -276,20 +276,25 @@ if ($object->id > 0) { //$out.=""; } + $morehtmlright = ''; - print '
'; + //$messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id; + //$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); + //$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; + //$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { - print ''.$langs->trans("AddAction").''; + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } else { - print ''.$langs->trans("AddAction").''; + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0); } } - print '
'; if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + print '
'; + $param = '&id='.$object->id.(!empty($socid) ? '&socid='.$socid : ''); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); @@ -298,8 +303,8 @@ if ($object->id > 0) { $param .= '&limit='.urlencode($limit); } - //print load_fiche_titre($langs->trans("ActionsOnMyObject"), '', ''); + print_barre_liste($langs->trans("ActionsOnMyObject"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); // List of all actions $filters = array(); diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 9e6c10a0ccd..b5d01422782 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -32,6 +32,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; // Load translation files required by the page $langs->loadLangs(array('agenda', 'bills', 'companies', 'orders', 'propal')); @@ -48,13 +50,6 @@ if (GETPOST('actioncode', 'array')) { $search_agenda_label = GETPOST('search_agenda_label'); -// Security check -$socid = GETPOST('socid', 'int'); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'societe', $socid, '&societe'); - $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -72,9 +67,19 @@ if (!$sortorder) { $sortorder = 'DESC,DESC'; } +// Initialize technical objects +$object = new Societe($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('agendathirdparty')); +// Security check +$socid = GETPOST('socid', 'int'); +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'societe', $socid, '&societe'); + /* * Actions @@ -109,28 +114,28 @@ if (empty($reshook)) { $form = new Form($db); if ($socid > 0) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - - $object = new Societe($db); $result = $object->fetch($socid); $title = $langs->trans("Agenda"); if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->name." - ".$title; } - llxHeader('', $title); + $help_url = ''; + llxHeader('', $title, $help_url); if (isModEnabled('notification')) { $langs->load("mails"); } $head = societe_prepare_head($object); - print dol_get_fiche_head($head, 'agenda', $langs->trans("ThirdParty"), -1, 'company'); + + print dol_get_fiche_head($head, 'agenda', $langs->trans("ThirdParty"), -1, $object->picto); $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom'); + $morehtmlref = ''; + + dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', $morehtmlref); print '
'; @@ -202,7 +207,7 @@ if ($socid > 0) { $filters['search_agenda_label'] = $search_agenda_label; // TODO Replace this with same code than into list.php - show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module); } } From 216c4f02b6378b64bd5e9f3753ac65d002d08c2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Feb 2023 13:53:56 +0100 Subject: [PATCH 46/50] Fix bad test --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f476c9bafed..de331c7c3d4 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -177,7 +177,7 @@ function testSqlAndScriptInject($val, $type) // We refuse html into html because some hacks try to obfuscate evil strings by inserting HTML into HTML. Example: error=alert(1) to bypass test on onerror $tmpval = preg_replace('/<[^<]+>/', '', $val); // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp and https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers - $inj += preg_match('/on(mouse|drag|key|load|touch|pointer|select|transition)([a-z]*)\s*=/i', $val); // onmousexxx can be set on img or any html tag like + $inj += preg_match('/on(mouse|drag|key|load|touch|pointer|select|transition)([a-z]*)\s*=/i', $tmpval); // onmousexxx can be set on img or any html tag like $inj += preg_match('/on(abort|afterprint|animation|auxclick|beforecopy|beforecut|beforeprint|beforeunload|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)\s*=/i', $tmpval); $inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $tmpval); $inj += preg_match('/on(lostpointercapture|offline|online|pagehide|pageshow)\s*=/i', $tmpval); From d0858d8eaaa434a708d538ddef71299907b65e0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Feb 2023 14:55:46 +0100 Subject: [PATCH 47/50] Debug v17 --- htdocs/core/lib/website2.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 05727a1e539..aa6d4fbec21 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -730,6 +730,7 @@ function checkPHPCode($phpfullcodestringold, $phpfullcodestring) if (!$error) { $dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT); $allowimportsite = true; + include DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) { $allowimportsite = false; } From 9e79e00f10c18b75d27dac4739041ac30e5ab1dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Feb 2023 15:19:49 +0100 Subject: [PATCH 48/50] Debug v17 --- htdocs/core/lib/website2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index aa6d4fbec21..e03f711c9c0 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -730,7 +730,7 @@ function checkPHPCode($phpfullcodestringold, $phpfullcodestring) if (!$error) { $dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT); $allowimportsite = true; - include DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) { $allowimportsite = false; } From 4a49ca86c9fe7fbfa3f2cf5cc9ece6c4018fe756 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Feb 2023 13:29:30 +0100 Subject: [PATCH 49/50] Fix #huntr88841fe0-e332-49ce-a46b-36d4f091fd89 --- htdocs/core/lib/website.lib.php | 2 +- htdocs/core/lib/website2.lib.php | 1 + htdocs/website/index.php | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index c258e3198ce..d900b7718cf 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -69,7 +69,7 @@ function dolStripPhpCode($str, $replacewith = '') * * @param string $str String to clean * @return string Result string with php code only - * @see dolStripPhpCode() + * @see dolStripPhpCode(), checkPHPCode() */ function dolKeepOnlyPhpCode($str) { diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index e03f711c9c0..e619ab17a76 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -678,6 +678,7 @@ function showWebsiteTemplates(Website $website) * @param string $phpfullcodestringold PHP old string * @param string $phpfullcodestring PHP new string * @return int Error or not + * @see dolKeepOnlyPhpCode() */ function checkPHPCode($phpfullcodestringold, $phpfullcodestring) { diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 3a625818ba4..22e692ad824 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -806,6 +806,16 @@ if ($action == 'addcontainer' && $usercanedit) { // Remove comments $tmp['content'] = removeHtmlComment($tmp['content']); + // Check there is no PHP content into the imported file (must be only HTML + JS) + $phpcontent = dolKeepOnlyPhpCode('', $tmp['content']); + if ($phpcontent) { + $error++; + setEventMessages('Error getting '.$urltograb.': file that include PHP content is not allowed', null, 'errors'); + $action = 'createcontainer'; + } + } + + if (!$error) { $regs = array(); preg_match('/(.*)<\/head>/ims', $tmp['content'], $regs); From c1ee02c51059644dfcb0072e6280374897d509a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Feb 2023 13:33:48 +0100 Subject: [PATCH 50/50] Fix bad param --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 22e692ad824..271c139b667 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -807,7 +807,7 @@ if ($action == 'addcontainer' && $usercanedit) { $tmp['content'] = removeHtmlComment($tmp['content']); // Check there is no PHP content into the imported file (must be only HTML + JS) - $phpcontent = dolKeepOnlyPhpCode('', $tmp['content']); + $phpcontent = dolKeepOnlyPhpCode($tmp['content']); if ($phpcontent) { $error++; setEventMessages('Error getting '.$urltograb.': file that include PHP content is not allowed', null, 'errors');