From a00045b94c28f2e4810a9558150415400f5640d4 Mon Sep 17 00:00:00 2001 From: antonin_tdj <50403308+ibuiv@users.noreply.github.com> Date: Wed, 2 Aug 2023 19:16:47 +0200 Subject: [PATCH 1/8] Check was after submit (#25551) Check was added in the wrong place. I moved it a few lines before. --- .../interface_50_modLdap_Ldapsynchro.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index 37d5274bcb4..42305524de2 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -343,12 +343,12 @@ class InterfaceLdapsynchro extends DolibarrTriggers $info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS'); } - $result = $ldap->add($dn, $info, $user); - } + // Avoid Ldap error due to empty member + if (isset($info['member']) && empty($info['member'])) { + unset($info['member']); + } - // Avoid Ldap error due to empty member - if (isset($info['member']) && empty($info['member'])) { - unset($info['member']); + $result = $ldap->add($dn, $info, $user); } if ($ldap->serverType == "activedirectory") { From f44c74d310c472978b55827272222ba2766cfc4e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 2 Aug 2023 19:17:05 +0200 Subject: [PATCH 2/8] Update commonobject.class.php (#25560) --- htdocs/core/class/commonobject.class.php | 114 ++++++++++++----------- 1 file changed, 61 insertions(+), 53 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2ee3fd3aa48..7858b406fda 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -57,12 +57,12 @@ abstract class CommonObject public $db; /** - * @var int The object identifier + * @var int The object identifier */ public $id; /** - * @var int The environment ID when using a multicompany module + * @var int The environment ID when using a multicompany module */ public $entity; @@ -83,38 +83,38 @@ abstract class CommonObject public $errors = array(); /** - * @var array To store error results of ->validateField() + * @var array To store error results of ->validateField() */ private $validateFieldsErrors = array(); /** - * @var string ID to identify managed object + * @var string ID to identify managed object */ public $element; /** - * @var int The related element + * @var int The related element */ public $fk_element; /** - * @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea(). - * Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element. + * @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea(). + * Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element. */ public $element_for_permission; /** - * @var string Name of table without prefix where object is stored + * @var string Name of table without prefix where object is stored */ public $table_element; /** - * @var string Name of subtable line + * @var string Name of subtable line */ public $table_element_line = ''; /** - * @var int 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table + * @var int 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table */ public $ismultientitymanaged; @@ -129,7 +129,7 @@ abstract class CommonObject public $array_options = array(); /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); @@ -174,7 +174,7 @@ abstract class CommonObject protected $table_ref_field = ''; /** - * @var integer 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user + * @var integer 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user */ public $restrictiononfksoc = 0; @@ -204,7 +204,7 @@ abstract class CommonObject public $fk_project; /** - * @var Project The related project object + * @var Project The related project object * @deprecated * @see project */ @@ -235,56 +235,57 @@ abstract class CommonObject public $thirdparty; /** - * @var User A related user + * @var User A related user * @see fetch_user() */ public $user; /** - * @var string The type of originating object ('commande', 'facture', ...). Note: on some object this field is called $origin_type + * @var string The type of originating object ('commande', 'facture', ...). Note: on some object this field is called $origin_type * @see fetch_origin() */ public $origin; /** - * @var int The id of originating object + * @var int The id of originating object * @see fetch_origin() */ public $origin_id; /** - * @var string The object's reference + * @var string The object's reference */ public $ref; /** - * @var string An external reference for the object + * @var string An external reference for the object */ public $ref_ext; /** - * @var string The object's previous reference + * @var string The object's previous reference */ public $ref_previous; /** - * @var string The object's next reference + * @var string The object's next reference */ public $ref_next; /** - * @var string Ref to store on object to save the new ref to use for example when making a validate() of an object + * @var string Ref to store on object to save the new ref to use for example when making a validate() of an object */ public $newref; /** - * @var int The object's status. Prefer use of status. + * @var int The object's status. Prefer use of status. + * @deprecated * @see setStatut() */ public $statut; /** - * @var int The object's status + * @var int The object's status * @see setStatut() */ public $status; @@ -370,50 +371,50 @@ abstract class CommonObject public $barcode_type_coder; /** - * @var int Payment method ID (cheque, cash, ...) + * @var int Payment method ID (cheque, cash, ...) * @see setPaymentMethods() */ public $mode_reglement_id; /** - * @var int Payment terms ID + * @var int Payment terms ID * @see setPaymentTerms() */ public $cond_reglement_id; /** - * @var int Demand reason ID + * @var int Demand reason ID */ public $demand_reason_id; /** - * @var int Transport mode ID (For module intracomm report) + * @var int Transport mode ID (For module intracomm report) * @see setTransportMode() */ public $transport_mode_id; /** - * @var int Payment terms ID + * @var int Payment terms ID * @deprecated Kept for compatibility * @see cond_reglement_id; */ public $cond_reglement; /** - * @var int Delivery address ID + * @var int Delivery address ID * @see setDeliveryAddress() * @deprecated */ public $fk_delivery_address; /** - * @var int Shipping method ID + * @var int Shipping method ID * @see setShippingMethod() */ public $shipping_method_id; /** - * @var string Shipping method label + * @var string Shipping method label * @see setShippingMethod() */ public $shipping_method; @@ -448,31 +449,31 @@ abstract class CommonObject public $last_main_doc; /** - * @var int Bank account ID sometimes, ID of record into llx_bank sometimes + * @var int Bank account ID sometimes, ID of record into llx_bank sometimes * @deprecated * @see $fk_account */ public $fk_bank; /** - * @var int Bank account ID + * @var int Bank account ID * @see SetBankAccount() */ public $fk_account; /** - * @var string Open ID + * @var string Open ID */ public $openid; /** - * @var string Public note + * @var string Public note * @see update_note() */ public $note_public; /** - * @var string Private note + * @var string Private note * @see update_note() */ public $note_private; @@ -484,31 +485,31 @@ abstract class CommonObject public $note; /** - * @var float Total amount before taxes + * @var float Total amount before taxes * @see update_price() */ public $total_ht; /** - * @var float Total VAT amount + * @var float Total VAT amount * @see update_price() */ public $total_tva; /** - * @var float Total local tax 1 amount + * @var float Total local tax 1 amount * @see update_price() */ public $total_localtax1; /** - * @var float Total local tax 2 amount + * @var float Total local tax 2 amount * @see update_price() */ public $total_localtax2; /** - * @var float Total amount with taxes + * @var float Total amount with taxes * @see update_price() */ public $total_ttc; @@ -525,22 +526,22 @@ abstract class CommonObject public $comments = array(); /** - * @var string The name + * @var string The name */ public $name; /** - * @var string The lastname + * @var string The lastname */ public $lastname; /** - * @var string The firstname + * @var string The firstname */ public $firstname; /** - * @var string The civility code, not an integer + * @var string The civility code, not an integer */ public $civility_id; @@ -559,9 +560,10 @@ abstract class CommonObject * @var integer|string $date_modification; */ public $date_modification; // Date last change (tms field) + /** * @var integer|string $date_modification; - * @deprecated Use date_modification + * @deprecated Use date_modification */ public $date_update; @@ -575,11 +577,13 @@ abstract class CommonObject * @TODO Merge with user_creation */ public $user_author; + /** * @var User|int User author/creation * @TODO Remove type id */ public $user_creation; + /** * @var int User id author/creation */ @@ -590,15 +594,18 @@ abstract class CommonObject * @TODO Merge with user_validation */ public $user_valid; + /** * @var User|int User of validation * @TODO Remove type id */ public $user_validation; + /** * @var int User id of validation */ public $user_validation_id; + /** * @var int User id closing object */ @@ -609,6 +616,7 @@ abstract class CommonObject * @TODO Remove type id */ public $user_modification; + /** * @var int User id last modifier */ @@ -623,26 +631,26 @@ abstract class CommonObject public $specimen = 0; /** - * @var int Id of contact to send object (used by the trigger of module Agenda) + * @var int Id of contact to send object (used by the trigger of module Agenda) */ public $sendtoid; /** - * @var float Amount already paid (used to show correct status) + * @var float Amount already paid (used to show correct status) */ public $alreadypaid; - public $labelStatus; + protected $labelStatusShort; /** - * @var int showphoto_on_popup + * @var int show photo on popup */ public $showphoto_on_popup; /** - * @var array nb used in load_stateboard + * @var array nb used in load_stateboard */ public $nb = array(); @@ -652,12 +660,12 @@ abstract class CommonObject public $output; /** - * @var array extraparams + * @var array extra parameters */ public $extraparams = array(); /** - * @var array List of child tables. To test if we can delete object. + * @var array List of child tables. To test if we can delete object. */ protected $childtables = array(); From 4d5a06a3f37d381ca1f4c94e67941621d5ac79af Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 2 Aug 2023 19:17:14 +0200 Subject: [PATCH 3/8] Update calendar_extrafields.php (#25557) --- htdocs/bookcal/admin/calendar_extrafields.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookcal/admin/calendar_extrafields.php b/htdocs/bookcal/admin/calendar_extrafields.php index 284ad0be1ac..54b7b97407c 100644 --- a/htdocs/bookcal/admin/calendar_extrafields.php +++ b/htdocs/bookcal/admin/calendar_extrafields.php @@ -21,9 +21,9 @@ */ /** - * \file admin/calendar_extrafields.php - * \ingroup bookcal - * \brief Page to setup extra fields of calendar + * \file htdocs/bookcal/admin/calendar_extrafields.php + * \ingroup bookcal + * \brief Page to setup extra fields of calendar */ // Load Dolibarr environment From f0dbc219566f36015c66858bf0a7f5e27f044fb2 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 2 Aug 2023 19:17:30 +0200 Subject: [PATCH 4/8] Update ChangeLog (#25561) is line 22 the sames as line 15 ? --- ChangeLog | 60 +++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index da15649487f..a7845e69220 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,11 +19,11 @@ NEW: Accountancy - Manage intra-community VAT on supplier invoices - FPC22 NEW: Accountancy - iSuiteExpert export model NEW: Accountancy - Quadratus export with attachments in accountancy export NEW: Accountancy - Can filter on a custom group of accounts. Perf or ledger list. +NEW: Accountancy - Can select the export format during export of journals NEW: Can upload a file with drag and drop on purchase invoice, vats, salaries and social contributions NEW: Authentication: #22740 add OpenID Connect impl NEW: Authentication: add experimental support for Google OAuth2 connexion NEW: Authentication: can now edit service name for OAuth token -NEW: Add a public virtual card page for each user NEW: Add a status on supplier price ref (WIP to close a supplier ref) NEW: add bookmarks in selectable landing pages for users NEW: Add column ext_payment_site into societe_rib to allow multiple payment mode @@ -35,39 +35,31 @@ NEW: Add filters and sort on product unit column NEW: Add link to edit VAT list from error message of missing VAT NEW: add margins in paiement/card.php NEW: Add mass action delete on VAT -NEW: Add origin info when create a product batch when created from a movement stock NEW: Add possibility to choose format #21426 -NEW: Add SQL contraint on product_stock table to allow only exsting product and warehouse #23543 -NEW: Add STRIPE_DEBUG, a way to log Stripe IPN NEW: An external module can modify the quick search fields -NEW: Auto activate some modules on install (Export/Import/Wysiwyg editor) -NEW: Autofill email form with the email template with status "Default" on -NEW: Bank name no more mandatory on creation. Can be generated if empty. +NEW: Bank: Bank name no more mandatory on creation. Can be generated if empty. NEW: Bank: Add fields zip, town, country for owner of a bank account NEW: batch referential objets NEW: Can add the add now link on date into addfieldvalue() NEW: Can bin accounting line for a given month -NEW: Can edit account on miscellaneous payment (if not transfered) NEW: Can edit inline the VAT number from supplier tab -NEW: Can fill date of salary payment with date of start of salary NEW: Can go back to draft on shipment when stock change not on validate NEW: Can modify bank account of sepa payment (if file not sent yet) -NEW: Customers: add date due and labels into customer comm card -NEW: Can select the export format during export of journals NEW: Can set a checkbox in formconfirm by clicking on the label -NEW: Can set flag default value on email templates NEW: Can set the page "List of opportunities" as landing page -NEW: Can show the sql request used on emailing selection +NEW: Can show the SQL request used on emailing selection NEW: can stay on edit field when errors occurs NEW: comment in api_mymodule for seperate methods NEW: create email substitution variable for intervention signature URL +NEW: Contacts: presend mass action in contact list +NEW: Contacts: hook printFieldListFrom in contact list +NEW: Customers: add date due and labels into customer comm card NEW: Debug the custom CSS feature to avoid a directory search/scan at NEW: dev name NEW: Disable bad reputation product price -NEW: dolExplodeIntoArray can accept regex -NEW: dol_sort_array can sort on alphabetical order even if val is num -NEW: element time integration code + SQL +NEW: Email: autofill email form with the email template with status "Default" on NEW: Email: don't have closed contact proposed as receiver for the mails +NEW: Email: can set flag default value on email templates NEW: Email-Collector: add field reply-to in email collector as possible filter NEW: Email-Collector: substitute date now in email collector NEW: Email-Collector: operation type in email collector to load or create contact @@ -89,14 +81,15 @@ NEW: GUI: can set background style with MAIN_LOGIN_BACKGROUND_STYLE NEW: Help: Tooltip to explain how to add a photo on a product NEW: Help: Possibility to link to German pages in help NEW: helper functions for dates + small demo case -NEW: hook printFieldListFrom in contact list +NEW: HR - Salary: can fill date of salary payment with date of start of salary NEW: HR - Salary: can modify the date of payment of a salary (if not reconciled) NEW: HR - Salary: date for salary payment includes the hour/min NEW: HR - Salary: adding button Send Email on the salary file NEW: Import: filter on entity in import NEW: Import: map table to element for get entity in import NEW: inc.php: handle parameters from argv -NEW: Invoice - show category of operations +NEW: Installation: Auto activate some modules on install (Export/Import/Wysiwyg editor) +NEW: Invoice: show category of operations NEW: Keep a link between user created from recruitment and application NEW: Mass Actions: Better responsive for mass actions NEW: Members: add numbering modules for members @@ -111,7 +104,8 @@ NEW: No overwrite of optionals during put() contact NEW: Notifications: add Customer Order delivered (ORDER_NEW) in module Notification NEW: Notifications: for Sign or Refused Propal from Online Page NEW: Now we can edit amount on VAT and salaries clone action -NEW: only get openned contact from liste_contact function, to not have acces to closed contact as mail receiver +NEW: only get opened contact from liste_contact function, to not have access to closed contact as mail receiver +NEW: Option: MAIN_SECURITY_MAXFILESIZE_DOWNLOADED #yogosha10660 NEW: Option to manage deposit slips for more payment modes (not only NEW: Option to show column for field and line selection on the left NEW: Orders: add sub total in order list det @@ -120,19 +114,21 @@ NEW: Orders export: allow to export field 'shipment method' NEW: payment default values when supplier order created from reception NEW: Payment: manage contracts NEW: Payment: sepaStripe now creates the payment mode with type pm_ using new API -NEW: presend mass action in contact list +NEW: Payment: add partial payment reason "withholding tax" +NEW: Payment: Can edit account on miscellaneous payment (if not transfered) NEW: Print PDF: category of operation for crabe PDF model NEW: Print PDF: Name and date to print on PDF Sign NEW: Print PDF: Use the more recent PDF templates for documents by default on a fresh install NEW: Print PDF: Option PDF_SHOW_PHONE_AFTER_USER_CONTACT to show phone after specific assigned contact on PDF NEW: Print PDF: Option PDF_SHOW_EMAIL_AFTER_USER_CONTACT to show email after specific assigned contact on PDF NEW: product images on popup are cached +NEW: Products: Add origin info when create a product batch when created from a movement stock NEW: Products: Add statistics by amount on statistics of products. +NEW: Products: Add SQL contraint on product_stock table to allow only exsting product and warehouse #23543 NEW: Proposals: filter for Signed+Billed in proposals NEW: Proposals: can modify margin rates in offers like VAT rates NEW: Proposals: option filter for NoSalesRepresentativeAffected in proposals list NEW: Proposals: constant PROPALE_ADDON_NOTE_PUBLIC_DEFAULT -NEW: Provide the oldcopy value when calling setValueFrom() function with a trigger key NEW: Reception: can receive more than qty ordered on reception NEW: referential objects of batch NEW: remove keys whose table element is the same as element in map list @@ -153,23 +149,24 @@ NEW: Supplier Invoices: add ability of ODT support to supplier invoices NEW: Stock limit for alert and desired optimal stock by product and warehouse import NEW: Stock: Add warehouse create and modify triggers. NEW: Stock: Can select several warehouses into the view stock at date in past +NEW: Stripe: add STRIPE_DEBUG, a way to log Stripe IPN NEW: Support different bank account for several direct debit payments NEW: Support multiselect in the warehouse selection combo box -NEW: Option: MAIN_SECURITY_MAXFILESIZE_DOWNLOADED #yogosha10660 NEW: Survey: Comment on survey is possible only after vote. -NEW: tables: llx_element_time to store time spent on several elements (mo, ticket...) NEW: TakePOS: adapt category and product pictures sizes on TakePOS NEW: TakePOS: limit load products in TakePOS NEW: The batch for remind on due date can be setup for using validation date NEW: The refresh link for IMAP collector is always visible -NEW: The upgrade process can be done by creating a file upgrade.unlock +NEW: Third-Party: use an ajax component to switch prospection status on thirdparty list NEW: Tickets: Send a notification email when ticket assigned NEW: Tickets: set ticket status to answered if the client has answered from the public interface NEW: Tickets: added an option to display the progress of tickets on the public interface NEW: Tickets: add link to thirdparty tickets history NEW: Tickets: notify also the contributor affected to a ticket if a new message public is post (add global TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ALSO_CONTRIBUTOR) +NEW: Upgrades: The upgrade process can be done by creating a file upgrade.unlock NEW: Use a cache file for external RSS in calendar NEW: Use by default the domain $dolibarr_main_url_root for SMTP HELO +NEW: Users: add a public virtual card page for each user NEW: VAT can be modified during add of line NEW: Website Module: Increment website counter on each page access in website module NEW: write all fields and their properties in asciidoc format @@ -177,8 +174,6 @@ NEW: Can add an array of several links in date selector NEW: Widgets: Implement MAIN_ACTIVATE_FILECACHE on birthday widget NEW: Widgets: Add widget "The next upcoming events" NEW: Widgets: Add widget of open opportunities -NEW: use an ajax component to switch prospection status on thirdparty list -NEW: Add partial payment reason "withholding tax" @@ -188,19 +183,24 @@ For developers or integrators: NEW: Make it possible to select hours and minutes in form_confirm NEW: add triggers on mailing NEW: Add a trigger when create a shipping line batch and fix propagate missing errors -NEW: add function for listiong objects from directory +NEW: add function for listing objects from directory NEW: add helplist property to describe fields of objects -NEW: Hooks: printFieldListFrom in contact list -NEW: Hooks: add hook in loadLotStock() in html.formproduct.class.php file, add hook 'llxFooter', Add hook online sign -NEW: Update lib parsedownto 1.7.4, phpspreadsheet lib to v1.12, ESCPOS v3.0, jquery, Stripe. NEW: API: Support contact in post() document API NEW: API: more APIs (update currency rate, upload of supplier documents, ...) +NEW: Hooks: printFieldListFrom in contact list +NEW: Hooks: add hook in loadLotStock() in html.formproduct.class.php file, add hook 'llxFooter', add hook online sign +NEW: Libraries: Update libs parsedownto 1.7.4, phpspreadsheet lib to v1.12, ESCPOS v3.0, jquery, Stripe. NEW: ModuleBuilder: updating in modulbuilder on tab Menu when adding object NEW: ModuleBuilder: add/edit permissions NEW: ModuleBuilder: better generated documentation NEW: add sent info in the parameters provided to the hook sendMailAfter NEW: add setAsSelectUser into factory for generic setup page NEW: add option keepspace into dol_string_nospecialchar() +NEW: dol_sort_array can sort on alphabetical order even if val is num +NEW: dolExplodeIntoArray can accept regex +NEW: element time integration code + SQL +NEW: tables: llx_element_time to store time spent on several elements (mo, ticket...) +NEW: Provide the oldcopy value when calling setValueFrom() function with a trigger key WARNING: From abfdb0a853d4ed2d668c33c28291507dc2345231 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 2 Aug 2023 19:20:37 +0200 Subject: [PATCH 5/8] Update booking_extrafields.php (#25556) delete Buttons part --- htdocs/bookcal/admin/booking_extrafields.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/htdocs/bookcal/admin/booking_extrafields.php b/htdocs/bookcal/admin/booking_extrafields.php index b4029a99338..de09660f63d 100644 --- a/htdocs/bookcal/admin/booking_extrafields.php +++ b/htdocs/bookcal/admin/booking_extrafields.php @@ -21,9 +21,9 @@ */ /** - * \file admin/booking_extrafields.php - * \ingroup bookcal - * \brief Page to setup extra fields of booking + * \file htdocs/bookcal/admin/booking_extrafields.php + * \ingroup bookcal + * \brief Page to setup extra fields of booking */ // Load Dolibarr environment @@ -87,13 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '