From 01abfe538f576bdc6092327ddf21c76d7086d2cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 17:54:20 +0200 Subject: [PATCH 1/8] Doc --- test/phpunit/CodingSqlTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index 582d22d30cc..9a1490caeb2 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -196,7 +196,7 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase $result=(! strpos($filecontent, '["') && ! strpos($filecontent, '{"') && ! strpos($filecontent, '("')); } //print __METHOD__." Result for checking we don't have double quote = ".$result."\n"; - $this->assertTrue($result===false, 'Found double quote that is not [" neither {" (used for json content) into '.$file.'. Bad.'); + $this->assertTrue($result===false, 'Found double quote that is not [" neither {" (used for json content) neither (" (used for content with string like isModEnabled("")) into '.$file.'. Bad.'); $result=strpos($filecontent, 'int('); //print __METHOD__." Result for checking we don't have 'int(' instead of 'integer' = ".$result."\n"; From 69ca6c02d7156e28cfd788219a2fdc9a9a71d169 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 12:14:11 +0200 Subject: [PATCH 2/8] Add debug for ldap --- htdocs/core/class/ldap.class.php | 22 ++++++++++++++++++++-- htdocs/core/login/functions_ldap.php | 6 +++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 83e3adeda93..7b3c6c4ac2c 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -193,12 +193,20 @@ class Ldap { // phpcs:enable global $conf; + global $dolibarr_main_auth_ldap_debug; $connected = 0; $this->bind = 0; $this->error = 0; $this->connectedServer = ''; + $ldapdebug = ((empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false") ? false : true); + + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind"); + print "DEBUG: connect_bind
\n"; + } + // Check parameters if (count($this->server) == 0 || empty($this->server[0])) { $this->error = 'LDAP setup (file conf.php) is not complete'; @@ -223,18 +231,28 @@ class Ldap } if ($this->serverPing($host, $this->serverPort) === true) { + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind serverPing true, we try ldap_connect to ".$host); + } $this->connection = ldap_connect($host, $this->serverPort); } else { if (preg_match('/^ldaps/i', $host)) { // With host = ldaps://server, the serverPing to ssl://server sometimes fails, even if the ldap_connect succeed, so - // we test this case and continue in suche a case even if serverPing fails. + // we test this case and continue in such a case even if serverPing fails. + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind serverPing false, we try ldap_connect to ".$host); + } $this->connection = ldap_connect($host, $this->serverPort); } else { continue; } } - if (is_resource($this->connection) || is_object($this->connection)) { + if (is_resource($this->connection) || is_object($this->connection)) { + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind this->connection is ok", LOG_DEBUG); + } + // Upgrade connexion to TLS, if requested by the configuration if (!empty($conf->global->LDAP_SERVER_USE_TLS)) { // For test/debug diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 3f217573b18..68ad25168f0 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -77,7 +77,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) $ldapdn = $dolibarr_main_auth_ldap_dn; $ldapadminlogin = $dolibarr_main_auth_ldap_admin_login; $ldapadminpass = $dolibarr_main_auth_ldap_admin_pass; - $ldapdebug = (empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false" ? false : true); + $ldapdebug = ((empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false") ? false : true); if ($ldapdebug) { print "DEBUG: Logging LDAP steps
\n"; @@ -94,9 +94,9 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) if ($ldapdebug) { dol_syslog("functions_ldap::check_user_password_ldap Server:".join(',', $ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType); - dol_syslog("functions_ldap::check_user_password_ldap uid/samacountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword); + dol_syslog("functions_ldap::check_user_password_ldap uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".dol_trunc($ldap->searchPassword, 3)); print "DEBUG: Server:".join(',', $ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType."
\n"; - print "DEBUG: uid/samacountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword."
\n"; + print "DEBUG: uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".dol_trunc($ldap->searchPassword, 3)."
\n"; } $resultFetchLdapUser = 0; From d2ec1285951c23b31bdca882c2f984208bd403ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 18:14:00 +0200 Subject: [PATCH 3/8] Fix field fk_user_create of event registration must be null --- htdocs/install/mysql/migration/15.0.0-16.0.0.sql | 3 +++ htdocs/langs/en_US/eventorganization.lang | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 517930eb490..7c38fb59b6d 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -698,6 +698,9 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstnam ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email; +-- VMYSQL4.3 ALTER TABLE llx_eventorganization_conferenceorboothattendee MODIFY COLUMN fk_user_creat integer NULL; +-- VPGSQL8.2 ALTER TABLE llx_eventorganization_conferenceorboothattendee ALTER COLUMN fk_user_creat DROP NOT NULL; + ALTER TABLE llx_c_email_templates ADD COLUMN joinfiles text; ALTER TABLE llx_c_email_templates ADD COLUMN email_from varchar(255); diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index b4179b04be6..23f063e9a50 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -157,7 +157,7 @@ VoteOk = Your vote has been accepted. AlreadyVoted = You have already voted for this event. VoteError = An error has occurred during the vote, please try again. -SubscriptionOk = Your registration has been validated +SubscriptionOk=Your registration has been recorded ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to an event Attendee = Attendee PaymentConferenceAttendee = Conference attendee payment From 2db3f6f70932add5b303b7ddd2dda90eeae28afd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 18:23:41 +0200 Subject: [PATCH 4/8] Fix price style --- htdocs/product/price.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index b129a1ff4e5..5dcb08dc238 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -2240,7 +2240,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } print ''; - print ''; + print ''; print ' '; // Print the search button print ''; @@ -2252,7 +2252,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ''.$langs->trans("ThirdParty").''; - print '' . $langs->trans('RefCustomer') . ''; + print ''.$langs->trans('RefCustomer').''; print ''.$langs->trans("AppliedPricesFrom").''; print ''.$langs->trans("PriceBase").''; print ''.$langs->trans("DefaultTaxRate").''; @@ -2289,6 +2289,8 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print '' . $langs->trans('Default') . ''; print ''.$langs->trans($object->price_base_type).""; + + // VAT Rate print ''; $positiverates = ''; @@ -2310,12 +2312,12 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { //print $object->default_vat_code?' ('.$object->default_vat_code.')':''; print ""; - print ''.price($object->price).""; + print ''.price($object->price).""; - print ''.price($object->price_ttc).""; + print ''.price($object->price_ttc).""; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") { //print '' . price($object->price_ttc) . ""; - print ''.price($resultarray[2]).''; + print ''.price($resultarray[2]).''; } print ''.price($object->price_min).''; @@ -2367,6 +2369,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''.dol_escape_htmltag($line->ref_customer).''; print "".dol_print_date($line->datec, "dayhour", 'tzuserrel').""; print ''.$langs->trans($line->price_base_type).""; + // VAT Rate print ''; $positiverates = ''; @@ -2386,12 +2389,13 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { echo vatrate($positiverates.($line->default_vat_code ? ' ('.$line->default_vat_code.')' : ''), '%', ($line->tva_npr ? $line->tva_npr : $line->recuperableonly)); print ""; + print ''.price($line->price).""; print ''.price($line->price_ttc).""; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") { //print '' . price($line->price_ttc) . ""; - print ''.price($resultarray[2]).''; + print ''.price($resultarray[2]).''; } print ''.price($line->price_min).''; From 3e38d30956e1d65228741056a62491dcb5afe32a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 18:41:23 +0200 Subject: [PATCH 5/8] Fix price must be including tax --- htdocs/public/eventorganization/attendee_new.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 8bb85022b2e..161f56dc6f8 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -474,7 +474,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION); } - // Create invoice + // Create the draft invoice for the payment if ($resultprod < 0) { $error++; $errmsg .= $productforinvoicerow->error; @@ -528,7 +528,11 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // If there is no lines yet, we add one if (empty($facture->lines)) { - $result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1); + $pu_ttc = floatval($project->price_registration); + $pu_ht = 0; + $price_base_type = 'TTC'; + + $result = $facture->addline($labelforproduct, $pu_ht, 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', $price_base_type, $pu_ttc, 1); if ($result <= 0) { $confattendee->error = $facture->error; $confattendee->errors = $facture->errors; From 2d378ecede8d96ed279d1d11cb7681a8aace5c52 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 19:16:25 +0200 Subject: [PATCH 6/8] CSS --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/eventorganization/attendee_new.php | 14 ++++++++------ htdocs/theme/eldy/global.inc.php | 4 ++++ htdocs/theme/md/style.css.php | 4 ++++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 23f063e9a50..e9d434651b2 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -165,6 +165,7 @@ PaymentBoothLocation = Booth location payment DeleteConferenceOrBoothAttendee=Remove attendee RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email %s EmailAttendee=Attendee email +EmailCompany=Company email EmailCompanyForInvoice=Company email (for invoice, if different of attendee email) ErrorSeveralCompaniesWithEmailContactUs=Several companies with this email has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation ErrorSeveralCompaniesWithNameContactUs=Several companies with this name has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 161f56dc6f8..af49d142f51 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -652,21 +652,23 @@ print '
'; print $langs->trans("EvntOrgWelcomeMessage", $project->title . ' '. $conference->label); print '
'; $maxattendees = 0; -if ($conference->id) { +if ($conference->id > 0) { + /* date of project is not date of event so commented print $langs->trans("Date").': '; print dol_print_date($conference->datep); if ($conference->date_end) { print ' - '; print dol_print_date($conference->datef); - } + }*/ } else { + /* date of project is not date of event so commented print $langs->trans("Date").': '; print dol_print_date($project->date_start); if ($project->date_end) { print ' - '; print dol_print_date($project->date_end); - } - $maxattendees = $project->max_attendees; + }*/ + $maxattendees = $project->max_attendees; // Max attendeed for the project/event } print '
'; @@ -729,7 +731,7 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS // Email company for invoice if ($project->price_registration) { - print '' . $langs->trans("EmailCompanyForInvoice") . ''; + print '' . $form->textwithpicto($langs->trans("EmailCompany"), $langs->trans("EmailCompanyForInvoice")) . ''; print img_picto('', 'email', 'class="pictofixedwidth"'); print '' . "\n"; } @@ -780,7 +782,7 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS if ($project->price_registration) { print '' . $langs->trans('Price') . ''; - print price($project->price_registration, 1, $langs, 1, -1, -1, $conf->currency); + print ''.price($project->price_registration, 1, $langs, 1, -1, -1, $conf->currency).''; print ''; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index f0208223cf4..c68b39d38df 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4835,8 +4835,12 @@ input#cardholder-name { } .divmainbodylarge { margin-left: 40px; margin-right: 40px; } +.publicnewmemberform div.titre { font-size: 2em; } #divsubscribe { max-width: 900px; } #tablesubscribe { width: 100%; } +#tablesubscribe tr td { font-size: 1.15em; } +#tablesubscribe .price-registration { font-size: 1.5em; } + div#card-element { border: 1px solid #ccc; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3357a2f8c7a..dd1194972b5 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4684,8 +4684,12 @@ span.buttonpaymentsmall { #tablepublicpayment tr.liste_total td { border-top: none; } .divmainbodylarge { margin-left: 40px; margin-right: 40px; } +.publicnewmemberform div.titre { font-size: 2em; } #divsubscribe { max-width: 900px; } #tablesubscribe { width: 100%; } +#tablesubscribe tr td { font-size: 1.15em; } +#tablesubscribe .price-registration { font-size: 1.5em; } + div#card-element { border: 1px solid #ccc; From 84d47e9b0ca3b175644641250cdbc77b77ceee24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 19:26:24 +0200 Subject: [PATCH 7/8] Fix max nb of attendees reached --- htdocs/langs/en_US/eventorganization.lang | 4 ++-- htdocs/public/eventorganization/attendee_new.php | 6 ++++-- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index e9d434651b2..f9531260c97 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -122,7 +122,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 event : %s +EvntOrgWelcomeMessage = This form allows you to register as a new participant to the event 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 @@ -132,7 +132,7 @@ LabelOfconference=Conference label ConferenceIsNotConfirmed=Registration not available, conference is not confirmed yet DateMustBeBeforeThan=%s must be before %s DateMustBeAfterThan=%s must be after %s - +MaxNbOfAttendeesReached=The maximum number of participants has been reached NewSubscription=Registration OrganizationEventConfRequestWasReceived=Your suggestion for a conference has been received OrganizationEventBoothRequestWasReceived=Your request for a booth has been received diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index af49d142f51..371d69710b7 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -645,11 +645,13 @@ print load_fiche_titre($langs->trans("NewRegistration"), '', '', 0, 0, 'center') print '
'; print '
'; -print '
'; +print '
'; // Welcome message -print $langs->trans("EvntOrgWelcomeMessage", $project->title . ' '. $conference->label); +print $langs->trans("EvntOrgWelcomeMessage"); +print '
'; +print ''.$project->title . ' '. $conference->label.''; print '
'; $maxattendees = 0; if ($conference->id > 0) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index c68b39d38df..1415f420e92 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4837,6 +4837,7 @@ input#cardholder-name { .divmainbodylarge { margin-left: 40px; margin-right: 40px; } .publicnewmemberform div.titre { font-size: 2em; } #divsubscribe { max-width: 900px; } +#divsubscribe .eventlabel { font-size: 1.5em; } #tablesubscribe { width: 100%; } #tablesubscribe tr td { font-size: 1.15em; } #tablesubscribe .price-registration { font-size: 1.5em; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index dd1194972b5..be49f427eae 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4686,6 +4686,7 @@ span.buttonpaymentsmall { .divmainbodylarge { margin-left: 40px; margin-right: 40px; } .publicnewmemberform div.titre { font-size: 2em; } #divsubscribe { max-width: 900px; } +#divsubscribe .eventlabel { font-size: 1.5em; } #tablesubscribe { width: 100%; } #tablesubscribe tr td { font-size: 1.15em; } #tablesubscribe .price-registration { font-size: 1.5em; } From 89261d51e395b691ff375c0dbe2c1861177e0465 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 19:30:19 +0200 Subject: [PATCH 8/8] css --- htdocs/public/eventorganization/attendee_new.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 371d69710b7..e0ad4a0420b 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -681,7 +681,6 @@ if ($maxattendees && $currentnbofattendees >= $maxattendees) { } -print '
'; dol_htmloutput_errors($errmsg, $errors);