From 359dae6af876c8b970e0db79c54436b787539823 Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Sun, 29 Aug 2021 23:13:41 +0400 Subject: [PATCH 001/146] FIX #18542 REST API: set global $user variable to DolibarrApiAccess::user. --- htdocs/api/class/api_access.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php index 99582b62047..eaaa29d7aa1 100644 --- a/htdocs/api/class/api_access.class.php +++ b/htdocs/api/class/api_access.class.php @@ -80,7 +80,7 @@ class DolibarrApiAccess implements iAuthenticate public function __isAllowed() { // phpcs:enable - global $conf, $db; + global $conf, $db, $user; $login = ''; $stored_key = ''; @@ -149,6 +149,7 @@ class DolibarrApiAccess implements iAuthenticate } $fuser->getrights(); static::$user = $fuser; + $user = $fuser; if ($fuser->socid) { static::$role = 'external'; From 4381f67a64bc90c2c2df6b8a8084c169e5aef7e5 Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Mon, 30 Aug 2021 00:08:43 +0400 Subject: [PATCH 002/146] FIX #18544 Shipment REST API: load thirdparty object into the shipment before validating. --- htdocs/commande/class/api_orders.class.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 745fea5ab76..f5e9aea75bd 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -716,7 +716,9 @@ class Orders extends DolibarrApi if (!$result) { throw new RestException(404, 'Order not found'); } - + + $result = $this->commande->fetch_thirdparty(); // do not check result, as failure is not fatal (used only for mail notification substitutes) + if (!DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -729,13 +731,6 @@ class Orders extends DolibarrApi throw new RestException(500, 'Error when validating Order: '.$this->commande->error); } $result = $this->commande->fetch($id); - if (!$result) { - throw new RestException(404, 'Order not found'); - } - - if (!DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } $this->commande->fetchObjectLinked(); From 01a44760a868b8d2099f058738d4ed79bde68257 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 29 Aug 2021 20:14:19 +0000 Subject: [PATCH 003/146] Fixing style errors. --- htdocs/commande/class/api_orders.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index f5e9aea75bd..b550139cd94 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -716,9 +716,9 @@ class Orders extends DolibarrApi if (!$result) { throw new RestException(404, 'Order not found'); } - + $result = $this->commande->fetch_thirdparty(); // do not check result, as failure is not fatal (used only for mail notification substitutes) - + if (!DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } From 7bf6daaca7704e891198c385da7c5f0adcf1f433 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Mon, 30 Aug 2021 15:33:26 +0800 Subject: [PATCH 004/146] Update card.php --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6cf2f27844a..a784431c841 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -538,7 +538,7 @@ if (empty($reshook)) { } // If some payments were already done, we change the amount to pay using same prorate - if (!empty($conf->global->SUPPLIER_INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED)) { + if (!empty($conf->global->SUPPLIER_INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED) && $object->type == FactureFournisseur::TYPE_CREDIT_NOTE) { $alreadypaid = $object->getSommePaiement(); // This can be not 0 if we allow to create credit to reuse from credit notes partially refunded. if ($alreadypaid && abs($alreadypaid) < abs($object->total_ttc)) { $ratio = abs(($object->total_ttc - $alreadypaid) / $object->total_ttc); From 3240a3652dbd3959239b0e832f206b3353c41627 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Mon, 30 Aug 2021 15:34:59 +0800 Subject: [PATCH 005/146] Update card.php --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3deb7b346c5..a09bc6853d0 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -834,7 +834,7 @@ if (empty($reshook)) { } // If some payments were already done, we change the amount to pay using same prorate - if (!empty($conf->global->INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED)) { + if (!empty($conf->global->INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED) && $object->type == Facture::TYPE_CREDIT_NOTE) { $alreadypaid = $object->getSommePaiement(); // This can be not 0 if we allow to create credit to reuse from credit notes partially refunded. if ($alreadypaid && abs($alreadypaid) < abs($object->total_ttc)) { $ratio = abs(($object->total_ttc - $alreadypaid) / $object->total_ttc); From d09d036f06acfeb5959c3b4489ceac4008286328 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 31 Aug 2021 16:10:55 +0200 Subject: [PATCH 006/146] Fix supplier invoice pdf generation canelle Thirdparty wrongly fetched was causing errors on mass generation --- .../core/modules/supplier_invoice/pdf/pdf_canelle.modules.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 01f6369055b..3ef1bc45e5e 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -208,7 +208,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices global $user, $langs, $conf, $mysoc, $hookmanager, $nblines; // Get source company - if (!is_object($object->thirdparty)) $object->fetch_thirdparty(); + $object->fetch_thirdparty(); if (!is_object($object->thirdparty)) $object->thirdparty = $mysoc; // If fetch_thirdparty fails, object has no socid (specimen) $this->emetteur = $object->thirdparty; if (!$this->emetteur->country_code) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined @@ -224,8 +224,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices if ($conf->fournisseur->facture->dir_output) { - $object->fetch_thirdparty(); - $deja_regle = $object->getSommePaiement(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); $amount_credit_notes_included = $object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); $amount_deposits_included = $object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); From da8dcaa0c987eb4adb70045674ab891faf764b0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 12:15:23 +0200 Subject: [PATCH 007/146] Fix look and feel v14 --- htdocs/adherents/list.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 61226097d5c..ad78c2cb389 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -961,7 +961,8 @@ while ($i < min($num, $limit)) { // Firstname if (!empty($arrayfields['d.firstname']['checked'])) { print ''; - print $obj->firstname; + print $memberstatic->getNomUrl(0, 0, 'card', 'fistname'); + //print $obj->firstname; print "\n"; if (!$i) { $totalarray['nbfield']++; @@ -970,7 +971,8 @@ while ($i < min($num, $limit)) { // Lastname if (!empty($arrayfields['d.lastname']['checked'])) { print ''; - print $obj->lastname; + print $memberstatic->getNomUrl(0, 0, 'card', 'lastname'); + //print $obj->lastname; print "\n"; if (!$i) { $totalarray['nbfield']++; @@ -1100,7 +1102,9 @@ while ($i < min($num, $limit)) { } // EMail if (!empty($arrayfields['d.email']['checked'])) { - print ''.dol_print_email($obj->email, 0, 0, 1)."\n"; + print ''; + print dol_print_email($obj->email, 0, 0, 1, 64, 1, 1); + print "\n"; } // End of subscription date $datefin = $db->jdate($obj->datefin); From a48473ba7aa715474ce0a90b140caae02896bf24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 12:22:44 +0200 Subject: [PATCH 008/146] Missing trans exclude --- htdocs/langs/en_US/members.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index b193e1f34b6..7f62658891d 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -88,6 +88,7 @@ Moral=Corporation MorAndPhy=Corporation and Individual Reenable=Re-Enable ExcludeMember=Exclude a member +Exclude=Exclude ConfirmExcludeMember=Are you sure you want to exclude this member ? ResiliateMember=Terminate a member ConfirmResiliateMember=Are you sure you want to terminate this member? From bcd835ddbdd1e28f9a5b2d2b96117d1ba21c1fe1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 12:34:59 +0200 Subject: [PATCH 009/146] Fix tooltips --- htdocs/adherents/card.php | 4 ++-- htdocs/langs/en_US/members.lang | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 3ac82b893a7..7dd164c38b5 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1949,7 +1949,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($conf->societe->enabled) && !$object->socid) { if ($user->rights->societe->creer) { if (Adherent::STATUS_DRAFT != $object->statut) { - print ''.$langs->trans("CreateDolibarrThirdParty").''."\n";; + print ''.$langs->trans("CreateDolibarrThirdParty").''."\n";; } else { print ''.$langs->trans("CreateDolibarrThirdParty").''."\n"; } @@ -1962,7 +1962,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!$user->socid && !$object->user_id) { if ($user->rights->user->user->creer) { if (Adherent::STATUS_DRAFT != $object->statut) { - print ''.$langs->trans("CreateDolibarrLogin").''."\n"; + print ''.$langs->trans("CreateDolibarrLogin").''."\n"; } else { print ''.$langs->trans("CreateDolibarrLogin").''."\n"; } diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 7f62658891d..1e347aba63c 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -216,3 +216,5 @@ YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this emai XMembersClosed=%s member(s) closed XExternalUserCreated=%s external user(s) created ForceMemberNature=Force member nature (Individual or Corporation) +CreateDolibarrLoginDesc=The creation of a user login for members allows them to connect to the application. Depending on the authorizations granted, they will be able, for example, to consult or modify their file themselves. +CreateDolibarrThirdPartyDesc=A thirdparty is the legal entity that will be used on the invoice if you decide to generate invoice for each subscription. You will be able to create it later during the subscription process. From fb0bd41178e02d590368a38e7361932774f3829f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 13:02:36 +0200 Subject: [PATCH 010/146] Fix trans --- htdocs/langs/en_US/members.lang | 100 ++++++++++++++++---------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 1e347aba63c..06f591cc5ab 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -19,8 +19,8 @@ MembersCards=Business cards for members MembersList=List of members MembersListToValid=List of draft members (to be validated) MembersListValid=List of valid members -MembersListUpToDate=List of valid members with up-to-date subscription -MembersListNotUpToDate=List of valid members with out-of-date subscription +MembersListUpToDate=List of valid members with up-to-date contribution +MembersListNotUpToDate=List of valid members with out-of-date contribution MembersListExcluded=List of excluded members MembersListResiliated=List of terminated members MembersListQualified=List of qualified members @@ -28,13 +28,13 @@ MenuMembersToValidate=Draft members MenuMembersValidated=Validated members MenuMembersExcluded=Excluded members MenuMembersResiliated=Terminated members -MembersWithSubscriptionToReceive=Members with subscription to receive -MembersWithSubscriptionToReceiveShort=Subscription to receive -DateSubscription=Subscription date -DateEndSubscription=Subscription end date -EndSubscription=Subscription Ends -SubscriptionId=Subscription id -WithoutSubscription=Without subscription +MembersWithSubscriptionToReceive=Members with contribution to receive +MembersWithSubscriptionToReceiveShort=Membership contribution to receive +DateSubscription=Date of membership +DateEndSubscription=End date of membership +EndSubscription=End of membership +SubscriptionId=Contribution ID +WithoutSubscription=Without contribution MemberId=Member id NewMember=New member MemberType=Member type @@ -43,9 +43,9 @@ MemberTypeLabel=Member type label MembersTypes=Members types MemberStatusDraft=Draft (needs to be validated) MemberStatusDraftShort=Draft -MemberStatusActive=Validated (waiting subscription) +MemberStatusActive=Validated (waiting contribution) MemberStatusActiveShort=Validated -MemberStatusActiveLate=Subscription expired +MemberStatusActiveLate=Contribution expired MemberStatusActiveLateShort=Expired MemberStatusPaid=Subscription up to date MemberStatusPaidShort=Up to date @@ -56,9 +56,9 @@ MemberStatusResiliatedShort=Terminated MembersStatusToValid=Draft members MembersStatusExcluded=Excluded members MembersStatusResiliated=Terminated members -MemberStatusNoSubscription=Validated (no subscription needed) +MemberStatusNoSubscription=Validated (no contribution required) MemberStatusNoSubscriptionShort=Validated -SubscriptionNotNeeded=No subscription needed +SubscriptionNotNeeded=No contribution required NewCotisation=New contribution PaymentSubscription=New contribution payment SubscriptionEndDate=Subscription's end date @@ -70,17 +70,17 @@ MemberTypeDeleted=Member type deleted MemberTypeCanNotBeDeleted=Member type can not be deleted NewSubscription=New subscription NewSubscriptionDesc=This form allows you to record your subscription as a new member of the foundation. If you want to renew your subscription (if already a member), please contact foundation board instead by email %s. -Subscription=Subscription -Subscriptions=Subscriptions +Subscription=Contribution +Subscriptions=Contributions SubscriptionLate=Late -SubscriptionNotReceived=Subscription never received -ListOfSubscriptions=List of subscriptions +SubscriptionNotReceived=Contribution never received +ListOfSubscriptions=List of contributions SendCardByMail=Send card by email AddMember=Create member NoTypeDefinedGoToSetup=No member types defined. Go to menu "Members types" NewMemberType=New member type WelcomeEMail=Welcome email -SubscriptionRequired=Subscription required +SubscriptionRequired=Contribution required DeleteType=Delete VoteAllowed=Vote allowed Physical=Individual @@ -93,43 +93,43 @@ ConfirmExcludeMember=Are you sure you want to exclude this member ? ResiliateMember=Terminate a member ConfirmResiliateMember=Are you sure you want to terminate this member? DeleteMember=Delete a member -ConfirmDeleteMember=Are you sure you want to delete this member (Deleting a member will delete all his subscriptions)? +ConfirmDeleteMember=Are you sure you want to delete this member (Deleting a member will delete all his contributions)? DeleteSubscription=Delete a subscription -ConfirmDeleteSubscription=Are you sure you want to delete this subscription? +ConfirmDeleteSubscription=Are you sure you want to delete this contribution? Filehtpasswd=htpasswd file ValidateMember=Validate a member ConfirmValidateMember=Are you sure you want to validate this member? FollowingLinksArePublic=The following links are open pages not protected by any Dolibarr permission. They are not formatted pages, provided as example to show how to list members database. PublicMemberList=Public member list -BlankSubscriptionForm=Public self-subscription form +BlankSubscriptionForm=Public self-registration form BlankSubscriptionFormDesc=Dolibarr can provide you a public URL/website to allow external visitors to ask to subscribe to the foundation. If an online payment module is enabled, a payment form may also be automatically provided. EnablePublicSubscriptionForm=Enable the public website with self-subscription form ForceMemberType=Force the member type -ExportDataset_member_1=Members and subscriptions +ExportDataset_member_1=Members and contributions ImportDataset_member_1=Members LastMembersModified=Latest %s modified members -LastSubscriptionsModified=Latest %s modified subscriptions +LastSubscriptionsModified=Latest %s modified contributions String=String Text=Text Int=Int DateAndTime=Date and time PublicMemberCard=Member public card -SubscriptionNotRecorded=Subscription not recorded -AddSubscription=Create subscription -ShowSubscription=Show subscription +SubscriptionNotRecorded=Contribution not recorded +AddSubscription=Create contribution +ShowSubscription=Show contribution # Label of email templates SendingAnEMailToMember=Sending information email to member SendingEmailOnAutoSubscription=Sending email on auto registration SendingEmailOnMemberValidation=Sending email on new member validation -SendingEmailOnNewSubscription=Sending email on new subscription -SendingReminderForExpiredSubscription=Sending reminder for expired subscriptions +SendingEmailOnNewSubscription=Sending email on new contribution +SendingReminderForExpiredSubscription=Sending reminder for expired contributions SendingEmailOnCancelation=Sending email on cancelation SendingReminderActionComm=Sending reminder for agenda event # Topic of email templates YourMembershipRequestWasReceived=Your membership was received. YourMembershipWasValidated=Your membership was validated -YourSubscriptionWasRecorded=Your new subscription was recorded -SubscriptionReminderEmail=Subscription reminder +YourSubscriptionWasRecorded=Your new contribution was recorded +SubscriptionReminderEmail=contribution reminder YourMembershipWasCanceled=Your membership was canceled CardContent=Content of your member card # Text of email templates @@ -140,10 +140,10 @@ ThisIsContentOfSubscriptionReminderEmail=We want to let you know that your subsc ThisIsContentOfYourCard=This is a summary of the information we have about you. Please contact us if anything is incorrect.

DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Subject of the notification email received in case of auto-inscription of a guest DescADHERENT_AUTOREGISTER_NOTIF_MAIL=Content of the notification email received in case of auto-inscription of a guest -DescADHERENT_EMAIL_TEMPLATE_AUTOREGISTER=Email template to use to send email to a member on member autosubscription +DescADHERENT_EMAIL_TEMPLATE_AUTOREGISTER=Email template to use to send email to a member on member auto-registration DescADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION=Email template to use to send email to a member on member validation -DescADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION=Email template to use to send email to a member on new subscription recording -DescADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION=Email template to use to send email reminder when subscription is about to expire +DescADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION=Email template to use to send email to a member on new contribution recording +DescADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION=Email template to use to send email reminder when contribution is about to expire DescADHERENT_EMAIL_TEMPLATE_CANCELATION=Email template to use to send email to a member on member cancelation DescADHERENT_EMAIL_TEMPLATE_EXCLUSION=Email template to use to send email to a member on member exclusion DescADHERENT_MAIL_FROM=Sender Email for automatic emails @@ -157,9 +157,9 @@ DescADHERENT_CARD_FOOTER_TEXT=Text printed on bottom of member cards ShowTypeCard=Show type '%s' HTPasswordExport=htpassword file generation NoThirdPartyAssociatedToMember=No third party associated with this member -MembersAndSubscriptions= Members and Subscriptions +MembersAndSubscriptions=Members and Contributions MoreActions=Complementary action on recording -MoreActionsOnSubscription=Complementary action, suggested by default when recording a subscription +MoreActionsOnSubscription=Complementary action, suggested by default when recording a contribution MoreActionBankDirect=Create a direct entry on bank account MoreActionBankViaInvoice=Create an invoice, and a payment on bank account MoreActionInvoiceOnly=Create an invoice with no payment @@ -168,9 +168,9 @@ LinkToGeneratedPagesDesc=This screen allows you to generate PDF files with busin DocForAllMembersCards=Generate business cards for all members DocForOneMemberCards=Generate business cards for a particular member DocForLabels=Generate address sheets -SubscriptionPayment=Subscription payment -LastSubscriptionDate=Date of latest subscription payment -LastSubscriptionAmount=Amount of latest subscription +SubscriptionPayment=Contribution payment +LastSubscriptionDate=Date of latest contribution payment +LastSubscriptionAmount=Amount of latest contribution LastMemberType=Last Member type MembersStatisticsByCountries=Members statistics by country MembersStatisticsByState=Members statistics by state/province @@ -187,34 +187,34 @@ MembersByRegion=This screen show you statistics of members by region. MembersStatisticsDesc=Choose statistics you want to read... MenuMembersStats=Statistics LastMemberDate=Latest membership date -LatestSubscriptionDate=Latest subscription date +LatestSubscriptionDate=Latest contribution date MemberNature=Nature of the member MembersNature=Nature of the members Public=Information is public NewMemberbyWeb=New member added. Awaiting approval NewMemberForm=New member form -SubscriptionsStatistics=Subscriptions statistics -NbOfSubscriptions=Number of subscriptions -AmountOfSubscriptions=Amount collected from subscriptions +SubscriptionsStatistics=Contributions statistics +NbOfSubscriptions=Number of contributions +AmountOfSubscriptions=Amount collected from contributions TurnoverOrBudget=Turnover (for a company) or Budget (for a foundation) -DefaultAmount=Default amount of subscription -CanEditAmount=Visitor can choose/edit amount of its subscription +DefaultAmount=Default amount of contribution +CanEditAmount=Visitor can choose/edit amount of its contribution MEMBER_NEWFORM_PAYONLINE=Jump on integrated online payment page ByProperties=By nature MembersStatisticsByProperties=Members statistics by nature -VATToUseForSubscriptions=VAT rate to use for subscriptions -NoVatOnSubscription=No VAT for subscriptions -ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS=Product used for subscription line into invoice: %s +VATToUseForSubscriptions=VAT rate to use for contributionss +NoVatOnSubscription=No VAT for contributions +ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS=Product used for contribution line into invoice: %s NameOrCompany=Name or company SubscriptionRecorded=Subscription recorded NoEmailSentToMember=No email sent to member EmailSentToMember=Email sent to member at %s -SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription -SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind. It can be a list of days separated by a semicolon, for example '10;5;0;-5') +SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired contributions +SendReminderForExpiredSubscription=Send reminder by email to members when contribution is about to expire (parameter is number of days before end of membership to send the remind. It can be a list of days separated by a semicolon, for example '10;5;0;-5') MembershipPaid=Membership paid for current period (until %s) YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email XMembersClosed=%s member(s) closed XExternalUserCreated=%s external user(s) created ForceMemberNature=Force member nature (Individual or Corporation) CreateDolibarrLoginDesc=The creation of a user login for members allows them to connect to the application. Depending on the authorizations granted, they will be able, for example, to consult or modify their file themselves. -CreateDolibarrThirdPartyDesc=A thirdparty is the legal entity that will be used on the invoice if you decide to generate invoice for each subscription. You will be able to create it later during the subscription process. +CreateDolibarrThirdPartyDesc=A thirdparty is the legal entity that will be used on the invoice if you decide to generate invoice for each contribution. You will be able to create it later during the process of recording the contribution. From 375557e092c71f6a4ff45a163304d7f4bf34f3c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 15:10:02 +0200 Subject: [PATCH 011/146] FIX Menu List of project was not visible. --- htdocs/core/menus/standard/eldy.lib.php | 4 ++-- htdocs/projet/card.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index d0b30d97398..75055329add 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1732,7 +1732,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $titleboth = $langs->trans("LeadsOrProjects"); $titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default - if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) { + if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $titleboth = $langs->trans("Projects"); $titlenew = $langs->trans("NewProject"); } @@ -1745,7 +1745,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="pictofixedwidth"')); $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->rights->projet->creer); - if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) { + if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); } elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 1) { $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list'); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 1a8cd850cbf..941f7ce0613 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -461,7 +461,7 @@ llxHeader("", $title, $help_url); $titleboth = $langs->trans("LeadsOrProjects"); $titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default -if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) { +if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $titleboth = $langs->trans("Projects"); $titlenew = $langs->trans("NewProject"); } From bae73b9a52bf29749ef0a37fca53605672f80e38 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 1 Sep 2021 15:16:11 +0200 Subject: [PATCH 012/146] disabled module on inactive --- htdocs/core/modules/modProjet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 25448f239e6..c006a10aa81 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -66,7 +66,7 @@ class modProjet extends DolibarrModules // Dependencies $this->hidden = false; // A condition to hide module $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled - $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->requiredby = array('modEventOrganization'); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array('projects'); From 65ccbb6249d8a1dd3a0db2ede8294293bc2f2ab1 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Tue, 31 Aug 2021 12:25:36 +0200 Subject: [PATCH 013/146] Regroup BILL_SUPPLIER_VALIDATE triggers under the same condition --- .../triggers/interface_20_modWorkflow_WorkflowManager.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index c6b2d38a99d..60c9983dafc 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -208,7 +208,6 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } } - return $ret; } // Second classify billed the proposal. From 59e917cd5f24e819466c0dd799982c37920675ad Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Tue, 31 Aug 2021 12:25:50 +0200 Subject: [PATCH 014/146] regroup BILL_SUPPLIER_VALIDATE actions Conflicts: htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php --- ...e_20_modWorkflow_WorkflowManager.class.php | 57 ++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 60c9983dafc..e15509aa98b 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -191,7 +191,8 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'BILL_SUPPLIER_VALIDATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - // First classify billed the order to allow the proposal classify process + // Firstly, we set to purchase order to "Billed" if WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER is set. + // After we will set proposals if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) { $object->fetchObjectLinked('', 'order_supplier', $object->id, $object->element); if (!empty($object->linkedObjects)) { @@ -205,12 +206,15 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) { foreach ($object->linkedObjects['order_supplier'] as $element) { $ret = $element->classifyBilled($user); + if ($ret < 0) { + return $ret; + } } } } } - // Second classify billed the proposal. + // Secondly, we set to linked Proposal to "Billed" if WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL is set. if (!empty($conf->supplier_proposal->enabled) && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL)) { $object->fetchObjectLinked('', 'supplier_proposal', $object->id, $object->element); if (!empty($object->linkedObjects)) { @@ -224,11 +228,35 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) { foreach ($object->linkedObjects['supplier_proposal'] as $element) { $ret = $element->classifyBilled($user); + if ($ret < 0) { + return $ret; + } } } } - return $ret; } + + // Then set reception to "Billed" if WORKFLOW_BILL_ON_RECEPTION is set + if (!empty($conf->reception->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { + $object->fetchObjectLinked('', 'reception', $object->id, $object->element); + if (!empty($object->linkedObjects)) { + $totalonlinkedelements = 0; + foreach ($object->linkedObjects['reception'] as $element) { + if ($element->statut == Reception::STATUS_VALIDATED) $totalonlinkedelements += $element->total_ht; + } + dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG); + if ($totalonlinkedelements == $object->total_ht) { + foreach ($object->linkedObjects['reception'] as $element) { + $ret = $element->set_billed(); + if ($ret < 0) { + return $ret; + } + } + } + } + } + + return $ret; } // Invoice classify billed order @@ -317,29 +345,6 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } } - // classify billed reception - if ($action == 'BILL_SUPPLIER_VALIDATE') { - dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id, LOG_DEBUG); - - if (!empty($conf->reception->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { - $object->fetchObjectLinked('', 'reception', $object->id, $object->element); - if (!empty($object->linkedObjects)) { - $totalonlinkedelements = 0; - foreach ($object->linkedObjects['reception'] as $element) { - if ($element->statut == Reception::STATUS_VALIDATED) { - $totalonlinkedelements += $element->total_ht; - } - } - dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG); - if ($totalonlinkedelements == $object->total_ht) { - foreach ($object->linkedObjects['reception'] as $element) { - $ret = $element->setBilled(); - } - } - } - return $ret; - } - } return 0; } From 14ca7db5d77bfd0fe0f77cfa3a645f0e101c9969 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 16:17:31 +0200 Subject: [PATCH 015/146] Typo in log --- .../triggers/interface_20_modWorkflow_WorkflowManager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index e15509aa98b..db3b3c56855 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -244,7 +244,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers foreach ($object->linkedObjects['reception'] as $element) { if ($element->statut == Reception::STATUS_VALIDATED) $totalonlinkedelements += $element->total_ht; } - dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG); + dol_syslog("Amount of linked reception = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG); if ($totalonlinkedelements == $object->total_ht) { foreach ($object->linkedObjects['reception'] as $element) { $ret = $element->set_billed(); From 2bad48bdcc5dd7e47251612b3997d224d6690d57 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Tue, 31 Aug 2021 09:26:00 +0200 Subject: [PATCH 016/146] FournisseurCommandDispatch extends CommonObjectLine instead of CommonObject --- htdocs/fourn/class/fournisseur.commande.dispatch.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index cd1ff267fb7..b2c4d101b74 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT."/reception/class/reception.class.php"; /** * Class to manage table commandefournisseurdispatch */ -class CommandeFournisseurDispatch extends CommonObject +class CommandeFournisseurDispatch extends CommonObjectLine { /** * @var DoliDB Database handler. From b66bd781a438cf4240331c01f517f0f7936a490f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 16:26:59 +0200 Subject: [PATCH 017/146] Clean code --- htdocs/core/class/commonobjectline.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index f821e5050b1..7e134aa19bf 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -71,7 +71,7 @@ abstract class CommonObjectLine extends CommonObject { global $langs; - if (!$this->fk_unit) { + if (empty($this->fk_unit)) { return ''; } @@ -86,7 +86,7 @@ abstract class CommonObjectLine extends CommonObject $label_type = 'code'; } - $sql = 'select '.$label_type.', code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit; + $sql = 'select '.$label_type.', code from '.MAIN_DB_PREFIX.'c_units where rowid = '.((int) $this->fk_unit); $resql = $this->db->query($sql); if ($resql && $this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); From 443827ff42a04b62715cf69426fc899bc75968bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 17:10:26 +0200 Subject: [PATCH 018/146] FIX #18531 --- htdocs/comm/action/card.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 245f90edf72..461002029ae 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -70,6 +70,10 @@ $offsetvalue = GETPOST('offsetvalue', 'int'); $offsetunit = GETPOST('offsetunittype_duration', 'aZ09'); $remindertype = GETPOST('selectremindertype', 'aZ09'); $modelmail = GETPOST('actioncommsendmodel_mail', 'int'); +$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed +if ($complete == 'na' || $complete == -2) { + $complete = -1; +} $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int')); $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int')); @@ -240,7 +244,7 @@ if (empty($reshook) && $action == 'add') { exit; } - $percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status + $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status // Clean parameters $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser'); @@ -471,7 +475,7 @@ if (empty($reshook) && $action == 'update') { $apmin = GETPOST('apmin', 'int'); $p2hour = GETPOST('p2hour', 'int'); $p2min = GETPOST('p2min', 'int'); - $percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status + $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status // Clean parameters if ($aphour == -1) { @@ -1074,15 +1078,15 @@ if ($action == 'create') { // Status print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; print ''; - $percent = GETPOST('complete')!=='' ? GETPOST('complete') : -1; + $percent = $complete !=='' ? $complete : -1; if (GETPOSTISSET('status')) { $percent = GETPOST('status'); } elseif (GETPOSTISSET('percentage')) { - $percent = GETPOST('percentage'); + $percent = GETPOST('percentage', 'int'); } else { - if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) { + if ($complete == '0' || GETPOST("afaire") == 1) { $percent = '0'; - } elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) { + } elseif ($complete == 100 || GETPOST("afaire") == 2) { $percent = 100; } } @@ -1348,7 +1352,7 @@ if ($id > 0) { $result5 = $object->fetch_optionals(); if ($listUserAssignedUpdated || $donotclearsession) { - $percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status + $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser'); $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser'); @@ -1542,7 +1546,7 @@ if ($id > 0) { // Status print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - $percent = GETPOST("percentage") ? GETPOST("percentage") : $object->percentage; + $percent = GETPOSTISSET("percentage") ? GETPOST("percentage", "int") : $object->percentage; $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); print ''; From 3e4d7dfaba3d4ff686402c071603bfb050627061 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 17:44:54 +0200 Subject: [PATCH 019/146] Fix $_SERVER["PHP_SEFL"] into $_SERVER["PHP_SELF"] --- htdocs/website/index.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 23be98a3b8c..d069df8c4d5 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2602,7 +2602,7 @@ if (!GETPOST('hide_websitemenu')) { print $langs->trans("Website").' : '; print ''; - $urltocreatenewwebsite = $_SERVER["PHP_SEFL"].'?action=createsite'; + $urltocreatenewwebsite = $_SERVER["PHP_SELF"].'?action=createsite'; if (empty($conf->use_javascript_ajax)) { print ''; print ''; @@ -2652,7 +2652,7 @@ if (!GETPOST('hide_websitemenu')) { $out .= ' if (jQuery("#website option:selected").val() == \'-2\') {'; $out .= ' window.location.href = "'.dol_escape_js($urltocreatenewwebsite).'";'; $out .= ' } else {'; - $out .= ' window.location.href = "'.$_SERVER["PHP_SEFL"].'?website="+jQuery("#website option:selected").val();'; + $out .= ' window.location.href = "'.$_SERVER["PHP_SELF"].'?website="+jQuery("#website option:selected").val();'; $out .= ' }'; $out .= ' });'; $out .= '});'; @@ -2691,16 +2691,16 @@ if (!GETPOST('hide_websitemenu')) { print ''; // Regenerate all pages - print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'">'; + print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'">'; print '   '; // Generate site map - print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateSitemaps")).'">'; + print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateSitemaps")).'">'; print '   '; - print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'">'; + print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'">'; } print ''; @@ -2811,7 +2811,7 @@ if (!GETPOST('hide_websitemenu')) { print ''; print ''; - print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'">'; + print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'">'; print ''; //print ''; @@ -2826,7 +2826,7 @@ if (!GETPOST('hide_websitemenu')) { $out .= $s; $out .= ''; - $urltocreatenewpage = $_SERVER["PHP_SEFL"].'?action=createcontainer&website='.$website->ref; + $urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&website='.$website->ref; if (!empty($conf->use_javascript_ajax)) { $out .= ''; + jQuery(document).ready(function () { + jQuery(document).ready(function () { + jQuery("#selectcountry_id").change(function() { + document.newmember.action.value="create"; + document.newmember.submit(); + }); + }); + }); + '; print '' . "\n"; @@ -605,6 +603,8 @@ jQuery(document).ready(function () { print "\n"; print "
"; print ''; +} else { + print $langs->trans("ConferenceIsNotConfirmed"); } llxFooterVierge(); From 2e3b6b2fc8022df39600de4902ec302e5c2200c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Sep 2021 18:00:28 +0200 Subject: [PATCH 035/146] Backport sql injection fix from develop --- htdocs/compta/facture/class/facture.class.php | 4 ++-- htdocs/fourn/facture/card.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6859a510e93..02889c4c4ef 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -678,8 +678,8 @@ class Facture extends CommonInvoice $sql .= ", ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'" : "null"); $sql .= ", ".($user->id > 0 ? (int) $user->id : "null"); $sql .= ", ".($this->fk_project ? $this->fk_project : "null"); - $sql .= ", ".$this->cond_reglement_id; - $sql .= ", ".$this->mode_reglement_id; + $sql .= ", ".((int) $this->cond_reglement_id); + $sql .= ", ".((int) $this->mode_reglement_id); $sql .= ", '".$this->db->idate($this->date_lim_reglement)."'"; $sql .= ", ".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null"); $sql .= ", ".($this->situation_cycle_ref ? "'".$this->db->escape($this->situation_cycle_ref)."'" : "null"); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a784431c841..04d99240f6b 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -725,8 +725,8 @@ if (empty($reshook)) { $object->date_echeance = $datedue; $object->note_public = GETPOST('note_public', 'restricthtml'); $object->note_private = GETPOST('note_private', 'restricthtml'); - $object->cond_reglement_id = GETPOST('cond_reglement_id'); - $object->mode_reglement_id = GETPOST('mode_reglement_id'); + $object->cond_reglement_id = GETPOST('cond_reglement_id', 'int'); + $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); $object->fk_account = GETPOST('fk_account', 'int'); $object->fk_project = ($tmpproject > 0) ? $tmpproject : null; $object->fk_incoterms = GETPOST('incoterm_id', 'int'); @@ -736,7 +736,7 @@ if (empty($reshook)) { $object->transport_mode_id = GETPOST('transport_mode_id', 'int'); // Proprietes particulieres a facture de remplacement - $object->fk_facture_source = GETPOST('fac_replacement'); + $object->fk_facture_source = GETPOST('fac_replacement', 'int'); $object->type = FactureFournisseur::TYPE_REPLACEMENT; $id = $object->createFromCurrent($user); From b13fc30a0a7a96ac152b68813aade802cf032234 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 4 Sep 2021 12:25:40 +0800 Subject: [PATCH 036/146] Update dolibarr.php --- htdocs/admin/system/dolibarr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 0271488b65a..a39d4dc2a8c 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -505,7 +505,7 @@ if ($resql) { $obj = $db->fetch_object($resql); print ''; - print ''."\n"; + print ''."\n"; print '
'.$obj->name.''.$obj->name.''; if (isASecretKey($obj->name)) { if (empty($dolibarr_main_prod)) { From 456f25d57e95ed5528e3f1eb08a034f5268547ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 4 Sep 2021 11:30:03 +0200 Subject: [PATCH 037/146] fix #17634 --- htdocs/main.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a56054b9594..cc2a21b9f84 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1766,6 +1766,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '') global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; + $langs->load('companies'); $userImage = $userDropDownImage = ''; if (!empty($user->photo)) { From 4e7549ab7d4be8ef14b1970e0f540192be714731 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 4 Sep 2021 13:53:31 +0200 Subject: [PATCH 038/146] css --- htdocs/core/tpl/login.tpl.php | 4 ++-- htdocs/core/tpl/passwordforgotten.tpl.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 1d25249da75..7b20e7209f7 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -196,7 +196,7 @@ if ($disablenofollow) {
-
+
diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 6c6e2ca9dc3..6fe5ddad2d6 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -146,7 +146,7 @@ if (!empty($captcha)) { ?>
-
+
@@ -186,7 +186,7 @@ if (!empty($morelogincontent)) {
-
class="button" name="button_password" value="trans('SendNewPassword'); ?>" tabindex="4" /> +
class="button small" name="button_password" value="trans('SendNewPassword'); ?>" tabindex="4" />
From b58684af980dcfb132094213d6d42db2e4d07165 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Sep 2021 14:31:33 +0200 Subject: [PATCH 039/146] Fix trans --- htdocs/langs/en_US/contracts.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index 49a65fdb39d..937c5a7397b 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -36,7 +36,7 @@ CloseAContract=Close a contract ConfirmDeleteAContract=Are you sure you want to delete this contract and all its services? ConfirmValidateContract=Are you sure you want to validate this contract under name %s? ConfirmActivateAllOnContract=This will open all services (not yet active). Are you sure you want to open all services? -ConfirmCloseContract=This will close all services (active or not). Are you sure you want to close this contract? +ConfirmCloseContract=This will close all services (expired or not). Are you sure you want to close this contract? ConfirmCloseService=Are you sure you want to close this service with date %s? ValidateAContract=Validate a contract ActivateService=Activate service From 1c97393a6900c8e1af792408fe405842b90494c0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 5 Sep 2021 15:35:06 +0200 Subject: [PATCH 040/146] FIX increase maxlength of password input --- htdocs/user/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index cb7aa69949c..8622e293906 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2018 Regis Houssin + * Copyright (C) 2005-2021 Regis Houssin * Copyright (C) 2005 Lionel Cousteix * Copyright (C) 2011 Herve Prot * Copyright (C) 2012-2018 Juanjo Menent @@ -2290,7 +2290,7 @@ if ($action == 'create' || $action == 'adduserldap') { } if (preg_match('/dolibarr/', $dolibarr_main_authentication)) { if ($caneditpassword) { - $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; + $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; } else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass); } From 5850b68f79408942047794291ccf6454c548fa3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 03:22:06 +0200 Subject: [PATCH 041/146] Fix css --- htdocs/salaries/paiement_salary.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index a266a2ed88b..749ce8f9575 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -315,8 +315,11 @@ if ($action == 'create') { print "
"; // Bouton Save payment - print '
'.$langs->trans("ClosePaidSalaryAutomatically"); - print '
'; + print '
'; + print '
'; + print '
'; + print '
'; + print ''; print '     '; print ''; print '
'; From e4767e91eaccf5f3b3e8ddccdd06092069229e1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 03:26:43 +0200 Subject: [PATCH 042/146] Fix css --- htdocs/salaries/paiement_salary.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 749ce8f9575..86a0e787e84 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -317,8 +317,7 @@ if ($action == 'create') { // Bouton Save payment print '
'; print '
'; - print '
'; - print '
'; + print '
'; print ''; print '     '; print ''; From b782e5986a27317cad94e7e3cc114f07b823dfa4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 03:29:46 +0200 Subject: [PATCH 043/146] Fix css --- htdocs/compta/tva/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index daf5afb025e..2f3f4edf83c 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -437,7 +437,7 @@ if ($action == 'create') { print '
'; // Auto create payment - print ''.$langs->trans('AutomaticCreationPayment').''; + print ''; print ''."\n"; print ''; From be1c08ddfe322c8f44a5e4a7474bd39f6f630bec Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 6 Sep 2021 12:30:39 +0200 Subject: [PATCH 044/146] FIX : salary extrafields don't work and table is not well named --- htdocs/core/tpl/extrafields_view.tpl.php | 3 +++ .../install/mysql/migration/13.0.0-14.0.0.sql | 2 ++ ...key.sql => llx_salary_extrafields.key.sql} | 2 +- ...afields.sql => llx_salary_extrafields.sql} | 4 ++-- .../salaries/admin/salaries_extrafields.php | 2 +- htdocs/salaries/card.php | 24 +++++++++++++++++++ 6 files changed, 33 insertions(+), 4 deletions(-) rename htdocs/install/mysql/tables/{llx_payment_salary_extrafields.key.sql => llx_salary_extrafields.key.sql} (89%) rename htdocs/install/mysql/tables/{llx_payment_salary_extrafields.sql => llx_salary_extrafields.sql} (91%) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 3f2ab773b06..0a2348f5858 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -194,6 +194,9 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l if ($object->element == 'contact') { $permok = $user->rights->societe->contact->creer; } + if($object->element == 'salary') { + $permok = $user->rights->salaries->read; + } $isdraft = ((isset($object->statut) && $object->statut == 0) || (isset($object->status) && $object->status == 0)); if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra])) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index d50b6991261..7c1815377be 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -349,6 +349,8 @@ UPDATE llx_payment_salary SET ref = rowid WHERE ref IS NULL; ALTER TABLE llx_salary ALTER COLUMN paye set default 0; +ALTER TABLE llx_payment_salary_extrafields RENAME TO llx_salary_extrafields; + DELETE FROM llx_boxes WHERE box_id IN (SELECT rowid FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php')); DELETE FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php'); diff --git a/htdocs/install/mysql/tables/llx_payment_salary_extrafields.key.sql b/htdocs/install/mysql/tables/llx_salary_extrafields.key.sql similarity index 89% rename from htdocs/install/mysql/tables/llx_payment_salary_extrafields.key.sql rename to htdocs/install/mysql/tables/llx_salary_extrafields.key.sql index 9231351a749..9c6e047d9ee 100644 --- a/htdocs/install/mysql/tables/llx_payment_salary_extrafields.key.sql +++ b/htdocs/install/mysql/tables/llx_salary_extrafields.key.sql @@ -17,4 +17,4 @@ -- =================================================================== -ALTER TABLE llx_payment_salary_extrafields ADD INDEX idx_payment_salary_extrafields (fk_object); +ALTER TABLE llx_salary_extrafields ADD INDEX idx_salary_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_payment_salary_extrafields.sql b/htdocs/install/mysql/tables/llx_salary_extrafields.sql similarity index 91% rename from htdocs/install/mysql/tables/llx_payment_salary_extrafields.sql rename to htdocs/install/mysql/tables/llx_salary_extrafields.sql index 5f15918ef18..bedab6757b4 100644 --- a/htdocs/install/mysql/tables/llx_payment_salary_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_salary_extrafields.sql @@ -16,10 +16,10 @@ -- -- =================================================================== -create table llx_payment_salary_extrafields +create table llx_salary_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_object integer NOT NULL, -- salary payment id + fk_object integer NOT NULL, -- salary id import_key varchar(14) -- import key )ENGINE=innodb; diff --git a/htdocs/salaries/admin/salaries_extrafields.php b/htdocs/salaries/admin/salaries_extrafields.php index 38303518ac4..2354da8048a 100644 --- a/htdocs/salaries/admin/salaries_extrafields.php +++ b/htdocs/salaries/admin/salaries_extrafields.php @@ -42,7 +42,7 @@ foreach ($tmptype2label as $key => $val) { $action = GETPOST('action', 'aZ09'); $attrname = GETPOST('attrname', 'alpha'); -$elementtype = 'payment_salary'; //Must be the $table_element of the class that manage extrafield +$elementtype = 'salary'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) { accessforbidden(); diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index d3c7ba504cb..d3cbc5d3904 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -354,6 +354,30 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->salaries- } } +// Action to update one extrafield +if ($action == "update_extras" && !empty($user->rights->salaries->read)) { + $object->fetch(GETPOST('id', 'int')); + + $attributekey = GETPOST('attribute', 'alpha'); + $attributekeylong = 'options_'.$attributekey; + + if (GETPOSTISSET($attributekeylong.'day') && GETPOSTISSET($attributekeylong.'month') && GETPOSTISSET($attributekeylong.'year')) { + // This is properties of a date + $object->array_options['options_'.$attributekey] = dol_mktime(GETPOST($attributekeylong.'hour', 'int'), GETPOST($attributekeylong.'min', 'int'), GETPOST($attributekeylong.'sec', 'int'), GETPOST($attributekeylong.'month', 'int'), GETPOST($attributekeylong.'day', 'int'), GETPOST($attributekeylong.'year', 'int')); + //var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit; + } else { + $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, 'alpha'); + } + + $result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user); + if ($result > 0) { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + $action = 'view'; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'edit_extras'; + } +} /* * View From 38bd5e0902dd718eec765d6c7c5ba69b880f6143 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 12:51:40 +0200 Subject: [PATCH 045/146] Fix trans --- htdocs/contact/class/contact.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 83bc4202b9d..a45e28f6be1 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -90,21 +90,19 @@ class Contact extends CommonObject */ public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>15), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20), - 'fk_soc' =>array('type'=>'integer', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>1, 'position'=>25, 'searchall'=>1), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>30, 'index'=>1), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>3, 'position'=>35), 'civility' =>array('type'=>'varchar(6)', 'label'=>'Civility', 'enabled'=>1, 'visible'=>3, 'position'=>40), 'lastname' =>array('type'=>'varchar(50)', 'label'=>'Lastname', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'showoncombobox'=>1, 'searchall'=>1), 'firstname' =>array('type'=>'varchar(50)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'showoncombobox'=>1, 'searchall'=>1), + 'poste' =>array('type'=>'varchar(80)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>-1, 'position'=>52), 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>55), 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>1, 'position'=>60), 'town' =>array('type'=>'text', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>65), 'fk_departement' =>array('type'=>'integer', 'label'=>'Fk departement', 'enabled'=>1, 'visible'=>3, 'position'=>70), 'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>3, 'position'=>75), + 'fk_soc' =>array('type'=>'integer', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>1, 'position'=>77, 'searchall'=>1), 'birthday' =>array('type'=>'date', 'label'=>'Birthday', 'enabled'=>1, 'visible'=>3, 'position'=>80), - 'poste' =>array('type'=>'varchar(80)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'phone' =>array('type'=>'varchar(30)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>1, 'position'=>90, 'searchall'=>1), 'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'PhonePerso', 'enabled'=>1, 'visible'=>-1, 'position'=>95, 'searchall'=>1), 'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'PhoneMobile', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'searchall'=>1), @@ -113,15 +111,17 @@ class Contact extends CommonObject 'socialnetworks' =>array('type'=>'text', 'label'=>'SocialNetworks', 'enabled'=>1, 'visible'=>3, 'position'=>115), 'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>3, 'position'=>170), 'priv' =>array('type'=>'smallint(6)', 'label'=>'ContactVisibility', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>175), - 'fk_stcommcontact' =>array('type'=>'integer', 'label'=>'Fk stcommcontact', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220), + 'fk_stcommcontact' =>array('type'=>'integer', 'label'=>'ProspectStatus', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220), 'fk_prospectlevel' =>array('type'=>'varchar(12)', 'label'=>'ProspectLevel', 'enabled'=>1, 'visible'=>-1, 'position'=>255), 'no_email' =>array('type'=>'smallint(6)', 'label'=>'No_Email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180), - 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>3, 'position'=>185), - 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>3, 'position'=>190), 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>3, 'position'=>195, 'searchall'=>1), 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>3, 'position'=>200, 'searchall'=>1), 'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>3, 'position'=>205), 'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>3, 'position'=>210), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>300), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>305), + 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>3, 'position'=>310), + 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>3, 'position'=>315), 'statut' =>array('type'=>'tinyint(4)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>1000), ); From a57e8a14b88392cca1f56531a3c7285d448bb328 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 12:56:33 +0200 Subject: [PATCH 046/146] Fix look and feel v14 --- htdocs/contact/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 2f6b717a2dc..efb8f03736e 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1164,25 +1164,25 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($conf->commande->enabled)) { print ''.$langs->trans("ContactForOrders").''; - print $object->ref_commande ? $object->ref_commande : $langs->trans("NoContactForAnyOrder"); + print $object->ref_commande ? $object->ref_commande : (''.$langs->trans("NoContactForAnyOrder").''); print ''; } if (!empty($conf->propal->enabled)) { print ''.$langs->trans("ContactForProposals").''; - print $object->ref_propal ? $object->ref_propal : $langs->trans("NoContactForAnyProposal"); + print $object->ref_propal ? $object->ref_propal : (''.$langs->trans("NoContactForAnyProposal").''); print ''; } if (!empty($conf->contrat->enabled)) { print ''.$langs->trans("ContactForContracts").''; - print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract"); + print $object->ref_contrat ? $object->ref_contrat : (''.$langs->trans("NoContactForAnyContract").''); print ''; } if (!empty($conf->facture->enabled)) { print ''.$langs->trans("ContactForInvoices").''; - print $object->ref_facturation ? $object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); + print $object->ref_facturation ? $object->ref_facturation : (''.$langs->trans("NoContactForAnyInvoice").''); print ''; } @@ -1193,7 +1193,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $result = $dolibarr_user->fetch($object->user_id); print $dolibarr_user->getLoginUrl(1); } else { - print $langs->trans("NoDolibarrAccess"); + print ''.$langs->trans("NoDolibarrAccess").''; } print ''; From 383c92f6c62c32d9d7fd846f9b1f50ed49da7b65 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 6 Sep 2021 14:52:11 +0200 Subject: [PATCH 047/146] FIX : migration script --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 7c1815377be..a562f00c295 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -349,6 +349,7 @@ UPDATE llx_payment_salary SET ref = rowid WHERE ref IS NULL; ALTER TABLE llx_salary ALTER COLUMN paye set default 0; +UPDATE llx_extrafields SET elementtype = 'salary' WHERE elementtype = 'payment_salary'; ALTER TABLE llx_payment_salary_extrafields RENAME TO llx_salary_extrafields; DELETE FROM llx_boxes WHERE box_id IN (SELECT rowid FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php')); From 1043bc964ddb714483791efbdb9bad6049c1cbbe Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 6 Sep 2021 12:58:06 +0000 Subject: [PATCH 048/146] Fixing style errors. --- htdocs/core/tpl/extrafields_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 0a2348f5858..f50276821b1 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -194,7 +194,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l if ($object->element == 'contact') { $permok = $user->rights->societe->contact->creer; } - if($object->element == 'salary') { + if ($object->element == 'salary') { $permok = $user->rights->salaries->read; } From 18da6e6d6f940c9ba3dbda75648af5186482c0ea Mon Sep 17 00:00:00 2001 From: jyhere Date: Mon, 6 Sep 2021 15:20:47 +0200 Subject: [PATCH 049/146] Update create.php Fix : unable to create a direct debit if ics and ics_transfer are empty even though ics_transfer is only used for bank transfer. --- htdocs/compta/prelevement/create.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 6f045f3ca74..9a3202540b4 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -95,7 +95,9 @@ if (empty($reshook)) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $bank = new Account($db); $bank->fetch($conf->global->{$default_account}); - if (empty($bank->ics) || empty($bank->ics_transfer)) { + if ((empty($bank->ics) && $type !== 'bank-transfer') + || (empty($bank->ics_transfer) && $type === 'bank-transfer') + ) { $errormessage = str_replace('{url}', $bank->getNomUrl(1, '', '', -1, 1), $langs->trans("ErrorICSmissing", '{url}')); setEventMessages($errormessage, null, 'errors'); header("Location: ".DOL_URL_ROOT.'/compta/prelevement/create.php'); From 3537f68c7e16a09aea83453022b262d580231e52 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 6 Sep 2021 13:24:22 +0000 Subject: [PATCH 050/146] Fixing style errors. --- htdocs/compta/prelevement/create.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 9a3202540b4..172cf020e34 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -96,8 +96,8 @@ if (empty($reshook)) { $bank = new Account($db); $bank->fetch($conf->global->{$default_account}); if ((empty($bank->ics) && $type !== 'bank-transfer') - || (empty($bank->ics_transfer) && $type === 'bank-transfer') - ) { + || (empty($bank->ics_transfer) && $type === 'bank-transfer') + ) { $errormessage = str_replace('{url}', $bank->getNomUrl(1, '', '', -1, 1), $langs->trans("ErrorICSmissing", '{url}')); setEventMessages($errormessage, null, 'errors'); header("Location: ".DOL_URL_ROOT.'/compta/prelevement/create.php'); From 7d8023fea74862012ab35d1e5e0486d1b3743f1e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 6 Sep 2021 16:21:30 +0200 Subject: [PATCH 051/146] FIX wrong table_element_line --- htdocs/core/ajax/row.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 95518cbbf66..c55d80ee521 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2021 Regis Houssin * Copyright (C) 2017 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -79,7 +79,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3) $perm = 1; } elseif ($table_element_line == 'facturedet' && $user->rights->facture->creer) { $perm = 1; - } elseif ($table_element_line == 'facturerecdet' && $user->rights->facture->creer) { + } elseif ($table_element_line == 'facturedet_rec' && $user->rights->facture->creer) { $perm = 1; } elseif ($table_element_line == 'ecm_files' && $user->rights->ecm->creer) { $perm = 1; From 70d52aca1d539c79a9fe27f416ffc471417c36c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 17:42:17 +0200 Subject: [PATCH 052/146] Trans --- htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/fr_FR/admin.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 78cbff5cafe..af83083e308 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -496,7 +496,7 @@ WarningPHPMail=WARNING: The setup to send emails from the application is using t WarningPHPMailA=- Using the server of the Email Service Provider increases the trustability of your email, so it increases the deliverablity without being flagged as SPAM WarningPHPMailB=- Some Email Service Providers (like Yahoo) do not allow you to send an email from another server than their own server. Your current setup uses the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not theirs, so few of your sent Emails may not be accepted for delivery (be careful also of your email provider's sending quota). WarningPHPMailC=- Using the SMTP server of your own Email Service Provider to send emails is also interesting so all emails sent from application will also be saved into your "Sent" directory of your mailbox. -WarningPHPMailD=If the method 'PHP Mail' is really the method you would like to use, you can remove this warning by adding the constant MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP to 1 in Home - Setup - Other. +WarningPHPMailD=Also, it is therefore recommended to change the sending method of e-mails to the value "SMTP". If you really want to keep the default "PHP" method to send emails, just ignore this warning, or remove it by setting the MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP constant to 1 in Home - Setup - Other. WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of the mail user agent (MUA) for your ERP CRM application: %s. WarningPHPMailSPF=If the domain name in your sender email address is protected by a SPF record (ask you domain name registar), you must add the following IPs in the SPF record of the DNS of your domain: %s. ClickToShowDescription=Click to show description diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index b7a10c62ba2..31866672e17 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -495,7 +495,7 @@ WarningPHPMail=AVERTISSEMENT: la configuration pour envoyer des e-mails à parti WarningPHPMailA= - L'utilisation des serveurs de prestataires de messagerie augmente le niveau confiance des e-mails, cela augmente donc les chances de délivrabilité en n'étant pas considéré comme spam. WarningPHPMailB=- Certains fournisseurs de services de messagerie (comme Yahoo) ne vous permettent pas d'envoyer un e-mail à partir d'un autre serveur que leur propre serveur. Votre configuration actuelle utilise le serveur de l'application pour envoyer des e-mails et non le serveur de votre fournisseur de messagerie, donc certains destinataires (ceux compatibles avec le protocole DMARC restrictif), demanderont à votre fournisseur de messagerie si ils peuvent accepter votre message et ce fournisseur de messagerie (comme Yahoo) peut répondre «non» parce que le serveur d'envoi n'est pas le leur, aussi une partie de vos e-mails envoyés peuvent ne pas être acceptés pour la livraison (faites également attention au quota d'envoi de votre fournisseur de messagerie). WarningPHPMailC=- Utiliser le serveur SMTP de votre propre fournisseur de services de messagerie pour envoyer des e-mails est également intéressant afin que tous les e-mails envoyés depuis l'application soient également enregistrés dans votre répertoire "Envoyés" de votre boîte aux lettres. -WarningPHPMailD=Si PHP est vraiment la méthode d'envoi des e-mails que vous avez choisi d'utiliser, supprimer cette alerte en activant à 1 la constante MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP dans Accueil - Configuration - Divers +WarningPHPMailD=Aussi, il est donc recommandé de modifier la méthode d'envoi des e-mails sur la valeur "SMTP". Si vous voulez vraiment conserver la méthode par défaut "PHP", alors vous pouvez ignorer cette alerte ou la supprimer en activant à 1 la constante MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP dans Accueil - Configuration - Divers WarningPHPMail2=Si votre fournisseur de messagerie SMTP a besoin de restreindre le client de messagerie à certaines adresses IP (très rare), voici l'adresse IP du mail user agent (MUA) de votre application CRM ERP : %s . WarningPHPMailSPF=Si le nom de domaine de votre adresse e-mail d'expéditeur est protégé par un enregistrement SPF (demandez à votre fournisseur de nom de domaine), vous devez inclure les adresses IP suivantes dans l'enregistrement SPF du DNS de votre domaine: %s . ClickToShowDescription=Cliquer pour afficher la description From e77d7d22a87e2d7af4f61e8f2794a0a5e663015b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 18:34:18 +0200 Subject: [PATCH 053/146] Trans --- htdocs/langs/en_US/admin.lang | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index af83083e308..5bda447f368 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2150,4 +2150,6 @@ DatabasePasswordObfuscated=Database password is obfuscated in conf file DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file APIsAreNotEnabled=APIs modules are not enabled YouShouldSetThisToOff=You should set this to 0 or off -InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s \ No newline at end of file +InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s +IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sale tax +IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sale tax From f5f0b9debc083a17b942d57ab5a9411226282bb9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 18:41:04 +0200 Subject: [PATCH 054/146] Fix label for selection --- htdocs/admin/company.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 0ca1ae7d98e..85d168ac8b3 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -696,7 +696,7 @@ $tooltiphelp = ''; if ($mysoc->country_code == 'FR') { $tooltiphelp = ''.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR").""; } -print ""; +print '"; print "\n"; @@ -706,7 +706,7 @@ $tooltiphelp = ''; if ($mysoc->country_code == 'FR') { $tooltiphelp = "".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."\n"; } -print ""; +print '"; print "\n"; print ""; @@ -721,12 +721,12 @@ print "\n"; if ($mysoc->useLocalTax(1)) { // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print 'global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).""; + print 'global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "").'> "; print ''; print '
'; $tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); $tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."\n" : ""); - print '"; + print $form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp); if (!isOnlyOneLocalTax(1)) { print '
: '; $formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); @@ -739,11 +739,11 @@ if ($mysoc->useLocalTax(1)) { print "
"; print "\n"; - print 'global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code).""; + print 'global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "").'> "; print ''; $tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); $tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."\n" : ""); - print ""; + print $form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp); print "\n"; } else { if (empty($mysoc->country_code)) { @@ -765,7 +765,7 @@ print "\n"; if ($mysoc->useLocalTax(2)) { // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print 'global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).""; + print 'global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "").'> "; print ''; print '
'; print '"; @@ -780,7 +780,7 @@ if ($mysoc->useLocalTax(2)) { print "
"; print "\n"; - print 'global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code).""; + print 'global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "").'> "; print ''; print "
"; $tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); @@ -803,7 +803,7 @@ print ""; print '
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; if ($mysoc->useRevenueStamp()) { From 51a751f088eee25b3ef48fa32b6f3ca6a410f575 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 19:00:01 +0200 Subject: [PATCH 055/146] Fix option MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 10 +++++++++- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index b172cb3b5cf..839f7afa56a 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1195,6 +1195,14 @@ class pdf_crabe extends ModelePDFFactures $default_font_size = pdf_getPDFFontSize($outputlangs); + $outputlangsbis = null; + if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) { + $outputlangsbis = new Translate('', $conf); + $outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE); + $outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal")); + $default_font_size--; + } + $tab2_top = $posy; $tab2_hl = 4; $pdf->SetFont('', '', $default_font_size - 1); @@ -1213,7 +1221,7 @@ class pdf_crabe extends ModelePDFFactures // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + 0); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total") : ''), 0, 'L', 1); $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index bc4c536a2e6..db3609101a0 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1353,7 +1353,7 @@ class pdf_sponge extends ModelePDFFactures $posy = $pdf->GetY(); } - // cumul TVA précédent + // Cumulate preceding VAT $index++; $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $posy); @@ -1427,7 +1427,7 @@ class pdf_sponge extends ModelePDFFactures // Total remise $total_line_remise = 0; foreach ($object->lines as $i => $line) { - $total_line_remise += pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); // TODO: add this methode to core/lib/pdf.lib + $total_line_remise += pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); // TODO: add this method to core/lib/pdf.lib // Gestion remise sous forme de ligne négative if ($line->total_ht < 0) { $total_line_remise += -$line->total_ht; @@ -1458,7 +1458,7 @@ class pdf_sponge extends ModelePDFFactures // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total") : ''), 0, 'L', 1); $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); From 02f21d478a0167b25ddc305aa14a243e7dc8bc98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 19:06:46 +0200 Subject: [PATCH 056/146] Fix trans --- htdocs/admin/translation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 3fa2e5d0af9..8d77e009cb3 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -541,7 +541,7 @@ if ($mode == 'searchkey') { print $form->textwithpicto('', $htmltext, 1, 'info'); } elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) { //print $key.'-'.$val; - print ''.img_edit_add($langs->trans("Overwrite")).''; + print ''.img_edit_add($langs->trans("TranslationOverwriteKey")).''; } if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { From 4aaaa8e21a29995c51e0533968209d8bcb166fa0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 7 Sep 2021 12:10:35 +0200 Subject: [PATCH 057/146] FIX multicompany transverse mode compatibility --- htdocs/comm/action/peruser.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 6b54a327705..cc086a179e0 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -767,11 +767,18 @@ while ($currentdaytoshow < $lastdaytoshow) { } } else { /* Use this list to have for all users */ - $sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity"; - $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - if ($usergroup > 0) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user"; - $sql .= " WHERE u.statut = 1 AND u.entity IN (".getEntity('user').")"; - if ($usergroup > 0) $sql .= " AND ug.fk_usergroup = ".$usergroup; + $sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity"; + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; + if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql .= " WHERE ug.entity IN (".getEntity('usergroup').")"; + $sql .= " AND ug.fk_user = u.rowid "; + } else { + if ($usergroup > 0) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user"; + $sql .= " WHERE u.entity IN (".getEntity('user').")"; + } + $sql .= " AND u.statut = 1"; + if ($usergroup > 0) $sql .= " AND ug.fk_usergroup = ".$usergroup; //print $sql; $resql = $db->query($sql); if ($resql) { From 52419f28c530120066033bbdd6a6c7706b25e590 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 7 Sep 2021 12:38:15 +0200 Subject: [PATCH 058/146] FIX add DISTINCT --- htdocs/comm/action/peruser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index cc086a179e0..690f15a1738 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -767,7 +767,7 @@ while ($currentdaytoshow < $lastdaytoshow) { } } else { /* Use this list to have for all users */ - $sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity"; + $sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; From f3babd28194eb3563f43f685ad5caeeef7045cb2 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 7 Sep 2021 13:59:36 +0200 Subject: [PATCH 059/146] Fix #18633 : fix error message --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index d50b6991261..af3a1662ab6 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -598,3 +598,5 @@ create table llx_onlinesignature -- VMYSQL4.3 ALTER TABLE llx_partnership MODIFY COLUMN date_partnership_end date NULL; -- VPGSQL8.2 ALTER TABLE llx_partnership ALTER COLUMN date_partnership_end DROP NOT NULL; + +Alter TABLE llx_facture_fourn CHANGE fk_mode_transport fk_transport_mode integer From 948d2bc4e99205191cc597c640e069a8b467117f Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Tue, 7 Sep 2021 14:43:37 +0200 Subject: [PATCH 060/146] FIX : Add token when remove the last widget on home page --- htdocs/core/class/html.formother.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 038f93d34c6..e81308faf79 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1206,7 +1206,7 @@ class FormOther async: false }); // We force reload to be sure to get all boxes into list - window.location.search=\'mainmenu='.GETPOST("mainmenu", "aZ09").'&leftmenu='.GETPOST('leftmenu', "aZ09").'&action=delbox\'; + window.location.search=\'mainmenu='.GETPOST("mainmenu", "aZ09").'&leftmenu='.GETPOST('leftmenu', "aZ09").'&action=delbox&token='.newToken().'\'; } else { From e26e6288c208387639e739db618a2201b0476fd9 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Tue, 7 Sep 2021 15:22:02 +0200 Subject: [PATCH 061/146] FIX #18591 : Remove double quotes of SQL Queries FIX #18591 : Remove double quotes of SQL Queries for postgresql compatibility --- htdocs/core/class/dolreceiptprinter.class.php | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 4dfca1186c0..ad2e7ed1181 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -386,9 +386,9 @@ class dolReceiptPrinter extends Printer { global $conf; $error = 0; - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt'; - $sql .= ' (name, fk_type, fk_profile, parameter, entity)'; - $sql .= ' VALUES ("'.$this->db->escape($name).'", '.$type.', '.$profile.', "'.$this->db->escape($parameter).'", '.$conf->entity.')'; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."printer_receipt"; + $sql .= " (name, fk_type, fk_profile, parameter, entity)"; + $sql .= " VALUES ('".$this->db->escape($name)."', ".$type.", ".$profile.", '".$this->db->escape($parameter)."', ".$conf->entity.")"; $resql = $this->db->query($sql); if (!$resql) { $error++; @@ -411,12 +411,12 @@ class dolReceiptPrinter extends Printer { global $conf; $error = 0; - $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt'; - $sql .= ' SET name="'.$this->db->escape($name).'"'; - $sql .= ', fk_type='.$type; - $sql .= ', fk_profile='.$profile; - $sql .= ', parameter="'.$this->db->escape($parameter).'"'; - $sql .= ' WHERE rowid='.$printerid; + $sql = "UPDATE ".MAIN_DB_PREFIX."printer_receipt"; + $sql .= " SET name='".$this->db->escape($name)."'"; + $sql .= ", fk_type=".$type; + $sql .= ", fk_profile=".$profile; + $sql .= ", parameter='".$this->db->escape($parameter)."'"; + $sql .= " WHERE rowid=".$printerid; $resql = $this->db->query($sql); if (!$resql) { $error++; @@ -456,9 +456,9 @@ class dolReceiptPrinter extends Printer { global $conf; $error = 0; - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt_template'; - $sql .= ' (name, template, entity) VALUES ("'.$this->db->escape($name).'"'; - $sql .= ', "'.$this->db->escape($template).'", '.$conf->entity.')'; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."printer_receipt_template"; + $sql .= " (name, template, entity) VALUES ('".$this->db->escape($name)."'"; + $sql .= ", '".$this->db->escape($template)."', ".$conf->entity.")"; $resql = $this->db->query($sql); if (!$resql) { $error++; @@ -500,10 +500,10 @@ class dolReceiptPrinter extends Printer { global $conf; $error = 0; - $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template'; - $sql .= ' SET name="'.$this->db->escape($name).'"'; - $sql .= ', template="'.$this->db->escape($template).'"'; - $sql .= ' WHERE rowid='.$templateid; + $sql = "UPDATE ".MAIN_DB_PREFIX."printer_receipt_template"; + $sql .= " SET name='".$this->db->escape($name)."'"; + $sql .= ", template='".$this->db->escape($template)."'"; + $sql .= " WHERE rowid=".$templateid; $resql = $this->db->query($sql); if (!$resql) { $error++; From 0edf2f344b430a57b3358b706dcfdb6f5b80ecb5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Sep 2021 17:38:46 +0200 Subject: [PATCH 062/146] Fix sql --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index d50b6991261..ee1ad6b9f2e 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -392,7 +392,8 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, ref varchar(128) NOT NULL, fk_soc integer, - fk_actioncomm integer NOT NULL, + fk_actioncomm integer, + fk_project integer NOT NULL, email varchar(100), date_subscription datetime, amount double DEFAULT NULL, @@ -408,6 +409,11 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee( status smallint NOT NULL ) ENGINE=innodb; +-- VMYSQL4.3 ALTER TABLE llx_eventorganization_conferenceorboothattendee MODIFY COLUMN fk_actioncomm integer NULL; +-- VPGSQL8.2 ALTER TABLE llx_eventorganization_conferenceorboothattendee ALTER COLUMN fk_actioncomm DROP NOT NULL; + +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN fk_project integer NOT NULL; + ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_rowid (rowid); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_ref (ref); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_soc (fk_soc); From 83ec43a2ee265a1bee433511400cd3444735a948 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Sep 2021 17:44:57 +0200 Subject: [PATCH 063/146] css --- htdocs/install/default.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/default.css b/htdocs/install/default.css index 88967664ad8..c9ebc47d317 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -411,7 +411,7 @@ a.button:hover { /* background-color: rgba(70, 3, 62, 0.3); */ padding: 2px 4px; border-radius: 4px; - white-space: nowrap; + /* white-space: nowrap; */ } .choiceselected { background-color: #f4f6f4; From 07d48e627e58d120dc6d89ca0f7f44b005d962a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Sep 2021 18:13:55 +0200 Subject: [PATCH 064/146] Debug event organization module --- .../conferenceorbooth_list.php | 8 +++--- htdocs/langs/en_US/eventorganization.lang | 7 +++-- .../attendee_subscription.php | 28 +++++++++++++++---- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 5376acb3289..25537d2962d 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -398,15 +398,15 @@ if ($projectid > 0) { print ""; print '"; print '"; print '
'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).''.$langs->trans("Description").''.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).''.$langs->trans("Description").' 
'; - print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid'); + print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid'); print ''; - print $form->editfieldval('PriceOfRegistration', 'price_registration', $project->price_registration, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid'); + print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $project->price_booth, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid'); print "
'; - print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid'); + print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid'); print ''; - print $form->editfieldval('PriceOfBooth', 'price_booth', $project->price_booth, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid'); + print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $project->price_registration, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid'); print "
'.$langs->trans("EventOrganizationICSLink").''; diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 7c07b853a6b..0910feef219 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -29,6 +29,7 @@ EventOrganizationConferenceOrBoothMenuLeft = Conference Or Booth # # Admin page # +NewRegistration=Registration EventOrganizationSetup = Event Organization setup Settings = Settings EventOrganizationSetupPage = Event Organization setup page @@ -76,7 +77,7 @@ AllowUnknownPeopleSuggestConfHelp=Allow unknown people to suggest conferences AllowUnknownPeopleSuggestBooth=Allow unknown people to suggest booth AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to suggest booth PriceOfRegistration=Price of registration -PriceOfRegistrationHelp=Price of registration +PriceOfRegistrationHelp=Price to pay to register or participate in the event PriceOfBooth=Subscription price to stand a booth PriceOfBoothHelp=Subscription price to stand a booth EventOrganizationICSLink=Link ICS for events @@ -101,7 +102,7 @@ EvntOrgCancelled = Cancelled # SuggestForm = Suggestion page SuggestOrVoteForConfOrBooth = Page for suggestion or vote -EvntOrgRegistrationHelpMessage = Here, you can vote for an event, or suggest a new conference or booth for the project +EvntOrgRegistrationHelpMessage = Here, you can vote for a conference or booth or suggest a new one for the event EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project ListOfSuggestedConferences = List of suggested conferences @@ -113,7 +114,7 @@ ViewAndVote = View and vote for suggested events PublicAttendeeSubscriptionGlobalPage = Public link for registration to the event PublicAttendeeSubscriptionPage = Public link for registration to this event only MissingOrBadSecureKey = The security key is invalid or missing -EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference : '%s' +EvntOrgWelcomeMessage = This form allows you to register as a new participant to the event : %s EvntOrgDuration = This conference starts on %s and ends on %s. ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s. BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 79688bffcf6..fd216e49c34 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -483,10 +483,10 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $form = new Form($db); $formcompany = new FormCompany($db); -llxHeaderVierge($langs->trans("NewSubscription")); +llxHeaderVierge($langs->trans("NewRegistration")); print '
'; -print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center'); +print load_fiche_titre($langs->trans("NewRegistration"), '', '', 0, 0, 'center'); print '
'; @@ -498,9 +498,19 @@ print '
'; print $langs->trans("EvntOrgWelcomeMessage", $project->title . ' '. $conference->label); print '
'; if ($conference->id) { - print $langs->trans("EvntOrgDuration", dol_print_date($conference->datep), dol_print_date($conference->datef)); + print $langs->trans("Date").': '; + print dol_print_date($conference->datep); + if ($conference->date_end) { + print ' - '; + print dol_print_date($conference->datef); + } } else { - print $langs->trans("EvntOrgDuration", dol_print_date($project->date_start), dol_print_date($project->date_end)); + print $langs->trans("Date").': '; + print dol_print_date($project->date_start); + if ($project->date_end) { + print ' - '; + print dol_print_date($project->date_end); + } } print '
'; @@ -540,13 +550,13 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO print '' . "\n"; // Email - print '' . "\n"; + print '' . "\n"; // Company print '' . "\n"; + print ' ' . "\n"; // Address print '' . "\n"; @@ -587,6 +597,12 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO print ''; } + if ($project->price_registration) { + print ''; + } + print "
' . $langs->trans("Email") . '*
' . $langs->trans("Email") . '*
' . $langs->trans("Company"); if (!empty(floatval($project->price_registration))) { print '*'; } - print '
' . $langs->trans("Address") . '' . "\n"; print '
' . $langs->trans('Price') . ''; + print price($project->price_registration, 1, $langs, 1, -1, -1, $conf->currency); + print '
\n"; print dol_get_fiche_end(); From 3cc888f4dfbafd7b846524a70854a677f2d129e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Sep 2021 19:48:32 +0200 Subject: [PATCH 065/146] Debug event module --- htdocs/core/class/commonobject.class.php | 6 +-- .../class/conferenceorbooth.class.php | 8 +-- .../conferenceorbooth_list.php | 11 ++-- .../conferenceorboothattendee_card.php | 19 +++++-- .../conferenceorboothattendee_list.php | 50 +++++++++---------- htdocs/langs/en_US/eventorganization.lang | 5 +- 6 files changed, 57 insertions(+), 42 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index cd7ea1af73c..6b741f59f20 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6688,9 +6688,9 @@ abstract class CommonObject foreach ($fields_label as $field_toshow) { $translabel = $langs->trans($obj->$field_toshow); if ($translabel != $obj->$field_toshow) { - $labeltoshow = dol_trunc($translabel, 18).' '; + $labeltoshow = dol_trunc($translabel).' '; } else { - $labeltoshow = dol_trunc($obj->$field_toshow, 18).' '; + $labeltoshow = dol_trunc($obj->$field_toshow).' '; } } $out .= ''; @@ -6700,7 +6700,7 @@ abstract class CommonObject if ($translabel != $obj->{$InfoFieldList[1]}) { $labeltoshow = dol_trunc($translabel, 18); } else { - $labeltoshow = dol_trunc($obj->{$InfoFieldList[1]}, 18); + $labeltoshow = dol_trunc($obj->{$InfoFieldList[1]}); } } if (empty($labeltoshow)) { diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 100c5559ca1..49b7112ac5b 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -73,7 +73,7 @@ class ConferenceOrBooth extends ActionComm /** - * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. * 'picto' is code of a picto to show before value in forms @@ -106,10 +106,10 @@ class ConferenceOrBooth extends ActionComm 'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty",), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1::eventorganization', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1,), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project'), 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1), - 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1,), + 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'), 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',), 'datep2' => array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'3',), 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 25537d2962d..89a8e1c77ef 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; if ($conf->categorie->enabled) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -293,7 +294,7 @@ if ($projectid > 0) { print '
'; print '
'; - print ''; + print '
'; // Usage print '
'; @@ -355,7 +356,7 @@ if ($projectid > 0) { // Other attributes $cols = 2; - $objectconf=$object; + $objectconf = $object; $object = $project; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; $object = $objectconf; @@ -367,7 +368,7 @@ if ($projectid > 0) { print '
'; print '
'; - print ''; + print '
'; // Description print ''."\n"; + if (! is_object($attendee->project)) { + $text = 'ErrorProjectotFound'; + } else { + $text = $langs->trans("PaymentEvent").' - '.$attendee->project->title; + } + // Object - $text = ''.$langs->trans("PaymentConferenceAttendee").''; print ''."\n"; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 3952e5f0565..80783ab6216 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -23,9 +23,10 @@ /** * \file htdocs/public/payment/paymentok.php * \ingroup core - * \brief File to show page after a successful payment + * \brief File to show page after a successful payment on a payment line system. + * The payment was already really recorded. So an error here must send warning to admin but must still infor user that payment is ok. * This page is called by payment system with url provided to it completed with parameter TOKEN=xxx - * This token can be used to get more informations. + * This token and session can be used to get more informations. */ if (!defined('NOLOGIN')) { @@ -804,7 +805,7 @@ if ($ispaymentok) { $ispostactionok = 1; } } else { - $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.'; $ispostactionok = -1; $error++; } @@ -910,7 +911,7 @@ if ($ispaymentok) { $ispostactionok = 1; } } else { - $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.'; $ispostactionok = -1; $error++; } @@ -933,7 +934,7 @@ if ($ispaymentok) { // TODO send email with acknowledgment for the donation // (need that the donation module can gen a pdf document for the cerfa with pre filled content) } elseif (array_key_exists('ATT', $tmptag) && $tmptag['ATT'] > 0) { - // Record payment for attendee + // Record payment for registration to an event for an attendee include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $object = new Facture($db); $result = $object->fetch($ref); @@ -985,7 +986,7 @@ if ($ispaymentok) { } $paiement->paiementid = $paymentTypeId; $paiement->num_payment = ''; - $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress; + $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress.' for event registration'; $paiement->ext_payment_id = $TRANSACTIONID; $paiement->ext_payment_site = $service; @@ -1026,77 +1027,86 @@ if ($ispaymentok) { $ispostactionok = 1; } } else { - $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.'; $ispostactionok = -1; $error++; } } if (!$error) { - $db->commit(); - // Validating the attendee $attendeetovalidate = new ConferenceOrBoothAttendee($db); $resultattendee = $attendeetovalidate->fetch($tmptag['ATT']); if ($resultattendee < 0) { + $error++; setEventMessages(null, $attendeetovalidate->errors, "errors"); } else { - $attendeetovalidate->amount=$FinalPaymentAmt; - $attendeetovalidate->update($user); $attendeetovalidate->validate($user); - // Sending mail - $thirdparty = new Societe($db); - $resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc); - if ($resultthirdparty < 0) { - setEventMessages(null, $attendeetovalidate->errors, "errors"); + $attendeetovalidate->amount = $FinalPaymentAmt; + $attendeetovalidate->date_subscription = dol_now(); + $attendeetovalidate->update($user); + } + } + + if (!$error) { + $db->commit(); + } else { + setEventMessages(null, $postactionmessages, 'warnings'); + + $db->rollback(); + } + + if (! $error) { + // Sending mail + $thirdparty = new Societe($db); + $resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc); + if ($resultthirdparty < 0) { + setEventMessages(null, $attendeetovalidate->errors, "errors"); + } else { + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $attendeetovalidate->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); } else { - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $attendeetovalidate->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); - } + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } - } else { - $db->rollback(); } } } else { @@ -1201,7 +1211,7 @@ if ($ispaymentok) { $ispostactionok = 1; } } else { - $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.'; $ispostactionok = -1; $error++; } From f5903c9b02d7e5eb00b5e3683e901f9626de9838 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Sep 2021 01:45:17 +0200 Subject: [PATCH 068/146] Debug organizedeventregistration module --- .../class/conferenceorbooth.class.php | 4 +-- .../class/conferenceorboothattendee.class.php | 31 ++++++++++++------- .../conferenceorbooth_card.php | 2 +- .../conferenceorbooth_contact.php | 6 ++-- .../conferenceorboothattendee_card.php | 3 +- .../conferenceorboothattendee_list.php | 9 +++--- ...ventorganization_conferenceorbooth.lib.php | 8 ++--- htdocs/langs/en_US/eventorganization.lang | 4 +-- ...cription.php => attendee_registration.php} | 0 9 files changed, 39 insertions(+), 28 deletions(-) rename htdocs/public/eventorganization/{attendee_subscription.php => attendee_registration.php} (100%) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 9e07fd446d5..a8b1dddda3a 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -106,7 +106,7 @@ class ConferenceOrBooth extends ActionComm 'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company'), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'maxwidth500'), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project'), 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1), 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'), @@ -565,7 +565,7 @@ class ConferenceOrBooth extends ActionComm $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->id; - $url = dol_buildpath('/eventorganization/conferenceorbooth_card.php', 1).'?id='.$this->id; + $url = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?id='.$this->id; if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 3e402877b4d..9185ab5992f 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -63,6 +63,7 @@ class ConferenceOrBoothAttendee extends CommonObject */ public $picto = 'contact'; + public $paid = 0; const STATUS_DRAFT = 0; const STATUS_VALIDATED = 1; @@ -102,12 +103,12 @@ class ConferenceOrBoothAttendee extends CommonObject public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'Attendee', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty",), - 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>0, 'index'=>1,), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0, 'index'=>1,), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'Attendee', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'maxwidth500'), + 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project'), 'email' => array('type'=>'mail', 'label'=>'Email', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1,), - 'date_subscription' => array('type'=>'datetime', 'label'=>'DateSubscription', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',), - 'amount' => array('type'=>'price', 'label'=>'AmountOfSubscriptionPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",), + 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',), + 'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), @@ -730,6 +731,8 @@ class ConferenceOrBoothAttendee extends CommonObject } $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; + $label .= '
'.$langs->trans('DateOfRegistration').': '.dol_print_date($this->date_subscription, 'dayhour'); + $label .= '
'.$langs->trans('AmountPaid').': '.$this->amount; $url = dol_buildpath('/eventorganization/conferenceorboothattendee_card.php', 1).'?id='.$this->id; @@ -744,15 +747,15 @@ class ConferenceOrBoothAttendee extends CommonObject } if ($option == 'conforboothid') { - $url .= '&conforboothid='.$this->fk_actioncomm; + $url .= '&conforboothid='.((int) $this->fk_actioncomm); } if ($option == 'projectid') { - $url .= '&fk_project='.$this->fk_project.'&withproject=1'; + $url .= '&fk_project='.((int) $this->fk_project).'&withproject=1'; } if ($option == 'conforboothidproject') { - $url .= '&conforboothid='.$this->fk_actioncomm.'&withproject=1' ; + $url .= '&conforboothid='.((int) $this->fk_actioncomm).'&withproject=1' ; } } @@ -853,14 +856,15 @@ class ConferenceOrBoothAttendee extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable + global $langs; + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { - global $langs; //$langs->load("eventorganization@eventorganization"); $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated'); $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Validated'); $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); } @@ -870,6 +874,11 @@ class ConferenceOrBoothAttendee extends CommonObject $statusType = 'status6'; } + if ($status == self::STATUS_VALIDATED && $this->date_subscription && $this->amount) { + $statusType = 'status4'; + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated').' - '.$langs->trans("Paid"); + } + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 6ae9ab9664b..ea54d1e3d2f 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -182,7 +182,7 @@ $object->project = clone $projectstatic; if (!empty($withproject)) { // Tabs for project $tab = 'eventorganisation'; - $withProjectUrl="&withproject=1"; + $withProjectUrl = "&withproject=1"; $head = project_prepare_head($projectstatic); print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', ''); diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 8595da92652..9fc26503c44 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -101,7 +101,7 @@ if ($action == 'addcontact' && $permission) { // Add a new contact $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); if ($result >= 0) { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id.(!empty($withproject)?'&withproject=1':'')); + header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':'')); exit; } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { @@ -119,7 +119,7 @@ if ($action == 'addcontact' && $permission) { // Add a new contact $result = $object->delete_contact($lineid); if ($result >= 0) { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id.(!empty($withproject)?'&withproject=1':'')); + header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':'')); exit; } else { dol_print_error($db); @@ -161,7 +161,7 @@ $object->project = clone $projectstatic; if (!empty($withproject)) { // Tabs for project $tab = 'eventorganisation'; - $withProjectUrl="&withproject=1"; + $withProjectUrl = "&withproject=1"; $head = project_prepare_head($projectstatic); print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', ''); diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 54131275ee8..329b54d5eda 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -200,7 +200,7 @@ $object->project = clone $projectstatic; if (!empty($withproject)) { // Tabs for project $tab = 'eventorganisation'; - $withProjectUrl="&withproject=1"; + $withProjectUrl = "&withproject=1"; $head = project_prepare_head($projectstatic); print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', ''); @@ -418,6 +418,7 @@ if ($action == 'create') { } if ($projectstatic->id > 0) { print ''; + print ''; } diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index da2ed2ed957..57ff9d23bd1 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -57,8 +57,7 @@ $id = GETPOST('id', 'int'); $conf_or_booth_id = GETPOST('conforboothid', 'int'); $withproject = GETPOST('withproject', 'int'); -$project_ref = GETPOST('project_ref', 'alpha'); -$fk_project = GETPOST('fk_project', 'int'); +$fk_project = GETPOST('fk_project', 'int') ? GETPOST('fk_project', 'int') : GETPOST('projectid', 'int') ; $withProjectUrl=''; @@ -372,8 +371,9 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { if (!empty($withproject)) { // Tabs for project $tab = 'eventorganisation'; - $withProjectUrl="&withproject=1"; + $withProjectUrl = "&withproject=1"; $head = project_prepare_head($projectstatic); + print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', ''); $param = ($mode == 'mine' ? '&mode=mine' : ''); @@ -587,6 +587,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { if ($confOrBooth->id > 0) { $head = conferenceorboothPrepareHead($confOrBooth, $withproject); + print dol_get_fiche_head($head, 'attendees', $langs->trans("ConferenceOrBooth"), -1, $object->picto); $object_evt = $object; @@ -675,7 +676,7 @@ print ''; print ''; print ''; -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].(!empty($confOrBooth->id)?'?conforboothid='.$confOrBooth->id:'').$withProjectUrl), '', $permissiontoadd); +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index fcdd3c296e1..f49bd5e49a0 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -39,20 +39,20 @@ function conferenceorboothPrepareHead($object, $with_project = 0) $withProjectUrl=''; if ($with_project>0) { - $withProjectUrl="&withproject=1"; + $withProjectUrl = "&withproject=1"; } - $head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_card.php", 1).'?id='.$object->id.$withProjectUrl; + $head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.ph?id='.$object->id.$withProjectUrl; $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; - $head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_contact.php", 1).'?id='.$object->id.$withProjectUrl; + $head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_contact.php?id='.$object->id.$withProjectUrl; $head[$h][1] = $langs->trans("ContactsAddresses"); $head[$h][2] = 'contact'; $h++; - $head[$h][0] = dol_buildpath("/eventorganization/conferenceorboothattendee_list.php", 1).'?conforboothid='.$object->id.$withProjectUrl; + $head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?conforboothid='.$object->id.$withProjectUrl; $head[$h][1] = $langs->trans("Attendees"); $head[$h][2] = 'attendees'; // Enable caching of conf or booth count attendees diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 0133176a9ea..8f67c4290e5 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -55,8 +55,8 @@ EventOrganizationConfOrBooth= Conference Or Booth ManageOrganizeEvent = Manage event organisation ConferenceOrBooth = Conference Or Booth ConferenceOrBoothTab = Conference Or Booth -AmountOfSubscriptionPaid = Amount of subscription paid -DateSubscription = Date of subscription +AmountPaid = Amount paid +DateOfRegistration = Date of subscription ConferenceOrBoothAttendee = Conference Or Booth Attendee # diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_registration.php similarity index 100% rename from htdocs/public/eventorganization/attendee_subscription.php rename to htdocs/public/eventorganization/attendee_registration.php From 0b68da4e9e1931a7dd7e6ee36fd336edea06169d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Sep 2021 02:27:52 +0200 Subject: [PATCH 069/146] Debug organizedeventregistration module --- htdocs/core/lib/project.lib.php | 2 +- htdocs/langs/en_US/eventorganization.lang | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 5432ff18095..d3285869752 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -207,7 +207,7 @@ function project_prepare_head(Project $project) if ($conf->eventorganization->enabled && !empty($project->usage_organize_event)) { $langs->load('eventorganization'); $head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_list.php?projectid=' . $project->id; - $head[$h][1] = $langs->trans("ConferenceOrBoothTab"); + $head[$h][1] = $langs->trans("EventOrganization"); // Enable caching of conf or booth count $nbConfOrBooth = 0; diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 8f67c4290e5..d4110dd184f 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -19,7 +19,7 @@ # ModuleEventOrganizationName = Event Organization EventOrganizationDescription = Event Organization through Module Project -EventOrganizationDescriptionLong= Manage Event organization for conference, attendees, speaker, and attendees, with public subcription page +EventOrganizationDescriptionLong= Manage the organization of an event (conferences, attendees, speakers, with public suggestion, vote or registration pages) # # Menu # @@ -32,8 +32,9 @@ PaymentEvent=Payment of event # Admin page # NewRegistration=Registration -EventOrganizationSetup = Event Organization setup -Settings = Settings +EventOrganizationSetup=Event Organization setup +EventOrganization=Event organization +Settings=Settings EventOrganizationSetupPage = Event Organization setup page EVENTORGANIZATION_TASK_LABEL = Label of tasks to create automatically when project is validated EVENTORGANIZATION_TASK_LABELTooltip = When you validate an organized event, some tasks can be automatically created in the project

For example:
Send Call for Conference
Send Call for Booth
Receive call for conferences
Receive call for Booth
Open subscriptions to events for attendees
Send remind of event to speakers
Send remind of event to Booth hoster
Send remind of event to attendees @@ -52,7 +53,7 @@ EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filter thirdpartie's select list in att # Object # EventOrganizationConfOrBooth= Conference Or Booth -ManageOrganizeEvent = Manage event organisation +ManageOrganizeEvent = Manage the organization of an event ConferenceOrBooth = Conference Or Booth ConferenceOrBoothTab = Conference Or Booth AmountPaid = Amount paid From 6c118b4dfbe2cc7a312486cdcbedd086adf28459 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 8 Sep 2021 04:31:38 +0200 Subject: [PATCH 070/146] css --- htdocs/accountancy/journal/expensereportsjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 9633157b5b7..96ab150dd24 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -610,7 +610,7 @@ if (empty($action) || $action == 'view') { $userstatic->id = $tabuser[$key]['id']; $userstatic->name = $tabuser[$key]['name']; print "
"; - print '"; + print '"; print '"; print ""; } From 8c95ada9fddefd98c5713d5b61c93ddc7cd77823 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 8 Sep 2021 10:25:27 +0200 Subject: [PATCH 071/146] FIX wrong users count in multicompany transverse mode --- htdocs/user/class/user.class.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index df60c0f2fc9..05710ec2f88 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3298,14 +3298,21 @@ class User extends CommonObject public function load_state_board() { // phpcs:enable + global $conf; $this->nb = array(); - $sql = "SELECT count(u.rowid) as nb"; + $sql = "SELECT DISTINCT count(u.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql .= " WHERE u.statut > 0"; + if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql .= " WHERE ug.entity IN (".getEntity('usergroup').")"; + $sql .= " AND ug.fk_user = u.rowid "; + } else { + $sql .= " WHERE u.entity IN (".getEntity('user').")"; + } + $sql .= " AND u.statut > 0"; //$sql.= " AND employee != 0"; - $sql .= " AND u.entity IN (".getEntity('user').")"; $resql = $this->db->query($sql); if ($resql) { From a5e670291e8cedb47d0cb10e3c81841f41236b89 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 8 Sep 2021 15:36:51 +0200 Subject: [PATCH 072/146] Fix permission for salaries module --- htdocs/core/lib/security.lib.php | 2 +- htdocs/salaries/card.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index b297c81035e..4c36244a5bf 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -611,7 +611,7 @@ function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $ta $feature = 'projet_task'; } - $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salary', 'website'); // Test on entity only (Objects with no link to company) + $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website'); // Test on entity only (Objects with no link to company) $checksoc = array('societe'); // Test for societe object $checkother = array('contact', 'agenda'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet', 'project'); // Test for project object diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index d3c7ba504cb..f83f879cf8e 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -67,9 +67,27 @@ $fk_user = GETPOSTINT('userid'); $object = new Salary($db); $extrafields = new ExtraFields($db); +$childids = $user->getAllChildIds(1); + // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +if (($id > 0) || $ref) { + $object->fetch($id, $ref); + + // Check current user can read this leave request + $canread = 0; + if (!empty($user->rights->salaries->readall)) { + $canread = 1; + } + if (!empty($user->rights->salaries->read) && in_array($object->fk_user, $childids)) { + $canread = 1; + } + if (!$canread) { + accessforbidden(); + } +} + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('salarycard', 'globalcard')); From e9505c1109934e62b34f52e404528056ce0cd9e7 Mon Sep 17 00:00:00 2001 From: MOREAU FRANCK Date: Wed, 8 Sep 2021 18:23:44 +0200 Subject: [PATCH 073/146] Update V14 --- htdocs/core/menus/standard/eldy.lib.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 75055329add..95af5973587 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -384,10 +384,16 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Tickets and knwoledge base $tmpentry = array( - 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knwoledgemanagement->enabled)), - 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knwoledgemanagement->read)), - 'module'=>'ticket|knwoledgemanagement' + 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knowledgemanagement->enabled)), + 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knowledgemanagement->knowledgerecord->read)), + 'module'=>'ticket|knowledgemanagement' ); + $link = ''; + if(!empty($conf->ticket->enabled)){ + $link = '/ticket/index.php?mainmenu=ticket&leftmenu='; + }else{ + $link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu='; + } $menu_arr[] = array( 'name' => 'Ticket', 'link' => '/ticket/index.php?mainmenu=ticket&leftmenu=', From 57a2ea3a5357af89088829ed74e296892eb47a12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Sep 2021 19:45:55 +0200 Subject: [PATCH 074/146] Fix sql error --- htdocs/compta/facture/card-rec.php | 2 ++ htdocs/core/class/commonobject.class.php | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index affdd2e8991..d122c00ac07 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1228,6 +1228,8 @@ if ($action == 'create') { } $morehtmlref .= ''; + $morehtmlright = ''; + dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlright); print '
'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6b741f59f20..eb6ac7e882b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2001,6 +2001,11 @@ abstract class CommonObject return 1; } + // For backward compatibility + if ($this->table_element == 'facture_rec' && $fieldid == 'title') { + $fieldid = 'titre'; + } + // Security on socid $socid = 0; if ($user->socid > 0) { From 04026dd0b06f330a903a76e45d86109b7d23bc99 Mon Sep 17 00:00:00 2001 From: MOREAU FRANCK Date: Wed, 8 Sep 2021 19:51:34 +0200 Subject: [PATCH 075/146] fix Stickler CI review --- htdocs/core/menus/standard/eldy.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 95af5973587..7c93cd94163 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -389,9 +389,9 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'module'=>'ticket|knowledgemanagement' ); $link = ''; - if(!empty($conf->ticket->enabled)){ + if (!empty($conf->ticket->enabled)) { $link = '/ticket/index.php?mainmenu=ticket&leftmenu='; - }else{ + } else { $link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu='; } $menu_arr[] = array( From e0fa4e4b5c6dc5c14e26a4fff12e7616bb699915 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Sep 2021 21:19:01 +0200 Subject: [PATCH 076/146] Fix phpcs --- htdocs/core/class/html.formcompany.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index db7df18e210..3e2c3588405 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -718,7 +718,7 @@ class FormCompany extends Form } print '>'; print ''; - + $num = $this->db->num_rows($resql); $i = 0; if ($num) { From 8326ecee786104edbd9cec778b811a1cd69018d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Sep 2021 21:19:40 +0200 Subject: [PATCH 077/146] Fix phpcs --- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 57ff9d23bd1..a6ea42da346 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -57,7 +57,7 @@ $id = GETPOST('id', 'int'); $conf_or_booth_id = GETPOST('conforboothid', 'int'); $withproject = GETPOST('withproject', 'int'); -$fk_project = GETPOST('fk_project', 'int') ? GETPOST('fk_project', 'int') : GETPOST('projectid', 'int') ; +$fk_project = GETPOST('fk_project', 'int') ? GETPOST('fk_project', 'int') : GETPOST('projectid', 'int'); $withProjectUrl=''; From 4705d41ed2b1b6f71d5cc781149da0373287ac68 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Sep 2021 22:00:16 +0200 Subject: [PATCH 078/146] FIX Relative discount with high nb of decimals --- htdocs/comm/propal/card.php | 20 +++++++++++--------- htdocs/commande/card.php | 8 +++++--- htdocs/compta/facture/card-rec.php | 12 +++++++----- htdocs/compta/facture/card.php | 28 +++++++++++++++------------- 4 files changed, 38 insertions(+), 30 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3c0d8dd9a28..95a1418b644 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -384,8 +384,8 @@ if (empty($reshook)) { $object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->fk_account = GETPOST('fk_account', 'int'); - $object->remise_percent = price2num(GETPOST('remise_percent'), 2); - $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); + $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); + $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2); $object->socid = GETPOST('socid', 'int'); $object->contact_id = GETPOST('contactid', 'int'); $object->fk_project = GETPOST('projectid', 'int'); @@ -826,8 +826,8 @@ if (empty($reshook)) { $tva_tx = ''; } - $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); - $remise_percent = price2num(GETPOST('remise_percent'.$predef), 2); + $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2); + $remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2); if (empty($remise_percent)) { $remise_percent = 0; } @@ -1214,6 +1214,8 @@ if (empty($reshook)) { $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); $date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); + $remise_percent = price2num(GETPOST('remise_percent'), '', 2); + // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); $array_options = $extrafields->getOptionalsFromPost($object->table_element_line); @@ -1226,7 +1228,7 @@ if (empty($reshook)) { } // Define special_code for special lines - $special_code = GETPOST('special_code'); + $special_code = GETPOST('special_code', 'int'); if (!GETPOST('qty')) { $special_code = 3; } @@ -1245,7 +1247,7 @@ if (empty($reshook)) { } $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); - if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) { + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error++; } @@ -1275,7 +1277,7 @@ if (empty($reshook)) { $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); - $result = $object->updateline(GETPOST('lineid', 'int'), $pu_ht, $qty, price2num(GETPOST('remise_percent'), 2), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise); + $result = $object->updateline(GETPOST('lineid', 'int'), $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise); if ($result >= 0) { $db->commit(); @@ -1343,9 +1345,9 @@ if (empty($reshook)) { // Terms of payment $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); } elseif ($action == 'setremisepercent' && $usercancreate) { - $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'))); + $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2)); } elseif ($action == 'setremiseabsolue' && $usercancreate) { - $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'))); + $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2)); } elseif ($action == 'setmode' && $usercancreate) { // Payment choice $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 7363ceace5c..bbc6bdbafb9 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -629,7 +629,7 @@ if (empty($reshook)) { $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); - $remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0); + $remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0); if (empty($remise_percent)) { $remise_percent = 0; } @@ -1019,6 +1019,8 @@ if (empty($reshook)) { $special_code = 3; } + $remise_percent = price2num(GETPOST('remise_percent'), '', 2); + // Check minimum price $productid = GETPOST('productid', 'int'); if (!empty($productid)) { @@ -1034,7 +1036,7 @@ if (empty($reshook)) { $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); - if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) { + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error++; } @@ -1059,7 +1061,7 @@ if (empty($reshook)) { } } } - $result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, price2num(GETPOST('qty'), 'MS'), price2num(GETPOST('remise_percent'), 2), $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise); + $result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, price2num(GETPOST('qty'), 'MS'), $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise); if ($result >= 0) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index d122c00ac07..ced6ea152e4 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -433,8 +433,8 @@ if (empty($reshook)) { $tva_tx = ''; } - $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); - $remise_percent = price2num(GETPOST('remise_percent'.$predef), 2); + $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2); + $remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2); // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); @@ -781,6 +781,8 @@ if (empty($reshook)) { $result = -1; }*/ + $remise_percent = price2num(GETPOST('remise_percent'), '', 2); + // Check minimum price $productid = GETPOST('productid', 'int'); if (!empty($productid)) { @@ -797,7 +799,7 @@ if (empty($reshook)) { $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); // Check price is not lower than minimum (check is done only for standard or replacement invoices) - if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent', 2)) / 100) < price2num($price_min)))) { + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error++; } @@ -830,8 +832,8 @@ if (empty($reshook)) { $vat_rate, $localtax1_rate, $localtax1_rate, - GETPOST('productid'), - price2num(GETPOST('remise_percent'), 2), + GETPOST('productid', 'int'), + $remise_percent, 'HT', $info_bits, 0, diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a09bc6853d0..d019b2dcf9a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -506,7 +506,7 @@ if (empty($reshook)) { $result = $object->setBankAccount(GETPOST('fk_account', 'int')); } elseif ($action == 'setremisepercent' && $usercancreate) { $object->fetch($id); - $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2)); + $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2)); } elseif ($action == "setabsolutediscount" && $usercancreate) { // POST[remise_id] or POST[remise_id_for_payment] @@ -1022,8 +1022,8 @@ if (empty($reshook)) { $object->cond_reglement_id = GETPOST('cond_reglement_id', 'int'); $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); $object->fk_account = GETPOST('fk_account', 'int'); - $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); - $object->remise_percent = price2num(GETPOST('remise_percent'), 2); + $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2); + $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); @@ -1079,7 +1079,7 @@ if (empty($reshook)) { $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); $object->fk_account = GETPOST('fk_account', 'int'); $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); - $object->remise_percent = price2num(GETPOST('remise_percent'), 2); + $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); @@ -1294,7 +1294,7 @@ if (empty($reshook)) { $object->fk_account = GETPOST('fk_account', 'int'); $object->amount = price2num(GETPOST('amount')); $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); - $object->remise_percent = price2num(GETPOST('remise_percent'), 2); + $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); @@ -1375,7 +1375,7 @@ if (empty($reshook)) { $object->fk_account = GETPOST('fk_account', 'int'); $object->amount = price2num(GETPOST('amount')); $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); - $object->remise_percent = price2num(GETPOST('remise_percent'), 2); + $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); @@ -1798,7 +1798,7 @@ if (empty($reshook)) { $product->fetch(GETPOST('idprod'.$i, 'int')); $startday = dol_mktime(12, 0, 0, GETPOST('date_start'.$i.'month'), GETPOST('date_start'.$i.'day'), GETPOST('date_start'.$i.'year')); $endday = dol_mktime(12, 0, 0, GETPOST('date_end'.$i.'month'), GETPOST('date_end'.$i.'day'), GETPOST('date_end'.$i.'year')); - $result = $object->addline($product->description, $product->price, price2num(GETPOST('qty'.$i), 'MS'), $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, GETPOST('idprod'.$i, 'int'), price2num(GETPOST('remise_percent'.$i)), $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', $product->fk_unit); + $result = $object->addline($product->description, $product->price, price2num(GETPOST('qty'.$i), 'MS'), $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, GETPOST('idprod'.$i, 'int'), price2num(GETPOST('remise_percent'.$i), '', 2), $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', $product->fk_unit); } } } @@ -1899,8 +1899,8 @@ if (empty($reshook)) { $object->fk_project = GETPOST('projectid', 'int'); $object->cond_reglement_id = GETPOST('cond_reglement_id', 'int'); $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); - $object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU'); - $object->remise_percent = price2num(GETPOST('remise_percent'), 2); + $object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU', 2); + $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); // Proprietes particulieres a facture de remplacement @@ -1986,8 +1986,8 @@ if (empty($reshook)) { $tva_tx = ''; } - $qty = price2num(GETPOST('qty'.$predef), 'MS'); - $remise_percent = price2num(GETPOST('remise_percent'.$predef), 2); + $qty = price2num(GETPOST('qty'.$predef), 'MS', 2); + $remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2); // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); @@ -2389,6 +2389,8 @@ if (empty($reshook)) { } } + $remise_percent = price2num(GETPOST('remise_percent'), '', 2); + // Check minimum price $productid = GETPOST('productid', 'int'); if (!empty($productid)) { @@ -2405,7 +2407,7 @@ if (empty($reshook)) { $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); // Check price is not lower than minimum (check is done only for standard or replacement invoices) - if ($usercanproductignorepricemin && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) { + if ($usercanproductignorepricemin && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error++; } @@ -2458,7 +2460,7 @@ if (empty($reshook)) { $description, $pu_ht, $qty, - price2num(GETPOST('remise_percent'), 2), + $remise_percent, $date_start, $date_end, $vat_rate, From 30856d5b183d9b4d2c81cc2e90e15b937920b38c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Sep 2021 22:09:02 +0200 Subject: [PATCH 079/146] FIX Relative discount with high nb of decimals --- htdocs/commande/card.php | 4 ++-- htdocs/contrat/card.php | 2 +- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/facture/card.php | 4 ++-- htdocs/product/card.php | 14 +++++++------- htdocs/product/fournisseurs.php | 2 +- htdocs/product/price.php | 6 +++--- htdocs/supplier_proposal/card.php | 12 ++++++------ 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index bbc6bdbafb9..224c443754a 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -597,9 +597,9 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setremisepercent' && $usercancreate) { - $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2)); + $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2)); } elseif ($action == 'setremiseabsolue' && $usercancreate) { - $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU')); + $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2)); } elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha') !== '') { // Define vat_rate $vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d5187c6a040..1466f595b3d 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -204,7 +204,7 @@ if (empty($reshook)) { $object->note_private = GETPOST('note_private', 'alpha'); $object->note_public = GETPOST('note_public', 'alpha'); $object->fk_project = GETPOST('projectid', 'int'); - $object->remise_percent = price2num(GETPOST('remise_percent'), 2); + $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); $object->ref = GETPOST('ref', 'alpha'); $object->ref_customer = GETPOST('ref_customer', 'alpha'); $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 625ecca522f..f02ffb99d77 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -748,7 +748,7 @@ if (empty($reshook)) { GETPOST('product_desc', 'restricthtml'), $ht, price2num(GETPOST('qty'), 'MS'), - price2num(GETPOST('remise_percent'), 2), + price2num(GETPOST('remise_percent'), '', 2), $vat_rate, $localtax1_rate, $localtax2_rate, diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 04d99240f6b..42e2f528bc6 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1272,8 +1272,8 @@ if (empty($reshook)) { $localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty); $localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty); - $remise_percent = price2num(GETPOST('remise_percent'), 2); - $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), 'MU'); + $remise_percent = price2num(GETPOST('remise_percent'), '', 2); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), 'MU', 2); // Extrafields Lines $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 3a85eaaf47b..d0675ed465c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -820,7 +820,7 @@ if (empty($reshook)) { if (GETPOST('propalid') > 0) { // Define cost price for margin calculation $buyprice = 0; - if (($result = $propal->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), 2), $object->id)) < 0) { + if (($result = $propal->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), '', 2), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { @@ -835,7 +835,7 @@ if (empty($reshook)) { $localtax1_tx, // localtax1 $localtax2_tx, // localtax2 $object->id, - price2num(GETPOST('remise_percent'), 2), + price2num(GETPOST('remise_percent'), '', 2), $price_base_type, $pu_ttc, 0, @@ -860,7 +860,7 @@ if (empty($reshook)) { } elseif (GETPOST('commandeid') > 0) { // Define cost price for margin calculation $buyprice = 0; - if (($result = $commande->defineBuyPrice($pu_ht, GETPOST('remise_percent', 2), $object->id)) < 0) { + if (($result = $commande->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), '', 2), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { @@ -875,7 +875,7 @@ if (empty($reshook)) { $localtax1_tx, // localtax1 $localtax2_tx, // localtax2 $object->id, - price2num(GETPOST('remise_percent'), 2), + price2num(GETPOST('remise_percent'), '', 2), '', '', $price_base_type, @@ -894,13 +894,13 @@ if (empty($reshook)) { ); if ($result > 0) { - header("Location: ".DOL_URL_ROOT."/commande/card.php?id=".$commande->id); + header("Location: ".DOL_URL_ROOT."/commande/card.php?id=".urlencode($commande->id)); exit; } } elseif (GETPOST('factureid') > 0) { // Define cost price for margin calculation $buyprice = 0; - if (($result = $facture->defineBuyPrice($pu_ht, GETPOST('remise_percent', 2), $object->id)) < 0) { + if (($result = $facture->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), '', 2), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { @@ -915,7 +915,7 @@ if (empty($reshook)) { $localtax1_tx, $localtax2_tx, $object->id, - price2num(GETPOST('remise_percent'), 2), + price2num(GETPOST('remise_percent'), '', 2), '', '', '', diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 97f29de72f6..01a09a21335 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -715,7 +715,7 @@ END; // Discount qty min print '
'; - print ''; print ''; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 4188ca9719b..cef401bcc45 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -412,10 +412,10 @@ if (empty($reshook)) { // Récupération des variables $rowid = GETPOST('rowid', 'int'); $priceid = GETPOST('priceid', 'int'); - $newprice = price2num(GETPOST("price"), 'MU'); + $newprice = price2num(GETPOST("price"), 'MU', 2); // $newminprice=price2num(GETPOST("price_min"),'MU'); // TODO : Add min price management - $quantity = price2num(GETPOST('quantity'), 'MS'); - $remise_percent = price2num(GETPOST('remise_percent'), 2); + $quantity = price2num(GETPOST('quantity'), 'MS', 2); + $remise_percent = price2num(GETPOST('remise_percent'), '', 2); $remise = 0; // TODO : allow discount by amount when available on documents if (empty($quantity)) { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5d22ea05684..6f1d0824b0b 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -258,8 +258,8 @@ if (empty($reshook)) { $object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->fk_account = GETPOST('fk_account', 'int'); - $object->remise_percent = price2num(GETPOST('remise_percent'), 2); - $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); + $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); + $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2); $object->socid = GETPOST('socid'); $object->fk_project = GETPOST('projectid', 'int'); $object->model_pdf = GETPOST('model'); @@ -915,8 +915,8 @@ if (empty($reshook)) { $result = $object->updateline( GETPOST('lineid', 'int'), $ht, - price2num(GETPOST('qty'), 'MS'), - price2num(GETPOST('remise_percent'), 2), + price2num(GETPOST('qty'), 'MS', 2), + price2num(GETPOST('remise_percent'), '', 2), $vat_rate, $localtax1_rate, $localtax2_rate, @@ -996,9 +996,9 @@ if (empty($reshook)) { // Terms of payments $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); } elseif ($action == 'setremisepercent' && $usercancreate) { - $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), 2)); + $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2)); } elseif ($action == 'setremiseabsolue' && $usercancreate) { - $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU')); + $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2)); } elseif ($action == 'setmode' && $usercancreate) { // Payment mode $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); From 39dd1e2dd1e3e967ab5e02b8b274564fa0e4a0b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 02:00:07 +0200 Subject: [PATCH 080/146] Code comment --- htdocs/societe/class/societe.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index fa19b23e6cd..5f1e4cd132a 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4345,10 +4345,10 @@ class Societe extends CommonObject } /** - * Return amount of order not paid and total + * Return amount of proposal not yet paid and total an dlist of all proposals * * @param string $mode 'customer' or 'supplier' - * @return array array('opened'=>Amount, 'total'=>Total amount) + * @return array array('opened'=>Amount including tax that remains to pay, 'total_ht'=>Total amount without tax of all objects paid or not, 'total_ttc'=>Total amunt including tax of all object paid or not) */ public function getOutstandingProposals($mode = 'customer') { @@ -4389,10 +4389,10 @@ class Societe extends CommonObject } /** - * Return amount of order not paid and total + * Return amount of order not yet paid and total and list of all orders * * @param string $mode 'customer' or 'supplier' - * @return array array('opened'=>Amount, 'total'=>Total amount) + * @return array array('opened'=>Amount including tax that remains to pay, 'total_ht'=>Total amount without tax of all objects paid or not, 'total_ttc'=>Total amunt including tax of all object paid or not) */ public function getOutstandingOrders($mode = 'customer') { @@ -4432,11 +4432,11 @@ class Societe extends CommonObject } /** - * Return amount of bill not paid and total + * Return amount of bill not yet paid and total of all invoices * - * @param string $mode 'customer' or 'supplier' + * @param string $mode 'customer' or 'supplier' * @param int $late 0 => all invoice, 1=> only late - * @return array array('opened'=>Amount, 'total'=>Total amount) + * @return array array('opened'=>Amount including tax that remains to pay, 'total_ht'=>Total amount without tax of all objects paid or not, 'total_ttc'=>Total amunt including tax of all object paid or not) */ public function getOutstandingBills($mode = 'customer', $late = 0) { @@ -4496,7 +4496,7 @@ class Societe extends CommonObject $creditnotes = $tmpobject->getSumCreditNotesUsed(); $deposits = $tmpobject->getSumDepositsUsed(); - $outstandingOpened += $obj->total_ttc - $paiement - $creditnotes - $deposits; + $outstandingOpened += ($obj->total_ttc - $paiement - $creditnotes - $deposits); } //if credit note is converted but not used From 89ed156d7ee45756a5e5eac6d41e93fe41269e53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 02:18:50 +0200 Subject: [PATCH 081/146] Complete getOutstandingBills() --- htdocs/societe/class/societe.class.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5f1e4cd132a..69aecc885c7 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4470,6 +4470,7 @@ class Societe extends CommonObject $outstandingTotal = 0; $outstandingTotalIncTax = 0; $arrayofref = array(); + $arrayofrefopened = array(); if ($mode == 'supplier') { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $tmpobject = new FactureFournisseur($this->db); @@ -4487,6 +4488,9 @@ class Societe extends CommonObject $outstandingTotal += $obj->total_ht; $outstandingTotalIncTax += $obj->total_ttc; } + + $remaintopay = 0; + if ($obj->paye == 0 && $obj->status != $tmpobject::STATUS_DRAFT // Not a draft && $obj->status != $tmpobject::STATUS_ABANDONED // Not abandonned @@ -4496,16 +4500,23 @@ class Societe extends CommonObject $creditnotes = $tmpobject->getSumCreditNotesUsed(); $deposits = $tmpobject->getSumDepositsUsed(); - $outstandingOpened += ($obj->total_ttc - $paiement - $creditnotes - $deposits); + $remaintopay = ($obj->total_ttc - $paiement - $creditnotes - $deposits); + $outstandingOpened += $remaintopay; } //if credit note is converted but not used // TODO Do this also for customer ? if ($mode == 'supplier' && $obj->type == FactureFournisseur::TYPE_CREDIT_NOTE && $tmpobject->isCreditNoteUsed()) { - $outstandingOpened -= $tmpobject->getSumFromThisCreditNotesNotUsed(); + $remainingcreditnote = $tmpobject->getSumFromThisCreditNotesNotUsed(); + $remaintopay -= $remainingcreditnote; + $outstandingOpened -= $remainingcreditnote; + } + + if ($remaintopay) { + $arrayofrefopened[$obj->rowid] = $obj->ref; } } - return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref); // 'opened' is 'incl taxes' + return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref, 'refsopened'=>$arrayofrefopened); // 'opened' is 'incl taxes' } else { dol_syslog("Sql error ".$this->db->lasterror, LOG_ERR); return array(); From b87ac639fd4ed060e73653f9123420cfa3354c8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 03:02:18 +0200 Subject: [PATCH 082/146] Update card.php --- htdocs/salaries/card.php | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index f83f879cf8e..6d30ae73e3d 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -72,28 +72,24 @@ $childids = $user->getAllChildIds(1); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -if (($id > 0) || $ref) { - $object->fetch($id, $ref); - - // Check current user can read this leave request - $canread = 0; - if (!empty($user->rights->salaries->readall)) { - $canread = 1; - } - if (!empty($user->rights->salaries->read) && in_array($object->fk_user, $childids)) { - $canread = 1; - } - if (!$canread) { - accessforbidden(); - } -} - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('salarycard', 'globalcard')); $object = new Salary($db); if ($id > 0 || !empty($ref)) { $object->fetch($id, $ref); + + // Check current user can read this salary + $canread = 0; + if (!empty($user->rights->salaries->readall)) { + $canread = 1; + } + if (!empty($user->rights->salaries->read) && $object->fk_user > 0 && in_array($object->fk_user, $childids)) { + $canread = 1; + } + if (!$canread) { + accessforbidden(); + } } // Security check From 61d5152209cea58b04ec724639616d7a3624d1bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 03:23:04 +0200 Subject: [PATCH 083/146] Update eldy.lib.php --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7c93cd94163..b1f625ac680 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -382,7 +382,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'submenus' => array(), ); - // Tickets and knwoledge base + // Tickets and knowledge base $tmpentry = array( 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knowledgemanagement->enabled)), 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knowledgemanagement->knowledgerecord->read)), From 77b8d91895a2019dc4783747cec7e75657b99363 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 04:56:25 +0200 Subject: [PATCH 084/146] Update 13.0.0-14.0.0.sql --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index af3a1662ab6..eff69ca5616 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -583,7 +583,7 @@ DROP TABLE llx_categorie_association; DROP TABLE llx_cond_reglement; DROP TABLE llx_zapier_hook_extrafields; -create table llx_onlinesignature +CREATE TABLE llx_onlinesignature ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, @@ -599,4 +599,5 @@ create table llx_onlinesignature -- VMYSQL4.3 ALTER TABLE llx_partnership MODIFY COLUMN date_partnership_end date NULL; -- VPGSQL8.2 ALTER TABLE llx_partnership ALTER COLUMN date_partnership_end DROP NOT NULL; -Alter TABLE llx_facture_fourn CHANGE fk_mode_transport fk_transport_mode integer +ALTER TABLE llx_facture_fourn CHANGE COLUMN fk_mode_transport fk_transport_mode integer; + From ea9a07fb3daa000a536c80d68fc246294b7272c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 05:11:31 +0200 Subject: [PATCH 085/146] Update dolibarr.php --- htdocs/admin/system/dolibarr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index a39d4dc2a8c..ace35668e5f 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -505,7 +505,7 @@ if ($resql) { $obj = $db->fetch_object($resql); print ''; - print ''."\n"; + print ''."\n"; print ''; - print ''."\n"; + print ''."\n"; print ''; $entry .= ''; $entry .= ''; $entry .= ''; From 63abe2f1ff57cae58bf97bfb4a587ca521dbba2b Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Thu, 9 Sep 2021 19:56:28 +0400 Subject: [PATCH 096/146] FIX #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary. --- htdocs/commande/list.php | 6 +++--- htdocs/expedition/list.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 0404c6a595c..e0208d3cdcc 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -429,7 +429,7 @@ $sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label, $sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender,'; $sql .= ' c.fk_cond_reglement,c.fk_mode_reglement,c.fk_shipping_method,'; $sql .= ' c.fk_input_reason'; -if ($search_categ_cus) { +if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ", cc.fk_categorie, cc.fk_soc"; } // Add fields from extrafields @@ -446,7 +446,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -if (!empty($search_categ_cus)) { +if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } $sql .= ', '.MAIN_DB_PREFIX.'commande as c'; @@ -793,7 +793,7 @@ if ($resql) { if ($search_product_category != '') { $param .= '&search_product_category='.urlencode($search_product_category); } - if ($search_categ_cus > 0) { + if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $param .= '&search_categ_cus='.urlencode($search_categ_cus); } if ($show_files) { diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index fd056a75056..50a59e0d2e4 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -235,7 +235,7 @@ $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " e.date_creation as date_creation, e.tms as date_update,"; $sql .= " u.login"; -if ($search_categ_cus) { +if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ", cc.fk_categorie, cc.fk_soc"; } // Add fields from extrafields @@ -260,7 +260,7 @@ if ($search_product_category > 0) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; -if (!empty($search_categ_cus)) { +if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; @@ -449,7 +449,7 @@ if ($search_datereceipt_end) { if ($search_product_category != '') { $param .= '&search_product_category='.urlencode($search_product_category); } -if ($search_categ_cus > 0) { +if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $param .= '&search_categ_cus='.urlencode($search_categ_cus); } if ($search_status != '') { From ffd7f608300617bebe7b0832fa6a63cccac8cc22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 19:21:32 +0200 Subject: [PATCH 097/146] FIX #18589 #18617 --- htdocs/core/lib/files.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 9db9379523e..43ad95157dc 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2291,9 +2291,13 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $sqlprotectagainstexternals = ''; $ret = array(); - // Find the subdirectory name as the reference. For exemple original_file='10/myfile.pdf' -> refname='10' + // Find the subdirectory name as the reference. For example original_file='10/myfile.pdf' -> refname='10' if (empty($refname)) { $refname = basename(dirname($original_file)."/"); + if ($refname == 'thumbs') { + // If we get the thumbns directory, we must go one step higher. For example original_file='10/thumbs/myfile_small.jpg' -> refname='10' + $refname = basename(dirname(dirname($original_file))."/"); + } } // Define possible keys to use for permission check From b8b5b97d78e10d159ccb1538d300c91221fa8dbd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 19:47:15 +0200 Subject: [PATCH 098/146] Code comment --- htdocs/holiday/class/holiday.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 95462ddd77e..5ecc4d7325a 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -714,12 +714,12 @@ class Holiday extends CommonObject // Update status $sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET"; if (!empty($this->statut) && is_numeric($this->statut)) { - $sql .= " statut = ".$this->statut.","; + $sql .= " statut = ".((int) $this->statut).","; } else { $error++; } $sql .= " ref = '".$this->db->escape($num)."'"; - $sql .= " WHERE rowid= ".$this->id; + $sql .= " WHERE rowid= ".((int) $this->id); $this->db->begin(); @@ -1937,7 +1937,7 @@ class Holiday extends CommonObject * * @param int $fk_user_action Id user creation * @param int $fk_user_update Id user update - * @param string $label Label + * @param string $label Label (Example: 'Leave', 'Manual update', 'Leave request cancelation'...) * @param int $new_solde New value * @param int $fk_type Type of vacation * @return int Id of record added, 0 if nothing done, < 0 if KO From 6465e8aa36f95ac36ad418a8e6ecfbd58684f14f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 19:46:40 +0200 Subject: [PATCH 099/146] Include ref into label of log history --- htdocs/holiday/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index a58806e2e4f..150a9c0754b 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -550,9 +550,10 @@ if (empty($reshook)) { $nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday); $soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type); $newSolde = ($soldeActuel - $nbopenedday); + $label = $langs->transnoentitiesnoconv("Holidays").' - '.$object->ref; // The modification is added to the LOG - $result = $object->addLogCP($user->id, $object->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde, $object->fk_type); + $result = $object->addLogCP($user->id, $object->fk_user, $label, $newSolde, $object->fk_type); if ($result < 0) { $error++; setEventMessages(null, $object->errors, 'errors'); From 7526cb3b8be93a4d268e7b210f441469476c8b92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 09:44:06 +0200 Subject: [PATCH 100/146] Fix VAT rate label and add Mali default vat rate --- htdocs/install/mysql/data/llx_c_tva.sql | 282 ++++++++++++------------ htdocs/langs/en_US/admin.lang | 10 +- htdocs/langs/en_US/companies.lang | 2 +- htdocs/langs/en_US/compta.lang | 26 +-- 4 files changed, 162 insertions(+), 158 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 72746ac99ea..cae269783e4 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -47,9 +47,9 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 1 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 133, 13, '19','0','TVA 19%', 1); -- ANGOLA (id country=35) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 351, 35, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 352, 35, '7','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 353, 35, '14','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 351, 35, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 352, 35, '7','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 353, 35, '14','0','VAT rate - standard',1); -- ARGENTINA (id country=23) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (231, 23, '0','0','IVA Rate 0', 1); @@ -57,31 +57,31 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (23 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (233, 23, '21','0','IVA standard rate',1); -- AUSTRALIA (id country=28) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (281, 28, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (282, 28, '10','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (281, 28, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (282, 28, '10','0','VAT rate - standard',1); -- AUSTRIA (id country=41) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (411, 41, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (412, 41, '10','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (413, 41, '20','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (411, 41, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (412, 41, '10','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (413, 41, '20','0','VAT rate - standard',1); -- BRASIL (id country=56) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (561, 56, '0','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (561, 56, '0','0','VAT rate - reduced',1); -- BULGARIA (id country=59) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (591, 59, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (592, 59, '7','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (593, 59, '20','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (591, 59, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (592, 59, '7','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (593, 59, '20','0','VAT rate - standard',1); -- BELGIUM (id country=2) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 21, 2, '0','0','VAT Rate 0 ou non applicable',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 22, 2, '6','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 23, 2, '21','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 24, 2, '12','0','VAT reduced rate', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 21, 2, '0','0','VAT rate 0 ou non applicable',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 22, 2, '6','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 23, 2, '21','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 24, 2, '12','0','VAT rate - reduced', 1); -- CANADA (id country=14) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (141, 14, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (142, 14, '7','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (141, 14, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (142, 14, '7','0','VAT rate - standard',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (143, 14,'5','0','9.975','1','GST/TPS and PST/TVQ rate for Province',1); --insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (143, 14,'5','0','9.975','1','GST/TPS and PST/TVQ rate for Quebec',1); --insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (144, 14,'5','0','7','1','GST/TPS and PST/TVQ rate for British Columbia',1); @@ -89,43 +89,43 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_typ -- CAMEROUN (id country=24) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (241, 24, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (242, 24, '19.25','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (241, 24, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (242, 24, '19.25','0','VAT rate - standard',1); -- CHILE (id country=67) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (671, 67, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (672, 67, '19','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (671, 67, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (672, 67, '19','0','VAT rate - standard',1); -- CHINA (id country=9) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 91, 9, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 92, 9, '13','0','VAT reduced rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 93, 9, '3','0','VAT super reduced rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 94, 9, '17','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 91, 9, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 92, 9, '13','0','VAT rate - reduced 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 93, 9, '3','0','VAT rate - super-reduced 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 94, 9, '17','0','VAT rate - standard',1); -- CONGO = REPUBLIQUE DU CONGO (id country=72) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (721, 72, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (722, 72, '18','0', '0.9', '1', 'VAT Rate 18+0.9', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (721, 72, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (722, 72, '18','0', '0.9', '1', 'VAT rate 18+0.9', 1); -- CYPRUS (id country=78) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (781, 78, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (782, 78, '9','0','VAT Rate 9',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (783, 78, '5','0','VAT Rate 5',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (784, 78, '19','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (781, 78, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (782, 78, '9','0','VAT rate 9',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (783, 78, '5','0','VAT rate 5',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (784, 78, '19','0','VAT rate - standard',1); -- DANMERK (id country=80) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (801, 80, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (802, 80, '25','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (801, 80, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (802, 80, '25','0','VAT rate - standard',1); -- FRANCE (id country=1) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1, '0','0','VAT Rate 0 ou non applicable',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 12, 1, '20','0','VAT standard rate (France hors DOM-TOM)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 13, 1, '10','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 14, 1, '5.5','0','VAT reduced rate (France hors DOM-TOM)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 15, 1, '2.1','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (16, 1, '8.5', '85', '0', 'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (17, 1, '8.5', '85NPR', '1', 'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (18, 1, '8.5', '85NPROM', '1', 2, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (19, 1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1, '0','0','VAT rate 0 ou non applicable',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 12, 1, '20','0','VAT rate - standard (France hors DOM-TOM)',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 13, 1, '10','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 14, 1, '5.5','0','VAT rate - reduced (France hors DOM-TOM)',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 15, 1, '2.1','0','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (16, 1, '8.5', '85', '0', 'VAT rate - standard (DOM sauf Guyane et Saint-Martin)',0); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (17, 1, '8.5', '85NPR', '1', 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (18, 1, '8.5', '85NPROM', '1', 2, 3, 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (19, 1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0); -- GERMANY (id country=5) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 51, 5, '0','0','No VAT', 1); @@ -147,11 +147,11 @@ insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,loca -- ICELAND (id country=116) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1161, 116, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1163, 116,'25.5','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1162, 116, '7','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1163, 116,'25.5','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1162, 116, '7','0','VAT rate - reduced',1); -- INDIA (id country=117) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '0','0','VAT Rate 0', 0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '0','0','VAT rate 0', 0); insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1172, 117, 'C+S-5' , 0, 2.5, '1', 2.5, '1', 0, 'CGST+SGST - Same state sales', 1); insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1173, 117, 'I-5' , 5, 0, '0', 0, '0', 0, 'IGST', 1); @@ -163,54 +163,58 @@ insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2 insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1179, 117, 'I-28' , 28, 0, '0', 0, '0', 0, 'IGST', 1); -- IRELAND (id country=8) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 81, 8, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 82, 8, '23','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 83, 8, '13.5','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 84, 8, '9','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 85, 8, '4.8','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 81, 8, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 82, 8, '23','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 83, 8, '13.5','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 84, 8, '9','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 85, 8, '4.8','0','VAT rate - reduced',1); -- ITALY (id country=3) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 31, 3, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 32, 3, '10','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 33, 3, '4','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '22','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 31, 3, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 32, 3, '10','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 33, 3, '4','0','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '22','0','VAT rate - standard',1); -- IVORY COST (id country=21) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (211, 21, '0','0',0,0,0,0,'IVA Rate 0',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (212, 21, '18','0',7.5,2,0,0,'IVA standard rate',1); -- JAPAN (id country=123) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1231, 123, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1232, 123, '5','0','VAT Rate 5',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1231, 123, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1232, 123, '5','0','VAT rate 5',1); -- LUXEMBOURG (id country=140) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1401, 140, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1402, 140, '14','0','VAT intermediary rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1403, 140, '8','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1404, 140, '3','0','VAT super-reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1405, 140, '17','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1401, 140, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1402, 140, '14','0','VAT rate - intermediary',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1403, 140, '8','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1404, 140, '3','0','VAT rate - super-reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1405, 140, '17','0','VAT rate - standard',1); + +-- MALI (id country=147) +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1471, 147, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1471, 147, '18','0','VAT rate - standard', 1); -- MONACO (id country=27) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 271, 27, '0','0','VAT Rate 0 ou non applicable',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 272, 27, '8.5','0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 273, 27, '8.5','1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 274, 27, '5.5','0','VAT reduced rate (France hors DOM-TOM)',0); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 275, 27,'19.6','0','VAT standard rate (France hors DOM-TOM)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 276, 27, '2.1','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 277, 27, '7','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 271, 27, '0','0','VAT rate 0 ou non applicable',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 272, 27, '8.5','0','VAT rate - standard (DOM sauf Guyane et Saint-Martin)',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 273, 27, '8.5','1','VAT rate - standard (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 274, 27, '5.5','0','VAT rate - reduced (France hors DOM-TOM)',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 275, 27,'19.6','0','VAT rate - standard (France hors DOM-TOM)',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 276, 27, '2.1','0','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 277, 27, '7','0','VAT rate - reduced',1); -- MAROCO (id country=12) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 121, 12, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 122, 12, '14','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 123, 12, '10','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 124, 12, '7','0','VAT super-reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 125, 12, '20','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 121, 12, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 122, 12, '14','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 123, 12, '10','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 124, 12, '7','0','VAT rate - super-reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 125, 12, '20','0','VAT rate - standard',1); -- MALTA (id country=148) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1481, 148, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1482, 148, '7','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1483, 148, '5','0','VAT super-reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1484, 148, '18','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1481, 148, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1482, 148, '7','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1483, 148, '5','0','VAT rate - super-reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1484, 148, '18','0','VAT rate - standard',1); -- NEDERLAND (id country=17) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 171, 17, '0','0','0 BTW tarief', 1); @@ -219,96 +223,96 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 1 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 174, 17, '21','0','Algemeen BTW tarief (vanaf 1 oktober 2012)',0); -- NEW CALEDONIA (id country=165) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1651, 165, '0','0','VAT Rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1651, 165, '0','0','VAT rate 0', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1652, 165, '3','0','VAT standard 3', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1653, 165, '6','0','VAT standard 6', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1654, 165, '11','0','VAT standard rate', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1654, 165, '11','0','VAT rate - standard', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1655, 165, '22','0','VAT standard high', 1); -- NEW ZEALAND (id country=166) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1661, 166, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1662, 166, '15','0','VAT standard rate', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1661, 166, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1662, 166, '15','0','VAT rate - standard', 1); -- NIGERIA (id country=169) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1691, 169, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1692, 169, '5','0','VAT standard rate', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1691, 169, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1692, 169, '5','0','VAT rate - standard', 1); -- NORWAY (id country=173) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1731, 173, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1732, 173, '14','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1733, 173, '8','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1734, 173, '25','0','VAT standard rate', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1731, 173, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1732, 173, '14','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1733, 173, '8','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1734, 173, '25','0','VAT rate - standard', 1); -- PANAMA (id country=178) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1781, 178, '0','0','ITBMS Rate 0',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1782, 178, '7','0','ITBMS standard rate',1); -- PERU (id country=181) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1811, 181, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1818, 181, '18','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1811, 181, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1818, 181, '18','0','VAT rate - standard',1); -- POLAND (id country=184) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1841, 184, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1842, 184, '8','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1843, 184, '3','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1844, 184, '23','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1841, 184, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1842, 184, '8','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1843, 184, '3','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1844, 184, '23','0','VAT rate - standard',1); -- PORTUGAL (id country=25) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 251, 25, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 252, 25, '13','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 253, 25, '23','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 254, 25, '6','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 251, 25, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 252, 25, '13','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 253, 25, '23','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 254, 25, '6','0','VAT rate - reduced',1); -- ROMANIA (id country=188) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1881, 188, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1882, 188, '9','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1883, 188, '19','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1884, 188, '5','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1881, 188, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1882, 188, '9','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1883, 188, '19','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1884, 188, '5','0','VAT rate - reduced',1); -- SAUDI ARABIA (id country=26) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 261, 26, '0', '0', 'VAT Rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 262, 26, '5', '0', 'VAT Rate 5', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 261, 26, '0', '0', 'VAT rate 0', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 262, 26, '5', '0', 'VAT rate 5', 1); -- SAN SALVADOR (id country=86) INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 861, 86, '0', '0', 'SIN IVA', 1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 862, 86, '13', '0', 'IVA 13', 1); -- SENEGAL (id country=22) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 221, 22, '0', '0', 'VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 222, 22, '10', '0', 'VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 223, 22, '18', '0', 'VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 221, 22, '0', '0', 'VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 222, 22, '10', '0', 'VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 223, 22, '18', '0', 'VAT rate - standard',1); -- SLOVAKIA (id country=201) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2011, 201, '0', '0', 'VAT Rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2012, 201, '10', '0', 'VAT reduced rate', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2013, 201, '19', '0', 'VAT standard rate', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2011, 201, '0', '0', 'VAT rate 0', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2012, 201, '10', '0', 'VAT rate - reduced', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2013, 201, '19', '0', 'VAT rate - standard', 1); -- SLOVENIA (id country=202) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2021, 202, '0', '0', 'VAT Rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2022, 202,'9.5', '0', 'VAT reduced rate', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2023, 202, '22', '0', 'VAT standard rate', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2021, 202, '0', '0', 'VAT rate 0', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2022, 202,'9.5', '0', 'VAT rate - reduced', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2023, 202, '22', '0', 'VAT rate - standard', 1); -- SOUTH AFRICA (id country=205) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051, 205, '0', '0', 'VAT Rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052, 205, '15', '0', 'VAT standard rate', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051, 205, '0', '0', 'VAT rate 0', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052, 205, '15', '0', 'VAT rate - standard', 1); -- SPAIN (id country=4) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 41, 4, '0','0', '0','3','-19:-15:-9','5','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4,'10','0','1.4','3','-19:-15:-9','5','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-19:-15:-9','5','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4,'21','0','5.2','3','-19:-15:-9','5','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 41, 4, '0','0', '0','3','-19:-15:-9','5','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4,'10','0','1.4','3','-19:-15:-9','5','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-19:-15:-9','5','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4,'21','0','5.2','3','-19:-15:-9','5','VAT rate - standard',1); -- SWEDEN (id country=20) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 201, 20, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 202, 20, '12','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 203, 20, '6','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 204, 20, '25','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 201, 20, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 202, 20, '12','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 203, 20, '6','0','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 204, 20, '25','0','VAT rate - standard',1); -- SWITZERLAND (id country=6) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 61, 6, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 62, 6, '3.7','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 63, 6, '2.5','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '7.7','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 61, 6, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 62, 6, '3.7','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 63, 6, '2.5','0','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '7.7','0','VAT rate - standard',1); -- SRI LANKA (id country=207) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2071, 207, '0','0','VAT 0', 1); @@ -319,7 +323,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (21 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2132, 213, '5','0','VAT 5%',1); -- TUNISIA (id country=10) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (101,10, '0','0','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (101,10, '0','0','VAT rate 0',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (102,10, '12','0','VAT 12%',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (103,10, '18','0','VAT 18%',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (104,10, '7.5','0','VAT 6% Majoré à 25% (7.5%)',1); @@ -329,14 +333,14 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (10 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (107,10,'18.18','0','VAT 18%+FODEC', 1, 1, '4', 0, 0); -- UKRAINE (id country=226) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '0','0','VAT Rate 0',1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '0','0','VAT rate 0',1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2262,226, '20','0','VAT standart rate',1); -- UNITED OF KINGDOM (id country=7) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 71, 7, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 72, 7, '17.5','0','VAT standard rate before 2011',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 73, 7, '5','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 74, 7, '20','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 71, 7, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 72, 7, '17.5','0','VAT rate - standard before 2011',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 73, 7, '5','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 74, 7, '20','0','VAT rate - standard',1); -- UNITED STATES (id country=11) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (111,11, '0','0','No Sales Tax',1); @@ -350,16 +354,16 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (11 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1931,193, '0','0','No VAT in SPM',1); -- SAINT MARTIN (id country=24) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2461,246, '0','0','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2461,246, '0','0','VAT rate 0',1); -- MAURITANIA (id country=151) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1511,151, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1512,151, '14','0','VAT Rate 14',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1511,151, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1512,151, '14','0','VAT rate 14',1); -- MAURITIUS (id country=152) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1521,152, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1522,152, '15','0','VAT Rate 15',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1521,152, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1522,152, '15','0','VAT rate 15',1); -- HONDURAS (id country=114) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1141,114, '0','0','No ISV',1); @@ -384,7 +388,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (23 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2322,232, '12','0','VAT 12%',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2323,232, '8','0','VAT 8%',1); --- Example of code to insert a vat rate 0 for each country +-- Example of code to insert a VAT rate 0 for each country --delete from llx_c_tva where rowid = 1181; -- to delete a record that does not follow rules for rowid (fk_pays+'1') --insert into llx_c_tva(rowid, fk_pays, taux, recuperableonly, note, active) SELECT CONCAT(c.rowid, '1'), c.rowid, 0, 0, 'No VAT', 1 from llx_c_country as c where c.rowid not in (select fk_pays from llx_c_tva); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5bda447f368..a0b62ca38cc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -75,7 +75,7 @@ Dictionary=Dictionaries ErrorReservedTypeSystemSystemAuto=Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record ErrorCodeCantContainZero=Code can't contain value 0 DisableJavascript=Disable JavaScript and Ajax functions -DisableJavascriptNote=Note: For test or debug purpose. For optimization for blind person or text browsers, you may prefer to use the setup on the profile of user +DisableJavascriptNote=Note: For test or debug purpose only. For optimization for blind person or text browsers, you may prefer to use the setup on the profile of user UseSearchToSelectCompanyTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant COMPANY_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. UseSearchToSelectContactTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. DelaiedFullListToSelectCompany=Wait until a key is pressed before loading content of Third Parties combo list.
This may increase performance if you have a large number of third parties, but it is less convenient. @@ -604,7 +604,7 @@ Module400Desc=Management of projects, leads/opportunities and/or tasks. You can Module410Name=Webcalendar Module410Desc=Webcalendar integration Module500Name=Taxes & Special Expenses -Module500Desc=Management of other expenses (sale taxes, social or fiscal taxes, dividends, ...) +Module500Desc=Management of other expenses (sales taxes, social or fiscal taxes, dividends, ...) Module510Name=Salaries Module510Desc=Record and track employee payments Module520Name=Loans @@ -1910,7 +1910,7 @@ UnicodeCurrency=Enter here between braces, list of byte number that represent th ColorFormat=The RGB color is in HEX format, eg: FF0000 PictoHelp=Icon name in dolibarr format ('image.png' if into the current theme directory, 'image.png@nom_du_module' if into the directory /img/ of a module) PositionIntoComboList=Position of line into combo lists -SellTaxRate=Sale tax rate +SellTaxRate=Sales tax rate RecuperableOnly=Yes for VAT "Not Perceived but Recoverable" dedicated for some state in France. Keep value to "No" in all other cases. UrlTrackingDesc=If the provider or transport service offers a page or web site to check the status of your shipments, you may enter it here. You can use the key {TRACKID} in the URL parameters so the system will replace it with the tracking number the user entered into the shipment card. OpportunityPercent=When you create a lead, you will define an estimated amount of project/lead. According to status of the lead, this amount may be multiplied by this rate to evaluate a total amount all your leads may generate. Value is a percentage (between 0 and 100). @@ -2151,5 +2151,5 @@ DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file APIsAreNotEnabled=APIs modules are not enabled YouShouldSetThisToOff=You should set this to 0 or off InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s -IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sale tax -IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sale tax +IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sales tax +IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sales tax diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index b52ab6131be..7deee6a9d55 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -80,7 +80,7 @@ Web=Web Poste= Position DefaultLang=Default language VATIsUsed=Sales tax used -VATIsUsedWhenSelling=This defines if this third party includes a sale tax or not when it makes an invoice to its own customers +VATIsUsedWhenSelling=This defines if this third party includes a sales tax or not when it makes an invoice to its own customers VATIsNotUsed=Sales tax is not used CopyAddressFromSoc=Copy address from third-party details ThirdpartyNotCustomerNotSupplierSoNoRef=Third party neither customer nor vendor, no available referring objects diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 8329346c163..c5e1a58d243 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -188,25 +188,25 @@ LT1ReportByCustomers=Report tax 2 by third party LT2ReportByCustomers=Report tax 3 by third party LT1ReportByCustomersES=Report by third party RE LT2ReportByCustomersES=Report by third party IRPF -VATReport=Sale tax report -VATReportByPeriods=Sale tax report by period -VATReportByMonth=Sale tax report by month -VATReportByRates=Sale tax report by rates -VATReportByThirdParties=Sale tax report by third parties -VATReportByCustomers=Sale tax report by customer +VATReport=Sales tax report +VATReportByPeriods=Sales tax report by period +VATReportByMonth=Sales tax report by month +VATReportByRates=Sales tax report by rate +VATReportByThirdParties=Sales tax report by third partie +VATReportByCustomers=Sales tax report by customer VATReportByCustomersInInputOutputMode=Report by the customer VAT collected and paid -VATReportByQuartersInInputOutputMode=Report by Sale tax rate of the tax collected and paid +VATReportByQuartersInInputOutputMode=Report by Sales tax rate of the tax collected and paid VATReportShowByRateDetails=Show details of this rate LT1ReportByQuarters=Report tax 2 by rate LT2ReportByQuarters=Report tax 3 by rate LT1ReportByQuartersES=Report by RE rate LT2ReportByQuartersES=Report by IRPF rate -SeeVATReportInInputOutputMode=See report %sVAT encasement%s for a standard calculation -SeeVATReportInDueDebtMode=See report %sVAT on flow%s for a calculation with an option on the flow -RulesVATInServices=- For services, the report includes the VAT regulations actually received or issued on the basis of the date of payment. -RulesVATInProducts=- For material assets, the report includes the VAT received or issued on the basis of the date of payment. -RulesVATDueServices=- For services, the report includes VAT invoices due, paid or not, based on the invoice date. -RulesVATDueProducts=- For material assets, the report includes the VAT invoices, based on the invoice date. +SeeVATReportInInputOutputMode=See report %sVAT collection%s for a standard calculation +SeeVATReportInDueDebtMode=See report %sVAT on debit%s for a calculation with an option on the invoicing +RulesVATInServices=- For services, the report includes the VAT of payments actually received or paid on the basis of the date of payment. +RulesVATInProducts=- For material assets, the report includes the VAT on the basis of the date of payment. +RulesVATDueServices=- For services, the report includes VAT of due invoices, paid or not, based on the invoice date. +RulesVATDueProducts=- For material assets, the report includes the VAT of due invoices, based on the invoice date. OptionVatInfoModuleComptabilite=Note: For material assets, it should use the date of delivery to be more fair. ThisIsAnEstimatedValue=This is a preview, based on business events and not from the final ledger table, so final results may differ from this preview values PercentOfInvoice=%%/invoice From 4939cc99114de681da28bbd28f8dfc3608c45813 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 11:04:59 +0200 Subject: [PATCH 101/146] Fix trans --- htdocs/langs/en_US/eventorganization.lang | 6 +++--- htdocs/langs/en_US/members.lang | 2 +- htdocs/langs/en_US/stocks.lang | 6 +++--- htdocs/langs/fr_FR/members.lang | 4 ++-- htdocs/public/members/new.php | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index d4110dd184f..20f201447f3 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -125,7 +125,7 @@ BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s EventType = Event type LabelOfBooth=Booth label LabelOfconference=Conference label -ConferenceIsNotConfirmed=Subcription not available, conference is not confirmed yet +ConferenceIsNotConfirmed=Registration not available, conference is not confirmed yet DateMustBeBeforeThan=%s must be before %s DateMustBeAfterThan=%s must be after %s @@ -145,11 +145,11 @@ VoteError = An error has occurred during the vote, please try again. # # SubscriptionOk page # -SubscriptionOk = Your subscription to this conference has been validated +SubscriptionOk = Your subscription has been validated # # Subscription validation mail # -ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to a conference +ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to an event # # Payment page # diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 695a11044b1..5285e4ecb60 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -206,7 +206,7 @@ VATToUseForSubscriptions=VAT rate to use for contributionss NoVatOnSubscription=No VAT for contributions ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS=Product used for contribution line into invoice: %s NameOrCompany=Name or company -SubscriptionRecorded=Subscription recorded +SubscriptionRecorded=Contribution recorded NoEmailSentToMember=No email sent to member EmailSentToMember=Email sent to member at %s SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired contributions diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 88e14abaaf6..3c4c33628c4 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -12,9 +12,9 @@ AddWarehouse=Create warehouse AddOne=Add one DefaultWarehouse=Default warehouse WarehouseTarget=Target warehouse -ValidateSending=Confirm sending -CancelSending=Cancel sending -DeleteSending=Delete sending +ValidateSending=Confirm shipment +CancelSending=Cancel shipment +DeleteSending=Delete shipment Stock=Stock Stocks=Stocks MissingStocks=Missing stocks diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 88a0aa11246..2e1498e4507 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -70,8 +70,8 @@ MemberTypeDeleted=Type d'adhérent supprimé MemberTypeCanNotBeDeleted=Ce type d'adhérent ne peut pas être supprimé NewSubscription=Nouvelle adhésion NewSubscriptionDesc=Ce formulaire permet de vous inscrire comme nouvel adhérent de l'association. Pour un renouvellement (si vous êtes déjà adhérent), contactez plutôt l'association par email %s. -Subscription=Adhésion/cotisation -Subscriptions=Adhésions/cotisations +Subscription=Adhésion / cotisation +Subscriptions=Adhésions / cotisations SubscriptionLate=En retard SubscriptionNotReceived=Cotisation non reçue ListOfSubscriptions=Liste des cotisations diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index f9cd88a8c38..f84fce1a2b6 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -724,7 +724,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER } if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { - $amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT); + $amount = $amount ? $amount : (GETPOST('amount') ? price2num(GETPOST('amount'), 'MT', 2) : $conf->global->MEMBER_NEWFORM_AMOUNT); } $amount = price2num($amount); @@ -732,10 +732,10 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' print '
'; From c66181a00ee67290d6320738a5200c8335db89a0 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 10 Sep 2021 13:25:40 +0200 Subject: [PATCH 102/146] fix: when COMPANY_SHOW_ADDRESS_SELECTLIST is 1 ajax call to company.php is broken --- htdocs/core/class/html.form.class.php | 2 +- htdocs/societe/ajax/company.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 98807af1858..d361118b970 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1359,7 +1359,7 @@ class Form $sql .= " AND s.status <> 0"; } if (!empty($excludeids)) { - $sql .= " AND rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")"; + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")"; } // Add criteria if ($filterkey && $filterkey != '') { diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php index 76151bccb97..b2578ea6562 100644 --- a/htdocs/societe/ajax/company.php +++ b/htdocs/societe/ajax/company.php @@ -119,10 +119,12 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { } if (!empty($excludeids)) { - $filter .= 'rowid NOT IN ('.$db->sanitize($excludeids).')'; + $excludeids = explode(',', $excludeids); + } else { + $excludeids = array(); } - $arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson); + $arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson, 0, 'minwidth100', '', false, $excludeids); $db->close(); From 29820f446db1281d89ee4378b7e98488c63e7b54 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Fri, 10 Sep 2021 11:36:08 +0200 Subject: [PATCH 103/146] fix import of product desc without wrong linebreaks --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 98807af1858..9490a52a333 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3380,7 +3380,7 @@ class Form if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { $opt .= ' data-qty="'.$objp->quantity.'" data-up="'.$objp->unitprice.'" data-discount="'.$outdiscount.'"'; } - $opt .= ' data-description="'.dol_escape_htmltag($objp->description).'"'; + $opt .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; $opt .= ' data-html="'.dol_escape_htmltag($optlabel).'"'; $opt .= '>'; From f3a555ec69a83b31b798b8c53bad4be403bc7afa Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 10 Sep 2021 15:17:09 +0200 Subject: [PATCH 104/146] fix: show display/hide icon on extrafield type separator --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 161b0fb92bb..8e721b09c5c 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1976,7 +1976,7 @@ class ExtraFields */ public function showSeparator($key, $object, $colspan = 2, $display_type = 'card') { - global $langs; + global $langs, $conf; if ($display_type=='card') { $tagtype='tr'; From 257686c2feeddca9ef1ad8e5bb0fa260d3e373d6 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 10 Sep 2021 15:45:03 +0200 Subject: [PATCH 105/146] fix: on Event tabs, if no evt type use in filter, filter on label and state not apply --- htdocs/core/lib/company.lib.php | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 4b536ccb2ad..8c79ef337f8 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1548,7 +1548,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $sql .= "OR ("; } if (!empty($code)) { - addEventTypeSQL($sql, $code, $donetodo, $now, $filters, ""); + addEventTypeSQL($sql, $code); } if ($key != 0) { $sql .= ")"; @@ -1556,9 +1556,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } $sql .= ')'; } elseif (!empty($actioncode)) { - addEventTypeSQL($sql, $actioncode, $donetodo, $now, $filters); + addEventTypeSQL($sql, $actioncode); } + addOtherFilterSQL($sql, $donetodo, $now, $filters); + if (is_array($actioncode)) { foreach ($actioncode as $code) { $sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj); @@ -2021,13 +2023,10 @@ function show_subsidiaries($conf, $langs, $db, $object) * * @param string $sql $sql modified * @param string $actioncode Action code - * @param string $donetodo donetodo - * @param string $now now - * @param string $filters array * @param string $sqlANDOR "AND", "OR" or "" sql condition * @return string sql request */ -function addEventTypeSQL(&$sql, $actioncode, $donetodo, $now, $filters, $sqlANDOR = "AND") +function addEventTypeSQL(&$sql, $actioncode, $sqlANDOR = "AND") { global $conf, $db; // Condition on actioncode @@ -2054,6 +2053,23 @@ function addEventTypeSQL(&$sql, $actioncode, $donetodo, $now, $filters, $sqlANDO } } + return $sql; +} + +/** + * Add Event Type SQL + * + * @param string $sql $sql modified + * @param string $donetodo donetodo + * @param string $now now + * @param string $filters array + * @return string sql request + */ +function addOtherFilterSQL(&$sql, $donetodo, $now, $filters) +{ + global $conf, $db; + // Condition on actioncode + if ($donetodo == 'todo') { $sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; } elseif ($donetodo == 'done') { From 75cd63a29bf50ef7815a40ceff0ddd4d760a582f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 17:39:08 +0200 Subject: [PATCH 106/146] Fix css and missing test --- htdocs/accountancy/customer/index.php | 14 +++++++------- htdocs/accountancy/supplier/index.php | 12 ++++++------ htdocs/accountancy/supplier/list.php | 22 +++++++++++++--------- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index ede72c9d9e6..0ee9c865603 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -265,8 +265,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', print '
'; print '
'.$langs->trans("Description").''; @@ -415,7 +416,7 @@ if ($projectid > 0) { $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // Show message - $message = 'entity > 1 ? "&entity=".$conf->entity : ""); $message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); $message .= "&project=".$projectid.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').''; print $message; @@ -638,6 +639,8 @@ print ''; print ''; print ''; +$title = $langs->trans("ListOfConferencesOrBooths"); + $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?action=create'.(!empty($project->id)?'&withproject=1&fk_project='.$project->id:'').(!empty($project->socid)?'&fk_soc='.$project->socid:'').'&backtopage='.urlencode($_SERVER['PHP_SELF']).(!empty($project->id)?'?projectid='.$project->id:''), '', $permissiontoadd); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index ff46f7b4a7b..fd762c03568 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -111,22 +111,33 @@ if (empty($reshook)) { $error = 0; if (!empty($withproject)) { - $backurlforlist = dol_buildpath('/eventorganization/conferenceorboothattendee_list.php?withproject=1', 1); + $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?withproject=1'; } else { - $backurlforlist = dol_buildpath('/eventorganization/conferenceorboothattendee_list.php', 1); + $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php'; } - if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = dol_buildpath('/eventorganization/conferenceorboothattendee_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); + $backtopage = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?id='.($id > 0 ? $id : '__ID__'); } } } + if ($cancel) { + if (!empty($backtopageforcancel)) { + header("Location: ".$backtopageforcancel); + exit; + } elseif (!empty($backtopage)) { + header("Location: ".$backtopage); + exit; + } + $action = ''; + } + + $triggermodname = 'EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_MODIFY'; // Name of trigger action code to execute when we modify record // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 401f3367044..6f4d2a34565 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -27,16 +27,15 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; if ($conf->categorie->enabled) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } -// load eventorganization libraries -require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php'); @@ -209,8 +208,18 @@ if (empty($reshook)) { */ $form = new Form($db); - $now = dol_now(); + +//$help_url="EN:Module_ConferenceOrBoothAttendee|FR:Module_ConferenceOrBoothAttendee_FR|ES:Módulo_ConferenceOrBoothAttendee"; +$help_url = ''; +if ($confOrBooth->id > 0) { + $title = $langs->trans('ListOfAttendeesPerConference'); +} else { + $title = $langs->trans('ListOfAttendeesOfEvent'); +} +$morejs = array(); +$morecss = array(); + $confOrBooth = new ConferenceOrBooth($db); if ($conf_or_booth_id > 0) { $result = $confOrBooth->fetch($conf_or_booth_id); @@ -345,11 +354,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -//$help_url="EN:Module_ConferenceOrBoothAttendee|FR:Module_ConferenceOrBoothAttendee_FR|ES:Módulo_ConferenceOrBoothAttendee"; -$help_url = ''; -$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("ConferenceOrBoothAttendee")); -$morejs = array(); -$morecss = array(); llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); @@ -473,7 +477,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { print '
'; print '
'; - print ''; + print '
'; // Description print '"; } - print '"; print '"; print '"; print '
'.$langs->trans("Description").''; @@ -487,7 +491,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { print "
'; + print '
'; $typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : ''); $htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp"); print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext); @@ -504,15 +508,15 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { print "
'; - print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); + print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); print ''; - print $form->editfieldval('PriceOfRegistration', 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); + print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); print "
'; - print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); + print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); print ''; - print $form->editfieldval('PriceOfBooth', 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); + print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); print "
'.$langs->trans("EventOrganizationICSLink").''; @@ -521,7 +525,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // Show message - $message = 'entity > 1 ? "&entity=".$conf->entity : ""); $message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').''; print $message; @@ -582,10 +586,6 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { $head = conferenceorboothPrepareHead($confOrBooth, $withproject); print dol_get_fiche_head($head, 'attendees', $langs->trans("ConferenceOrBooth"), -1, $object->picto); - - //$help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; - $title = $langs->trans("ConferenceOrBooth") . ' - ' . $langs->trans("Attendees") . ' - ' . $confOrBooth->id; - $object_evt = $object; $object = $confOrBooth; @@ -674,7 +674,7 @@ print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].(!empty($confOrBooth->id)?'?conforboothid='.$confOrBooth->id:'').$withProjectUrl), '', $permissiontoadd); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendConferenceOrBoothAttendeeRef"; @@ -728,7 +728,7 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'ref')) && $val['label'] != 'TechnicalID') { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { @@ -776,7 +776,7 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'ref')) && $val['label'] != 'TechnicalID') { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { @@ -829,12 +829,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } if (in_array($val['type'], array('timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap left'; } elseif ($key == 'ref') { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status'))) { + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'ref', 'status'))) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 0910feef219..659677d5452 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -82,7 +82,8 @@ PriceOfBooth=Subscription price to stand a booth PriceOfBoothHelp=Subscription price to stand a booth EventOrganizationICSLink=Link ICS for events ConferenceOrBoothInformation=Conference Or Booth informations -Attendees = Attendees +Attendees=Attendees +ListOfAttendeesOfEvent=List of attendees of the event project DownloadICSLink = Download ICS link EVENTORGANIZATION_SECUREKEY = Secure Key of the public registration link to a conference SERVICE_BOOTH_LOCATION = Service used for the invoice row about a booth location @@ -107,7 +108,7 @@ EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project ListOfSuggestedConferences = List of suggested conferences ListOfSuggestedBooths = List of suggested booths -ListOfConferencesOrBooths=List of conferences or booths +ListOfConferencesOrBooths=List of conferences or booths of event project SuggestConference = Suggest a new conference SuggestBooth = Suggest a booth ViewAndVote = View and vote for suggested events From b92784c04bacd7767493f354b7d5b3f96e33f4e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Sep 2021 23:38:33 +0200 Subject: [PATCH 066/146] Fix autoselect of thirdparty --- htdocs/core/class/html.formcompany.class.php | 2 ++ htdocs/core/tpl/contacts.tpl.php | 9 +++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index bb99b2a32e9..db7df18e210 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -717,6 +717,8 @@ class FormCompany extends Form print ' onChange="'.$javaScript.'"'; } print '>'; + print ''; + $num = $this->db->num_rows($resql); $i = 0; if ($num) { diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 00a38fde351..1257d473ced 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -89,7 +89,7 @@ if ($permission) { ?>
-
trans("ThirdParty"); ?>
+
trans("ThirdParty"); ?>
trans("Users"), 'user', 'class="optiongrey paddingright"').$langs->trans("Users").' | '.img_picto($langs->trans("Contacts"), 'contact', 'class="optiongrey paddingright"').$langs->trans("Contacts"); ?>
trans("ContactType"); ?>
 
@@ -140,11 +140,8 @@ if ($permission) { } ?>
- socid) ? 0 : $object->socid); - // add company icon before select list - if ($selectedCompany) { - echo img_object('', 'company', 'class="hideonsmartphone"'); - } + socid) ? 0 : $object->socid); $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
From 880ac076616dd16e265568429d81b6053d114a86 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Sep 2021 01:41:59 +0200 Subject: [PATCH 067/146] Debug organizedeventregistration module --- .../class/conferenceorbooth.class.php | 2 +- .../class/conferenceorboothattendee.class.php | 2 +- .../conferenceorbooth_list.php | 8 +- .../conferenceorboothattendee_card.php | 2 +- .../conferenceorboothattendee_list.php | 7 +- htdocs/langs/en_US/eventorganization.lang | 2 + .../attendee_subscription.php | 145 +++++++++++------- htdocs/public/payment/newpayment.php | 22 ++- htdocs/public/payment/paymentok.php | 132 ++++++++-------- 9 files changed, 192 insertions(+), 130 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 49b7112ac5b..9e07fd446d5 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -246,7 +246,7 @@ class ConferenceOrBooth extends ActionComm $result = parent::fetch($id, $ref, $ref_ext, $email_msgid); - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.urlencode($id).'&type=conf'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.urlencode($id).'&type=conf'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 61d8e7c32b2..3e402877b4d 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -404,7 +404,7 @@ class ConferenceOrBoothAttendee extends CommonObject $sql = 'SELECT '; $sql .= $this->getFieldList('t'); $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id = t.fk_actioncomm"; if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { $sql .= ' WHERE t.entity IN ('.getEntity($this->table_element).')'; } else { diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 89a8e1c77ef..0a01a3f5996 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -147,9 +147,11 @@ if ($user->socid > 0) { // Protection if external user $result = restrictedArea($user, 'eventorganization'); if (!$permissiontoread) accessforbidden(); + /* * Actions */ + if (preg_match('/^set/', $action) && $projectid > 0) { $project = new Project($db); //If "set" fields keys is in projects fields @@ -429,7 +431,7 @@ if ($projectid > 0) { //print ''; print '
'; $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$project->id; - $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 2); + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5'); $linksuggest .= '&securekey='.urlencode($encodedsecurekey); //print ''; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$project->id.'&type=global'; - $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 2); + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.$project->id.'&type=global'; + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print ''; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$projectstatic->id.'&type=global'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.$projectstatic->id.'&type=global'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print '
'; @@ -554,7 +557,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { print $langs->trans("PublicAttendeeSubscriptionGlobalPage"); //print ''; print '
'; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$projectstatic->id.'&type=global'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.$projectstatic->id.'&type=global'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print '
'.$langs->trans("Designation"); - print ''.$text; + print ''.$text.''; print ''; print ''; print '
".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label."'.($mt >= 0 ? price($mt) : '')."'.($mt >= 0 ? price($mt) : '')."'.($mt < 0 ? price(-$mt) : '')."
'.$langs->trans("DiscountQtyMin").' %'; + print ' %'; print '
'.$obj->name.''.dol_escape_htmltag($obj->name).''; if (isASecretKey($obj->name)) { if (empty($dolibarr_main_prod)) { From de97b248f2ddff50ddce7da7b0af8deaa3ad5466 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 05:11:56 +0200 Subject: [PATCH 086/146] Update dolibarr.php --- htdocs/admin/system/dolibarr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index ace35668e5f..90e35c8e970 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -505,7 +505,7 @@ if ($resql) { $obj = $db->fetch_object($resql); print '
'.dol_escape_htmltag($obj->name).''.dol_escape_htmltag($obj->name).''; if (isASecretKey($obj->name)) { if (empty($dolibarr_main_prod)) { From 303b0e7f311370dc47e58d07c41a85380428c0ce Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 9 Sep 2021 09:21:30 +0200 Subject: [PATCH 087/146] FIX better sql request --- 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 05710ec2f88..81a408d6212 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3302,7 +3302,7 @@ class User extends CommonObject $this->nb = array(); - $sql = "SELECT DISTINCT count(u.rowid) as nb"; + $sql = "SELECT COUNT(DISTINCT u.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; From d451703bbf5b0769ff0ec92857a3c3fcd438fee0 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 9 Sep 2021 11:21:34 +0200 Subject: [PATCH 088/146] Fix : reception list sql error --- htdocs/reception/list.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index e4b519517ea..5b4bdf6bb6f 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -85,7 +85,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -$search_array_options = (array) $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( @@ -537,21 +537,7 @@ if ($sall) { } // Add where from extra fields -foreach ($search_array_options as $key => $val) { - $crit = $val; - $tmpkey = preg_replace('/search_options_/', '', $key); - $typ = $extrafields->attributes[$object->table_element]['type'][$tmpkey]; - $mode = 0; - if (in_array($typ, array('int', 'double', 'real'))) { - $mode = 1; // Search on a numeric - } - if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') { - $mode = 2; // Search on a foreign key int - } - if ($crit != '' && (!in_array($typ, array('select', 'sellist')) || $crit != '0')) { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); - } -} +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook From 022f3e640d764e37b2f0533f1e099956d1df6652 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 9 Sep 2021 13:28:30 +0200 Subject: [PATCH 089/146] Fix #18660 : fix rights of supplier order with API --- htdocs/fourn/class/api_supplier_orders.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index d4eedcd0fd9..b02de6629e9 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -224,7 +224,7 @@ class SupplierOrders extends DolibarrApi */ public function post($request_data = null) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { throw new RestException(401, "Insuffisant rights"); } // Check mandatory fields @@ -260,7 +260,7 @@ class SupplierOrders extends DolibarrApi */ public function put($id, $request_data = null) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { throw new RestException(401); } @@ -340,7 +340,7 @@ class SupplierOrders extends DolibarrApi */ public function validate($id, $idwarehouse = 0, $notrigger = 0) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { throw new RestException(401); } $result = $this->order->fetch($id); From 8af6b8679ef08595e49e53740bff7ce2e5e88992 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 9 Sep 2021 14:40:39 +0200 Subject: [PATCH 090/146] update with fournisseur && supplier_order --- htdocs/fourn/class/api_supplier_orders.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index b02de6629e9..2549423a73f 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -224,7 +224,7 @@ class SupplierOrders extends DolibarrApi */ public function post($request_data = null) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer && !DolibarrApiAccess::$user->rights->supplier_order->creer) { throw new RestException(401, "Insuffisant rights"); } // Check mandatory fields @@ -260,7 +260,7 @@ class SupplierOrders extends DolibarrApi */ public function put($id, $request_data = null) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer && !DolibarrApiAccess::$user->rights->supplier_order->creer) { throw new RestException(401); } @@ -340,7 +340,7 @@ class SupplierOrders extends DolibarrApi */ public function validate($id, $idwarehouse = 0, $notrigger = 0) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer && !DolibarrApiAccess::$user->rights->supplier_order->creer) { throw new RestException(401); } $result = $this->order->fetch($id); From ad0c4c518fba33b4b672f87fc0b76ac8a779cdc5 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Mon, 6 Sep 2021 15:19:35 +0200 Subject: [PATCH 091/146] Update row.php right write doesn't exist for supplier_proposal ->line order dont works --- htdocs/core/ajax/row.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index c55d80ee521..7b271fafdf2 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -89,7 +89,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3) $perm = 1; } elseif ($table_element_line == 'mrp_production' && $user->rights->mrp->write) { $perm = 1; - } elseif ($table_element_line == 'supplier_proposaldet' && $user->rights->supplier_proposal->write) { + } elseif ($table_element_line == 'supplier_proposaldet' && $user->rights->supplier_proposal->creer) { $perm = 1; } elseif ($table_element_line == 'commande_fournisseurdet' && $user->rights->fournisseur->commande->creer) { $perm = 1; From 4928d03c4f5fa7622b305875bab941da033913f3 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 9 Sep 2021 14:44:17 +0200 Subject: [PATCH 092/146] update to have modify ! to empty() --- htdocs/fourn/class/api_supplier_orders.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index 2549423a73f..f221035a2ab 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -224,7 +224,7 @@ class SupplierOrders extends DolibarrApi */ public function post($request_data = null) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer && !DolibarrApiAccess::$user->rights->supplier_order->creer) { + if (empty(DolibarrApiAccess::$user->rights->fournisseur->commande->creer) && empty(DolibarrApiAccess::$user->rights->supplier_order->creer)) { throw new RestException(401, "Insuffisant rights"); } // Check mandatory fields @@ -260,7 +260,7 @@ class SupplierOrders extends DolibarrApi */ public function put($id, $request_data = null) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer && !DolibarrApiAccess::$user->rights->supplier_order->creer) { + if (empty(DolibarrApiAccess::$user->rights->fournisseur->commande->creer) && empty(DolibarrApiAccess::$user->rights->supplier_order->creer)) { throw new RestException(401); } @@ -340,7 +340,7 @@ class SupplierOrders extends DolibarrApi */ public function validate($id, $idwarehouse = 0, $notrigger = 0) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer && !DolibarrApiAccess::$user->rights->supplier_order->creer) { + if (empty(DolibarrApiAccess::$user->rights->fournisseur->commande->creer) && empty(DolibarrApiAccess::$user->rights->supplier_order->creer)) { throw new RestException(401); } $result = $this->order->fetch($id); From 654bf4d672c1dfecc643dd656eb7b4a3deb2e0f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 15:07:55 +0200 Subject: [PATCH 093/146] Fix name of index #18623 --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index c95aaeffae6..89d0d2d0ce1 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -12,8 +12,8 @@ -- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); -- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; -- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field); --- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table --- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex +-- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table; +-- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex; -- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; -- To make pk to be auto increment (postgres): -- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid; @@ -351,6 +351,10 @@ ALTER TABLE llx_salary ALTER COLUMN paye set default 0; UPDATE llx_extrafields SET elementtype = 'salary' WHERE elementtype = 'payment_salary'; ALTER TABLE llx_payment_salary_extrafields RENAME TO llx_salary_extrafields; +-- VMYSQL4.1 DROP INDEX idx_payment_salary_extrafields on llx_salary_extrafields; +-- VPGSQL8.2 DROP INDEX idx_payment_salary_extrafields; +ALTER TABLE llx_salary_extrafields ADD INDEX idx_salary_extrafields (fk_object); + DELETE FROM llx_boxes WHERE box_id IN (SELECT rowid FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php')); DELETE FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php'); From 5406e3d34ecbfccde3ca16d837e7f0ce5938f850 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 16:06:16 +0200 Subject: [PATCH 094/146] Fix phpcs --- htdocs/comm/action/peruser.php | 24 ++++++++++++------------ htdocs/user/class/user.class.php | 10 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 52736f9ca36..14d052d0257 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -892,20 +892,20 @@ while ($currentdaytoshow < $lastdaytoshow) { } } else { /* Use this list to have for all users */ - $sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity"; - $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql .= " WHERE ug.entity IN (".getEntity('usergroup').")"; - $sql .= " AND ug.fk_user = u.rowid "; - } else { - if ($usergroup > 0) { + $sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity"; + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; + if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql .= " WHERE ug.entity IN (".getEntity('usergroup').")"; + $sql .= " AND ug.fk_user = u.rowid "; + } else { + if ($usergroup > 0) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user"; } - $sql .= " WHERE u.entity IN (".getEntity('user').")"; - } - $sql .= " AND u.statut = 1"; - if ($usergroup > 0) { + $sql .= " WHERE u.entity IN (".getEntity('user').")"; + } + $sql .= " AND u.statut = 1"; + if ($usergroup > 0) { $sql .= " AND ug.fk_usergroup = ".((int) $usergroup); } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index c2e10f74770..0a352210d41 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3350,18 +3350,18 @@ class User extends CommonObject public function load_state_board() { // phpcs:enable - global $conf; + global $conf; $this->nb = array(); $sql = "SELECT COUNT(DISTINCT u.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql .= " WHERE ug.entity IN (".getEntity('usergroup').")"; - $sql .= " AND ug.fk_user = u.rowid "; + $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql .= " WHERE ug.entity IN (".getEntity('usergroup').")"; + $sql .= " AND ug.fk_user = u.rowid"; } else { - $sql .= " WHERE u.entity IN (".getEntity('user').")"; + $sql .= " WHERE u.entity IN (".getEntity('user').")"; } $sql .= " AND u.statut > 0"; //$sql.= " AND employee != 0"; From 45ad23206a8ce2bcfa5e3eb715b142325e73911f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 9 Sep 2021 17:41:40 +0200 Subject: [PATCH 095/146] fix: do not display icon to edit/delete tags if not perms --- htdocs/categories/index.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 065b4dfa83e..708fb3a3e83 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -205,10 +205,14 @@ foreach ($fulltree as $key => $val) { $entry .= ''.img_view().''; $entry .= ''; - $entry .= ''.img_edit().''; + if ($user->rights->categorie->creer) { + $entry .= '' . img_edit() . ''; + } $entry .= ''; - $entry .= ''.img_delete().''; + if ($user->rights->categorie->supprimer) { + $entry .= '' . img_delete() . ''; + } $entry .= '
'.$langs->trans("Subscription").''; if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { - print ''; + print ''; } else { - print ''; - print ''; + print ''; + print ''; } print ' '.$langs->trans("Currency".$conf->currency); print '
'; -print ''; -print ''; +print ''; +print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; if ($j > 12) { @@ -314,7 +314,7 @@ if ($resql) { while ($row = $db->fetch_row($resql)) { print '
'.$langs->trans("Account").''.$langs->trans("Label").'
'.$langs->trans("Account").''.$langs->trans("Label").'
'; if ($row[0] == 'tobind') { - print $langs->trans("Unknown"); + print ''.$langs->trans("Unknown").''; } else { print length_accountg($row[0]); } @@ -349,8 +349,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', print '
'; print ''; -print ''; -print ''; +print ''; +print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; if ($j > 12) { @@ -436,7 +436,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange print '
'; print '
'.$langs->trans("Account").''.$langs->trans("Label").'
'.$langs->trans("Account").''.$langs->trans("Label").'
'; - print ''; + print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; if ($j > 12) { @@ -497,7 +497,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange print "
\n"; print '
'; print '
'.$langs->trans("TotalVente").'
'.$langs->trans("TotalVente").'
'; - print ''; + print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; if ($j > 12) { diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index f047ddf70de..585121f7c36 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -265,8 +265,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', print '
'; print '
'.$langs->trans("TotalMarge").'
'.$langs->trans("TotalMarge").'
'; -print ''; -print ''; +print ''; +print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; if ($j > 12) { @@ -309,7 +309,7 @@ if ($resql) { while ($row = $db->fetch_row($resql)) { print '
'.$langs->trans("Account").''.$langs->trans("Label").'
'.$langs->trans("Account").''.$langs->trans("Label").'
'; if ($row[0] == 'tobind') { - print $langs->trans("Unknown"); + print ''.$langs->trans("Unknown").''; } else { print length_accountg($row[0]); } @@ -344,8 +344,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', print '
'; print ''; -print ''; -print ''; +print ''; +print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; if ($j > 12) { @@ -425,7 +425,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange print '
'; print '
'.$langs->trans("Account").''.$langs->trans("Label").'
'.$langs->trans("Account").''.$langs->trans("Label").'
'; - print ''; + print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; if ($j > 12) { diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 4fd16df2afe..90e44617b05 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -620,10 +620,12 @@ if ($result) { } // Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding) - if (!empty($objp->company_code_buy)) { - $objp->code_buy_t = $objp->company_code_buy; - $objp->aarowid_suggest = $objp->aarowid_thirdparty; - $suggestedaccountingaccountfor = ''; + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + if (!empty($objp->company_code_buy)) { + $objp->code_buy_t = $objp->company_code_buy; + $objp->aarowid_suggest = $objp->aarowid_thirdparty; + $suggestedaccountingaccountfor = ''; + } } if (!empty($objp->code_buy_p)) { @@ -724,11 +726,13 @@ if ($result) { $s .= $langs->trans("NotDefined"); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); } - print '
'; - $s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': '; - $shelp = ''; - $s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : ''.$langs->trans("NotDefined").''); - print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + print '
'; + $s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': '; + $shelp = ''; + $s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : ''.$langs->trans("NotDefined").''); + print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); + } print ''; // Suggested accounting account From fe92c2605d4f0c455dd854377051ba3a13e87abe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 17:45:27 +0200 Subject: [PATCH 107/146] Fix look and feel v14 --- htdocs/accountancy/expensereport/index.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index f06dd5f8d6f..0e3bda39521 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -154,8 +154,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', print '
'; print '
'.$langs->trans("Total").'
'.$langs->trans("Total").'
'; -print ''; -print ''; +print ''; +print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; if ($j > 12) { @@ -197,7 +197,7 @@ if ($resql) { while ($row = $db->fetch_row($resql)) { print '
'.$langs->trans("Account").''.$langs->trans("Label").'
'.$langs->trans("Account").''.$langs->trans("Label").'
'; if ($row[0] == 'tobind') { - print $langs->trans("Unknown"); + print ''.$langs->trans("Unknown").''; } else { print length_accountg($row[0]); } @@ -233,8 +233,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', print '
'; print ''; -print ''; -print ''; +print ''; +print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; if ($j > 12) { @@ -276,7 +276,7 @@ if ($resql) { while ($row = $db->fetch_row($resql)) { print '
'.$langs->trans("Account").''.$langs->trans("Label").'
'.$langs->trans("Account").''.$langs->trans("Label").'
'; if ($row[0] == 'tobind') { - print $langs->trans("Unknown"); + print ''.$langs->trans("Unknown").''; } else { print length_accountg($row[0]); } @@ -314,7 +314,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange print '
'; print ''; - print ''; + print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1; if ($j > 12) { From 2f4463c983f667e206eef6f42f5ace7fc4127117 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 20:49:22 +0200 Subject: [PATCH 108/146] FIX Collapsing of extrafields has disappeared. --- htdocs/core/class/extrafields.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 161b0fb92bb..5c9401fca35 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1976,7 +1976,7 @@ class ExtraFields */ public function showSeparator($key, $object, $colspan = 2, $display_type = 'card') { - global $langs; + global $conf, $langs; if ($display_type=='card') { $tagtype='tr'; @@ -1989,6 +1989,7 @@ class ExtraFields $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'">'; $out .= '<'.$tagtype_dyn.' '.(!empty($colspan)?'colspan="' . $colspan . '"':'').'>'; + // Some js code will be injected here to manage the collapsing of extrafields $out .=''; $out .= $langs->trans($this->attributes[$object->table_element]['label'][$key]); $out .= ''; @@ -2011,15 +2012,17 @@ class ExtraFields $out .= ''; print ''."\n"; } + if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount From 29d9771b800c95bda46cf245540598a33835cc9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Sep 2021 19:39:22 +0200 Subject: [PATCH 134/146] Code comment --- htdocs/public/members/new.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 1e2f7aaa63d..b6498ca4032 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -605,7 +605,9 @@ print ''."\n"; // EMail -print ''."\n"; +print ''."\n"; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''."\n"; From eab4014f2086cf3e921388eaa6352d357b3f1103 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Sep 2021 19:42:07 +0200 Subject: [PATCH 135/146] Rename url --- htdocs/eventorganization/class/conferenceorbooth.class.php | 2 +- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_card.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- .../{attendee_registration.php => attendee_register.php} | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename htdocs/public/eventorganization/{attendee_registration.php => attendee_register.php} (99%) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index a8b1dddda3a..ea2bf2eb87f 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -246,7 +246,7 @@ class ConferenceOrBooth extends ActionComm $result = parent::fetch($id, $ref, $ref_ext, $email_msgid); - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.urlencode($id).'&type=conf'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.urlencode($id).'&type=conf'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index a09d7aff6de..c46798b05b5 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -447,7 +447,7 @@ if ($projectid > 0) { print $langs->trans("PublicAttendeeSubscriptionGlobalPage"); //print ''; print '
'.$langs->trans("Total").'
'.$langs->trans("Total").'
'.$langs->trans("Lastname").' * // Firstname print '
'.$langs->trans("Firstname").' *
'.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').'
'.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; +//print img_picto('', 'email', 'class="pictofixedwidth"'); +print '
'.$langs->trans("Login").' *
'; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.$project->id.'&type=global'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$project->id.'&type=global'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print ''; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.$projectstatic->id.'&type=global'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$projectstatic->id.'&type=global'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print ''; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.$projectstatic->id.'&type=global'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$projectstatic->id.'&type=global'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print '