From b9336570ff65d161c434302110576520310e9956 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 13 May 2021 10:26:09 +0200 Subject: [PATCH 01/10] NEW report contact/adresses on credit note from invoice keep same contact/adresses from source invoice (ir: usefull for correct notifications) --- htdocs/compta/facture/card.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 48b7c505264..6dd4d050b8b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1093,6 +1093,19 @@ if (empty($reshook)) { } } $id = $object->create($user); + if ($id < 0) { + $error++; + } else { + // copy internal contacts + if ($object->copy_linked_contact($facture_source, 'internal') < 0) { + $error++; + } elseif ($facture_source->socid == $object->socid) { + // copy external contacts if same company + if ($object->copy_linked_contact($facture_source, 'external') < 0) { + $error++; + } + } + } // NOTE: Pb with situation invoice // NOTE: fields total on situation invoice are stored as cumulative values on total of lines (bad) but delta on invoice total From 05ea8761a1156f342afb7743fe48e260cffc384f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 13 May 2021 08:28:14 +0000 Subject: [PATCH 02/10] Fixing style errors. --- htdocs/compta/facture/card.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 6dd4d050b8b..e5b4b2d2398 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1093,19 +1093,19 @@ if (empty($reshook)) { } } $id = $object->create($user); - if ($id < 0) { - $error++; - } else { - // copy internal contacts - if ($object->copy_linked_contact($facture_source, 'internal') < 0) { - $error++; - } elseif ($facture_source->socid == $object->socid) { - // copy external contacts if same company - if ($object->copy_linked_contact($facture_source, 'external') < 0) { + if ($id < 0) { $error++; + } else { + // copy internal contacts + if ($object->copy_linked_contact($facture_source, 'internal') < 0) { + $error++; + } elseif ($facture_source->socid == $object->socid) { + // copy external contacts if same company + if ($object->copy_linked_contact($facture_source, 'external') < 0) { + $error++; + } + } } - } - } // NOTE: Pb with situation invoice // NOTE: fields total on situation invoice are stored as cumulative values on total of lines (bad) but delta on invoice total From 014b34acc69175916d62bf4b4943136b1d052b66 Mon Sep 17 00:00:00 2001 From: piernov Date: Sat, 15 May 2021 16:44:46 +0200 Subject: [PATCH 03/10] Fix default gid 65534 for User in LDAP posixAccount objectclass (intended to be used with the uid/gid/homedir fields) requires a gid. Always set a gid in LDAP for the User class even if the user does not belong to any group. By default 65534 which corresponds to the nobody group on major distributions (incl. Debian). --- htdocs/user/class/user.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 89995a4584e..6c0645e82b7 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2678,10 +2678,10 @@ class User extends CommonObject } if (!empty($conf->global->LDAP_FIELD_USERID))$info[$conf->global->LDAP_FIELD_USERID] = $this->id; - if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) { + if (!empty($conf->global->LDAP_FIELD_GROUPID)) { $usergroup = new UserGroup($this->db); $groupslist = $usergroup->listGroupsForUser($this->id); - $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; + $info[$conf->global->LDAP_FIELD_GROUPID] = '65534'; if (!empty($groupslist)) { foreach ($groupslist as $groupforuser) { $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list From beff175de130c3ff3ac736c8ed89d0346df568a9 Mon Sep 17 00:00:00 2001 From: piernov Date: Sat, 15 May 2021 16:48:43 +0200 Subject: [PATCH 04/10] Fix use login for User homedir in LDAP posixAccount objectclass (intended to be used with the uid/gid/homedir fields) requires a homedir. Always set a homedir in LDAP for the User class even if user does not have a firstname by using the login instead. Additionally on Linux the login is typically used for the home directory rather than the first name. It also avoids having accentuated or other special characters (commonly found in names) in the home directory path. --- htdocs/user/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 6c0645e82b7..2d5a09659db 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2689,7 +2689,7 @@ class User extends CommonObject } } } - if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; + if (!empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->login"; return $info; } From 3859e7f00ee6b90dd864b78443f9033b0841b8df Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 16 May 2021 10:49:00 +0200 Subject: [PATCH 05/10] Fix translations on expensereport list --- htdocs/expensereport/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index e83899d28d1..ce1dc4e3c09 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -138,8 +138,8 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen $fieldstosearchall = array( 'd.ref'=>'Ref', 'd.note_public'=>"NotePublic", - 'u.lastname'=>'Lastname', - 'u.firstname'=>"Firstname", + 'u.lastname'=>'EmployeeLastname', + 'u.firstname'=>"EmployeeFirstname", 'u.login'=>"Login", ); if (empty($user->socid)) { From baf0dda19cd31911348d28a6acbcbb1b16301e22 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 16 May 2021 10:52:51 +0200 Subject: [PATCH 06/10] Fix missing load langs for my company info in user block --- htdocs/main.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 0c3679adac5..244ef483db5 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1964,6 +1964,8 @@ function top_menu_user($hideloginname = 0, $urllogout = '') global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; + $langs->loadLangs(array('companies')); + $userImage = $userDropDownImage = ''; if (!empty($user->photo)) { $userImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'photouserphoto userphoto', 'small', 0, 1); From 3c3613a71a9100e63d02db2832322a0afc76a861 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 16 May 2021 11:06:49 +0200 Subject: [PATCH 07/10] Fix missing quick create holiday and expense report --- htdocs/main.inc.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 244ef483db5..09da7fdd80e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2354,6 +2354,28 @@ function top_menu_quickadd() '; } + if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->creer) { + $langs->load("trips"); + $dropDownQuickAddHtml .= ' + + + '; + } + + if (!empty($conf->holiday->enabled) && $user->rights->holiday->write) { + $langs->load("holiday"); + $dropDownQuickAddHtml .= ' + + + '; + } + // Execute hook printTopRightMenu (hooks should output string like '') $parameters = array(); $result = $hookmanager->executeHooks('printQuickAddBlock', $parameters); // Note that $action and $object may have been modified by some hooks From c8b725165e24199833877dffd7fa534da9409ffe Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 16 May 2021 11:16:07 +0200 Subject: [PATCH 08/10] Fix use img_picto in quick create dropdown --- htdocs/main.inc.php | 44 +++++++++++--------------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 09da7fdd80e..3fb1a1aa0da 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2217,9 +2217,7 @@ function top_menu_quickadd()
-
- '.$langs->trans("ThirdParty").' -
+ '. img_picto('', 'object_company') .'
'. $langs->trans("ThirdParty") .'
'; } @@ -2230,9 +2228,7 @@ function top_menu_quickadd()
-
- '.$langs->trans("Contact").' -
+ '. img_picto('', 'object_contact') .'
'. $langs->trans("Contact") .'
'; } @@ -2243,9 +2239,7 @@ function top_menu_quickadd()
-
- '.$langs->trans("Proposal").' -
+ '. img_picto('', 'object_propal') .'
'. $langs->trans("Proposal") .'
'; } @@ -2256,9 +2250,7 @@ function top_menu_quickadd()
-
- '.$langs->trans("Order").' -
+ '. img_picto('', 'object_order') .'
'. $langs->trans("Order") .'
'; } @@ -2269,9 +2261,7 @@ function top_menu_quickadd()
-
- '.$langs->trans("Bill").' -
+ '. img_picto('', 'object_bill') .'
'. $langs->trans("Bill") .'
'; } @@ -2282,9 +2272,7 @@ function top_menu_quickadd()
-
- '.$langs->trans("Contract").' -
+ '. img_picto('', 'object_contract') .'
'. $langs->trans("Contract") .'
'; } @@ -2295,9 +2283,7 @@ function top_menu_quickadd()
-
- '.$langs->trans("AskPrice").' -
+ '. img_picto('', 'object_propal') .'
'. $langs->trans("AskPrice") .'
'; } @@ -2308,9 +2294,7 @@ function top_menu_quickadd()
-
- '.$langs->trans("SupplierOrder").' -
+ '. img_picto('', 'object_order') .'
'. $langs->trans("SupplierOrder") .'
'; } @@ -2321,9 +2305,7 @@ function top_menu_quickadd()
-
- '.$langs->trans("SupplierBill").' -
+ '. img_picto('', 'object_bill') .'
'. $langs->trans("SupplierBill") .'
'; } @@ -2334,9 +2316,7 @@ function top_menu_quickadd()
-
- '.$langs->trans("Product").' -
+ '. img_picto('', 'object_product') .'
'. $langs->trans("Product") .'
'; } @@ -2347,9 +2327,7 @@ function top_menu_quickadd()
-
- '.$langs->trans("Service").' -
+ '. img_picto('', 'object_service') .'
'. $langs->trans("Service") .'
'; } From 6308c17c5fd22898006d6ad56437b5122f1a4294 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 May 2021 08:30:12 +0200 Subject: [PATCH 09/10] Update main.inc.php --- htdocs/main.inc.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 3fb1a1aa0da..6110be38c86 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1964,8 +1964,6 @@ function top_menu_user($hideloginname = 0, $urllogout = '') global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; - $langs->loadLangs(array('companies')); - $userImage = $userDropDownImage = ''; if (!empty($user->photo)) { $userImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'photouserphoto userphoto', 'small', 0, 1); @@ -2203,6 +2201,7 @@ function top_menu_quickadd() { global $langs, $conf, $db, $hookmanager, $user; global $menumanager; + $html = ''; // Define $dropDownQuickAddHtml $dropDownQuickAddHtml = '