From e4eb8883fece909208a94b22f60d276812600e6b Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Sun, 19 Jan 2020 19:10:10 +0100 Subject: [PATCH 01/14] Fix double display of create credit note button Before: Display of the "Create credit note" button twice for standard invoices when situation invoices are activated. After: Displays a single button "Create a credit note" --- htdocs/compta/facture/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index b067adffeca..d83e13da433 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4829,6 +4829,7 @@ elseif ($id > 0 || ! empty($ref)) // For situation invoice with excess received if ($object->statut > Facture::STATUS_DRAFT + && $object->type == Facture::TYPE_SITUATION && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) > 0 && $usercancreate && !$objectidnext From f4cd3236b1563daa1cbc0b390c6311066998ad4e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 19 Jan 2020 21:59:01 +0100 Subject: [PATCH 02/14] Fix : Accounting - error on right --- htdocs/accountancy/bookkeeping/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index e67b19991b0..7ada77d0bd6 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -855,7 +855,7 @@ print ""; print ''; // TODO Replace this with mass delete action -if ($user->rights->mouvements->creer) +if ($user->rights->accounting->mouvements->creer) { print '
' . "\n"; print '' . $langs->trans("DeleteMvt") . ''; From b4758295e149723b629b95a6c3d53c95c2aff749 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 21 Jan 2020 10:59:57 +0100 Subject: [PATCH 03/14] fix stripe/charge.php for connect mode with payment intent --- htdocs/stripe/charge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 9d4bf71c040..3483efcaa18 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -142,7 +142,7 @@ if (!$rowid) } if (! empty($charge->payment_intent)) { - $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); } // The metadata FULLTAG is defined by the online payment page From d6766af35d3e83c4d5132b8791b54c1801b2af02 Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 21 Jan 2020 14:17:53 +0100 Subject: [PATCH 04/14] Fix dom and missing param --- htdocs/core/class/commonobject.class.php | 3 ++- htdocs/core/class/html.form.class.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bf39cc1e94d..d4735e4ba8d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5932,7 +5932,8 @@ abstract class CommonObject { $param_list=array_keys($param['options']); // $param_list='ObjectName:classPath' $showempty=(($required && $default != '')?0:1); - $out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty); + $out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, $moreparam); + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { list($class,$classfile)=explode(':', $param_list[0]); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3f9a6827e49..cb46be383db 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5044,11 +5044,11 @@ class Form { if ($societe_vendeuse->id == $mysoc->id) { - $return.= ''.$langs->trans("ErrorYourCountryIsNotDefined").'
'; + $return.= '
'.$langs->trans("ErrorYourCountryIsNotDefined").'
'; } else { - $return.= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").''; + $return.= '
'.$langs->trans("ErrorSupplierCountryIsNotDefined").'
'; } return $return; } From c91ab621b848180c0954043eb0d63e0c8081dfd2 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 21 Jan 2020 17:49:27 +0100 Subject: [PATCH 05/14] FIX length, width and height coherence in product table --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 47b190ed4f7..aa6dd5e08a8 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -819,9 +819,9 @@ class Product extends CommonObject $this->height = price2num($this->height); $this->height_units = trim($this->height_units); // set unit not defined - if ($this->length_units) { $this->width_units = $this->length_units; // Not used yet + if (is_numeric($this->length_units)) { $this->width_units = $this->length_units; // Not used yet } - if ($this->length_units) { $this->height_units = $this->length_units; // Not used yet + if (is_numeric($this->length_units)) { $this->height_units = $this->length_units; // Not used yet } // Automated compute surface and volume if not filled if (empty($this->surface) && !empty($this->length) && !empty($this->width) && $this->length_units == $this->width_units) { From 7a0bff06b93aa28e35ebcee6e82b1d78c70bd4db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 12:44:10 +0100 Subject: [PATCH 06/14] Fix reponsive --- htdocs/user/home.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/user/home.php b/htdocs/user/home.php index fbf90e44cc6..2bc273d1594 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -64,14 +64,13 @@ llxHeader(); print load_fiche_titre($langs->trans("MenuUsersAndGroups")); -//print ''; -//print '
'; print '
'; // Search User print '
'; print ''; + print ''; print ''; print ''; print "
'.$langs->trans("Search").'
'; @@ -86,6 +85,7 @@ if ($canreadperms) print '

\n"; + print '
'; print '
'; @@ -124,6 +124,8 @@ $resql=$db->query($sql); if ($resql) { $num = $db->num_rows($resql); + + print '
'; print ''; print ''; print ''; @@ -204,7 +206,8 @@ if ($resql) print ''; $i++; } - print "
'.$langs->trans("LastUsersCreated", min($num, $max)).''.$langs->trans("FullList").'

"; + print "
"; + print "
"; $db->free($resql); } @@ -240,6 +243,8 @@ if ($canreadperms) $colspan=1; if (! empty($conf->multicompany->enabled)) $colspan++; $num = $db->num_rows($resql); + + print '
'; print ''; print ''; print ''; @@ -275,7 +280,8 @@ if ($canreadperms) print ""; $i++; } - print "
'.$langs->trans("LastGroupsCreated", ($num ? $num : $max)).''.$langs->trans("FullList").'

"; + print ""; + print "

"; $db->free($resql); } From 0c666ee73baf22201bc17c235264c8f98b3bd421 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 12:46:01 +0100 Subject: [PATCH 07/14] Fix reponsive --- htdocs/user/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index c73825df145..eb14f61e982 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -519,7 +519,7 @@ while ($i < min($num, $limit)) print ""; if (! empty($arrayfields['u.login']['checked'])) { - print ''; + print ''; print $li; if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) { From de9942624710e97dddc18e508af6d668914cbc0b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 12:53:51 +0100 Subject: [PATCH 08/14] Fix MRP --- htdocs/core/modules/modMrp.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index 20c45dfe59b..a5d58bd8333 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -240,17 +240,17 @@ class modMrp extends DolibarrModules // Add here entries to declare new permissions /* BEGIN MODULEBUILDER PERMISSIONS */ $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) - $this->rights[$r][1] = 'Read objects of Mrp'; // Permission label + $this->rights[$r][1] = 'Read Manufacturing Order'; // Permission label $this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2) $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2) $r++; $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) - $this->rights[$r][1] = 'Create/Update objects of Mrp'; // Permission label + $this->rights[$r][1] = 'Create/Update Manufacturing Order'; // Permission label $this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2) $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2) $r++; $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) - $this->rights[$r][1] = 'Delete objects of Mrp'; // Permission label + $this->rights[$r][1] = 'Delete Manufacturing Order'; // Permission label $this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2) $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2) $r++; From 13a9a22cc5966377628f3e944f24631d6907bebf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:02:50 +0100 Subject: [PATCH 09/14] Fix responsive demo --- htdocs/public/demo/demo.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index 7f482367eba..9328a8ecd1b 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -110,6 +110,9 @@ img.demothumb { @media only screen and (max-width: 767px) { + .CTable { + width: 300px; + } .demobody { line-height: 150% !important; font-size: 100% !important; From d87419f3dbdfdf50aa00bd3e4735520de35c0489 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:34:07 +0100 Subject: [PATCH 10/14] FIX #11957 --- htdocs/comm/action/class/actioncomm.class.php | 6 +++++- htdocs/comm/action/index.php | 9 +++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 95cbd6beb7a..01f38eb531f 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1393,7 +1393,11 @@ class ActionComm extends CommonObject if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips - if ((!$user->rights->agenda->allactions->read && $this->authorid != $user->id) || (!$user->rights->agenda->myactions->read && $this->authorid == $user->id)) + $canread = 0; + if ($user->rights->agenda->myactions->read && $this->authorid == $user->id) $canread = 1; // Can read my event + if ($user->rights->agenda->myactions->read && array_key_exists($user->id, $this->userassigned)) $canread = 1; // Can read my event i am assigned + if ($user->rights->agenda->allactions->read) $canread = 1; // Can read all event of other + if (! $canread) { $option = 'nolink'; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index c4750ef54db..a9a832ea6b4 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1568,13 +1568,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $titletoshow = $daterange; $titletoshow .= ($titletoshow ? ' ' : '').($event->label ? $event->label : $event->libelle); - if ($event->type_code == 'ICALEVENT') print $titletoshow; - else - { + if ($event->type_code != 'ICALEVENT') { $savlabel = $event->label ? $event->label : $event->libelle; $event->label = $titletoshow; $event->libelle = $titletoshow; - print $event->getNomUrl(0, $maxnbofchar, 'cal_event', '', 0, 0); + // Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user. + $titletoshow = $event->getNomUrl(0, $maxnbofchar, 'cal_event', '', 0, 0); $event->label = $savlabel; $event->libelle = $savlabel; } @@ -1595,6 +1594,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $listofusertoshow .= $cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom'); } + + print $titletoshow; print $listofusertoshow; if ($event->type_code == 'ICALEVENT') print '
('.dol_trunc($event->icalname, $maxnbofchar).')'; From 0456994f0dd1973650c8ce44d9f14c41cd5df2d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:34:21 +0100 Subject: [PATCH 11/14] Responsive --- htdocs/langs/en_US/admin.lang | 2 +- htdocs/theme/eldy/global.inc.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8db158323a0..3c351467284 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -878,7 +878,7 @@ Permission1251=Run mass imports of external data into database (data load) Permission1321=Export customer invoices, attributes and payments Permission1322=Reopen a paid bill Permission1421=Export sales orders and attributes -Permission2401=Read actions (events or tasks) linked to his user account (if owner of event) +Permission2401=Read actions (events or tasks) linked to his user account (if owner of event or just assigned to) Permission2402=Create/modify actions (events or tasks) linked to his user account (if owner of event) Permission2403=Delete actions (events or tasks) linked to his user account (if owner of event) Permission2411=Read actions (events or tasks) of others diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 6d7dbb05b95..4b731808d2e 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3512,6 +3512,7 @@ div.info { padding-bottom: 8px; margin: 1em 0em 1em 0em; background: #eff8fc; + color: #666; } /* Warning message */ From 443e4e22230f4c069c58d5da73e5f70076aecfa3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:44:42 +0100 Subject: [PATCH 12/14] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cb46be383db..acbd15712e5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5044,11 +5044,11 @@ class Form { if ($societe_vendeuse->id == $mysoc->id) { - $return.= '
'.$langs->trans("ErrorYourCountryIsNotDefined").'
'; + $return.= ''.$langs->trans("ErrorYourCountryIsNotDefined").''; } else { - $return.= '
'.$langs->trans("ErrorSupplierCountryIsNotDefined").'
'; + $return.= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").''; } return $return; } From 999e36344616c199a8cf5ebb3ba28831f369036e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:52:37 +0100 Subject: [PATCH 13/14] Update charge.php --- htdocs/stripe/charge.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 3483efcaa18..992b5266b5b 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -142,7 +142,11 @@ if (!$rowid) } if (! empty($charge->payment_intent)) { - $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); + if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); + } else { + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); + } } // The metadata FULLTAG is defined by the online payment page From fc894d7a2002f2687955d1fe8653f27e9afeabe8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:53:20 +0100 Subject: [PATCH 14/14] Fix for stripe connect --- htdocs/public/payment/newpayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index dbceb483f97..729a8c68be6 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -658,7 +658,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) \Stripe\Stripe::setApiKey($stripearrayofkeysbyenv[$servicestatus]['secret_key']); try { - if (empty($key)) { // If the Stripe connect account not set, we use common API usage + if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage $paymentintent = \Stripe\PaymentIntent::retrieve($paymentintent_id); } else { $paymentintent = \Stripe\PaymentIntent::retrieve($paymentintent_id, array("stripe_account" => $stripeacc));