From f4786c8a0afdf13b14c6c8ca03eee689bbc3e075 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 19:46:40 +0200 Subject: [PATCH 01/47] Include ref into label of log history Conflicts: htdocs/holiday/card.php --- htdocs/holiday/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 729b4653f64..3ca389176e7 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -561,11 +561,11 @@ 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; - // On ajoute la modification dans le LOG - $result = $object->addLogCP($user->id, $object->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde, $object->fk_type); - if ($result < 0) - { + // The modification is added to the LOG + $result = $object->addLogCP($user->id, $object->fk_user, $label, $newSolde, $object->fk_type); + if ($result < 0) { $error++; setEventMessages(null, $object->errors, 'errors'); } From 77247ec43a3589312727478f00ba73e0301fe788 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 20:35:57 +0200 Subject: [PATCH 02/47] Add date valid/approval --- htdocs/holiday/list.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index f801a685d6a..84ba4a3a9d0 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -568,6 +568,12 @@ if ($resql) print ''; } + // End date + if (!empty($arrayfields['cp.date_valid']['checked'])) { + print ''; + print ''; + } + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook @@ -584,7 +590,7 @@ if ($resql) print ''; } - // Create date + // Update date if (!empty($arrayfields['cp.tms']['checked'])) { print ''; @@ -617,6 +623,7 @@ if ($resql) if (!empty($arrayfields['duration']['checked'])) print_liste_field_titre($arrayfields['duration']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right maxwidth100'); if (!empty($arrayfields['cp.date_debut']['checked'])) print_liste_field_titre($arrayfields['cp.date_debut']['label'], $_SERVER["PHP_SELF"], "cp.date_debut", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['cp.date_fin']['checked'])) print_liste_field_titre($arrayfields['cp.date_fin']['label'], $_SERVER["PHP_SELF"], "cp.date_fin", "", $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['cp.date_valid']['checked'])) print_liste_field_titre($arrayfields['cp.date_valid']['label'], $_SERVER["PHP_SELF"], "cp.date_valid", "", $param, '', $sortfield, $sortorder, 'center '); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields @@ -733,6 +740,18 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } + if (!empty($arrayfields['cp.date_valid']['checked'])) { // date_valid is both date_valid but also date_approval + print ''; + print dol_print_date($db->jdate($obj->date_valid), 'day'); + print ''; + if (!$i) $totalarray['nbfield']++; + } + /*if (!empty($arrayfields['cp.date_approve']['checked'])) { + print ''; + print dol_print_date($db->jdate($obj->date_approve), 'day'); + print ''; + if (!$i) $totalarray['nbfield']++; + }*/ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; From 1eb4975a761af9bfd20431c2376e85b9cc157da1 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 10 Sep 2021 11:44:58 +0200 Subject: [PATCH 03/47] fix: Bad date creation for project clone --- htdocs/projet/class/project.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index c5dd1045f03..aca817e0193 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1448,7 +1448,7 @@ class Project extends CommonObject } } - $clone_project->datec = $now; + $clone_project->date_c = $now; if (!$clone_note) { From 3ea617ef6832c0acf9e3d11ebfaa42c929a25e2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Sep 2021 03:07:57 +0200 Subject: [PATCH 04/47] Fix missing trans --- htdocs/langs/en_US/admin.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 936fbcc5941..fb9fcb888ad 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1707,6 +1707,8 @@ FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailin FCKeditorForUserSignature=WYSIWIG creation/edition of user signature FCKeditorForMail=WYSIWIG creation/edition for all mail (except Tools->eMailing) FCKeditorForTicket=WYSIWIG creation/edition for tickets +FCKeditorForNotePublic=WYSIWIG creation/edition for public notes +FCKeditorForNotePrivate=WYSIWIG creation/edition for private notes ##### Stock ##### StockSetup=Stock module setup IfYouUsePointOfSaleCheckModule=If you use the Point of Sale module (POS) provided by default or an external module, this setup may be ignored by your POS module. Most POS modules are designed by default to create an invoice immediately and decrease stock irrespective of the options here. So if you need or not to have a stock decrease when registering a sale from your POS, check also your POS module setup. From ce9a10bd90b925f36bb82fdaaf41f4d8ff6f72d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Sep 2021 03:43:25 +0200 Subject: [PATCH 05/47] Fix description of some options --- htdocs/admin/fckeditor.php | 12 ++++++------ htdocs/core/modules/modFckeditor.class.php | 12 ++++++------ htdocs/langs/en_US/admin.lang | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 3388b649a67..d3c142b8e99 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -47,6 +47,8 @@ if (!$user->admin) { // Constant and translation of the module description $modules = array( + 'NOTE_PUBLIC' => 'FCKeditorForNotePublic', + 'NOTE_PRIVATE' => 'FCKeditorForNotePrivate', 'SOCIETE' => 'FCKeditorForCompany', 'PRODUCTDESC' => 'FCKeditorForProduct', 'DETAILS' => 'FCKeditorForProductDetails', @@ -54,11 +56,11 @@ $modules = array( 'MAILING' => 'FCKeditorForMailing', 'MAIL' => 'FCKeditorForMail', 'TICKET' => 'FCKeditorForTicket', - 'NOTE_PUBLIC' => 'FCKeditorForNotePublic', - 'NOTE_PRIVATE' => 'FCKeditorForNotePrivate', ); // Conditions for the option to be offered $conditions = array( + 'NOTE_PUBLIC' => 1, + 'NOTE_PRIVATE' => 1, 'SOCIETE' => 1, 'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)), 'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)), @@ -66,11 +68,11 @@ $conditions = array( 'MAILING' => !empty($conf->mailing->enabled), 'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)), 'TICKET' => !empty($conf->ticket->enabled), - 'NOTE_PUBLIC' => 1, - 'NOTE_PRIVATE' => 1, ); // Picto $picto = array( + 'NOTE_PUBLIC' => 'generic', + 'NOTE_PRIVATE' => 'generic', 'SOCIETE' => 'generic', 'PRODUCTDESC' => 'product', 'DETAILS' => 'product', @@ -78,8 +80,6 @@ $picto = array( 'MAILING' => 'email', 'MAIL' => 'email', 'TICKET' => 'ticket', - 'NOTE_PUBLIC' => 'generic', - 'NOTE_PRIVATE' => 'generic', ); diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 7742051989e..480a936f656 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -69,12 +69,12 @@ class modFckeditor extends DolibarrModules // Constants $this->const = array(); - $this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE", "yesno", "1", "WYSIWIG for description and note (except products/services)"); - $this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC", "yesno", "1", "WYSIWIG for products/services description and note"); - $this->const[2] = array("FCKEDITOR_ENABLE_MAILING", "yesno", "1", "WYSIWIG for mass emailings"); - $this->const[3] = array("FCKEDITOR_ENABLE_DETAILS", "yesno", "1", "WYSIWIG for products details lines for all entities"); - $this->const[4] = array("FCKEDITOR_ENABLE_USERSIGN", "yesno", "1", "WYSIWIG for user signature"); - $this->const[5] = array("FCKEDITOR_ENABLE_MAIL", "yesno", "1", "WYSIWIG for products details lines for all entities"); + $this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE", "yesno", "1", "WYSIWIG for description and note (except products/services)"); + $this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC", "yesno", "1", "WYSIWIG for products/services description and note"); + $this->const[2] = array("FCKEDITOR_ENABLE_MAILING", "yesno", "1", "WYSIWIG for mass emailings"); + $this->const[3] = array("FCKEDITOR_ENABLE_DETAILS", "yesno", "1", "WYSIWIG for products details lines for all entities"); + $this->const[4] = array("FCKEDITOR_ENABLE_USERSIGN", "yesno", "1", "WYSIWIG for user signature"); + $this->const[5] = array("FCKEDITOR_ENABLE_MAIL", "yesno", "1", "WYSIWIG for products details lines for all entities"); $this->const[6] = array("FCKEDITOR_SKIN", "string", "moono-lisa", "Skin by default for fckeditor"); // Boxes diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index fb9fcb888ad..ef1c1deb3b5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1700,15 +1700,15 @@ FreeLegalTextOnDeliveryReceipts=Free text on delivery receipts ##### FCKeditor ##### AdvancedEditor=Advanced editor ActivateFCKeditor=Activate advanced editor for: -FCKeditorForCompany=WYSIWIG creation/edition of elements description and note (except products/services) -FCKeditorForProduct=WYSIWIG creation/edition of products/services description and note +FCKeditorForNotePublic=WYSIWIG creation/edition of the field public notes of elements +FCKeditorForNotePrivate=WYSIWIG creation/edition of the field private notes of elements +FCKeditorForCompany=WYSIWIG creation/edition of the field description of elements (except products/services) +FCKeditorForProduct=WYSIWIG creation/edition of the field description of products/services FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formatting when building PDF files. FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing) FCKeditorForUserSignature=WYSIWIG creation/edition of user signature FCKeditorForMail=WYSIWIG creation/edition for all mail (except Tools->eMailing) FCKeditorForTicket=WYSIWIG creation/edition for tickets -FCKeditorForNotePublic=WYSIWIG creation/edition for public notes -FCKeditorForNotePrivate=WYSIWIG creation/edition for private notes ##### Stock ##### StockSetup=Stock module setup IfYouUsePointOfSaleCheckModule=If you use the Point of Sale module (POS) provided by default or an external module, this setup may be ignored by your POS module. Most POS modules are designed by default to create an invoice immediately and decrease stock irrespective of the options here. So if you need or not to have a stock decrease when registering a sale from your POS, check also your POS module setup. From d464922d717e4015f1ef308ef8f4421ae95b1672 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 13 Sep 2021 09:44:54 +0200 Subject: [PATCH 06/47] fix: LDAP Search LIMIT must be after ORDER BY --- htdocs/user/class/user.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 0a352210d41..55be42de5e0 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -455,8 +455,9 @@ class User extends CommonObject } } - if ($sid) { // permet une recherche du user par son SID ActiveDirectory ou Samba - $sql .= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."') LIMIT 1"; + if ($sid) { + // permet une recherche du user par son SID ActiveDirectory ou Samba + $sql .= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."')"; } elseif ($login) { $sql .= " AND u.login = '".$this->db->escape($login)."'"; } elseif ($email) { @@ -466,6 +467,11 @@ class User extends CommonObject } $sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities + if ($sid) { + // permet une recherche du user par son SID ActiveDirectory ou Samba + $sql .= ' '.$this->db->plimit(1); + } + $result = $this->db->query($sql); if ($result) { $obj = $this->db->fetch_object($result); From 3ee258fefc5eee1766933f06ca6ff6ba840f6d63 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 13 Sep 2021 14:08:41 +0200 Subject: [PATCH 07/47] FIX Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50) --- htdocs/accountancy/class/accountancyexport.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 9749cd91d4d..1f987f61602 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -468,7 +468,7 @@ class AccountancyExport /** * Export format : CIEL (Format XIMPORT) * Format since 2003 compatible CIEL version > 2002 / Sage50 - * Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr) + * Last review for this format : 2021-09-13 Alexandre Spangaro (aspangaro@open-dsi.fr) * * Help : https://sage50c.online-help.sage.fr/aide-technique/ * In sage software | Use menu : "Exchange" > "Importing entries..." @@ -496,7 +496,7 @@ class AccountancyExport $Tab = array(); $Tab['num_ecriture'] = str_pad($data->piece_num, 5); - $Tab['code_journal'] = str_pad($data->code_journal, 2); + $Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2); $Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT); $Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT); $Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12); @@ -504,9 +504,9 @@ class AccountancyExport $Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25); $Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT); $Tab['type_montant'] = str_pad($data->sens, 1); - $Tab['vide'] = str_repeat(' ', 18); + $Tab['vide'] = str_repeat(' ', 18); // Analytical accounting - Not managed in Dolibarr $Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34); - $Tab['end'] = 'O2003'; + $Tab['end'] = 'O2003'; // 0 = EUR | 2003 = Format Ciel $Tab['end_line'] = $end_line; From 41f627b80d3daac1290b283b09cd6e5336b6ca5a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Sep 2021 16:33:16 +0200 Subject: [PATCH 08/47] Prepare 14.0.3 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index b37d9fdde7c..23852ae4918 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '14.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '14.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From f3fcb7a48a45b16d16357ad1e0bc282e611042df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Sep 2021 16:59:49 +0200 Subject: [PATCH 09/47] Fix insertion of email templates --- htdocs/admin/mails_templates.php | 2 +- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 1ea8564808e..f6c7684e4fa 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -228,7 +228,7 @@ if (!empty($conf->agenda->enabled)) { $elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush')); } if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) { - $elementList['eventorganization_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization')); + $elementList['conferenceorbooth'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization')); } if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) { $elementList['partnership_send'] = img_picto('', 'partnership', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToPartnership')); 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 89d0d2d0ce1..e9c8779ca4b 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 @@ -267,12 +267,13 @@ INSERT INTO llx_payment_vat (rowid, fk_tva, datec, datep, amount, fk_typepaiemen ALTER TABLE llx_tva ALTER COLUMN paye SET DEFAULT 0; -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__

__(Sincerely)__

__MYCOMPANY_NAME__
__USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__

__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); +-- Event organization +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__

__(Sincerely)__

__MYCOMPANY_NAME__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__

__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); ALTER TABLE llx_projet ADD COLUMN accept_conference_suggestions integer DEFAULT 0; ALTER TABLE llx_projet ADD COLUMN accept_booth_suggestions integer DEFAULT 0; From aeead15a62bb9a64e2c4a5d15193b05d32680653 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Sep 2021 17:07:29 +0200 Subject: [PATCH 10/47] css --- htdocs/admin/eventorganization.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 439a3d9cafa..44bd0b035c6 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -213,7 +213,7 @@ if ($action == 'edit') { print ''; print ''; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled']==1) { @@ -309,7 +309,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled']==1) { From 21462d0b8211f474ee0218adbbc91fc469c5aebc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Sep 2021 17:24:53 +0200 Subject: [PATCH 11/47] Fix can reset filter in setup --- htdocs/admin/eventorganization.php | 2 +- htdocs/core/class/html.formcompany.class.php | 26 ++++++++++++------- .../class/conferenceorboothattendee.class.php | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 44bd0b035c6..c7b698ea9eb 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -264,7 +264,7 @@ if ($action == 'edit') { } elseif (preg_match('/thirdparty_type/', $val['type'])) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $formcompany = new FormCompany($db); - print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname); + print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname, 'customerorprospect', 'form', '', 1); } elseif ($val['type'] == 'securekey') { print ''; if (!empty($conf->use_javascript_ajax)) { diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 3e2c3588405..94ab9caf5f9 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -998,16 +998,16 @@ class FormCompany extends Form /** * Return a HTML select for thirdparty type * - * @param int $selected selected value - * @param string $htmlname HTML select name - * @param string $htmlidname HTML select id - * @param string $typeinput HTML output - * @param string $morecss More css - * @return string HTML string + * @param int $selected Selected value + * @param string $htmlname HTML select name + * @param string $htmlidname HTML select id + * @param string $typeinput HTML output + * @param string $morecss More css + * @param string $allowempty Allow empty value or not + * @return string HTML string */ - public function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '') + public function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '', $allowempty = '') { - global $conf, $langs; if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->fournisseur->enabled)) { return '' ; @@ -1015,8 +1015,14 @@ class FormCompany extends Form $out = '"; } - print '\n"; // Can edit diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index f84fce1a2b6..1e2f7aaa63d 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -536,15 +536,16 @@ jQuery(document).ready(function () { jQuery(document).ready(function () { function initmorphy() { - if (jQuery("#morphy").val()==\'phy\') { - jQuery("#trcompany").hide(); - } - if (jQuery("#morphy").val()==\'mor\') { - jQuery("#trcompany").show(); - } + console.log("Call initmorphy"); + if (jQuery("#morphy").val() == \'phy\') { + jQuery("#trcompany").hide(); + } + if (jQuery("#morphy").val() == \'mor\') { + jQuery("#trcompany").show(); + } }; initmorphy(); - jQuery("#morphy").click(function() { + jQuery("#morphy").change(function() { initmorphy(); }); jQuery("#selectcountry_id").change(function() { @@ -592,21 +593,31 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { print ''; } -// Civility +// Company +print ''."\n"; +// Title print ''."\n"; // Lastname print ''."\n"; // Firstname print ''."\n"; +// EMail +print ''."\n"; +// Login +if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + print ''."\n"; + print ''."\n"; + print ''."\n"; +} // Gender print ''; print ''; -// Company -print ''."\n"; // Address print ''."\n"; @@ -618,7 +629,8 @@ print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'se print ''; // Country print ''; } -// EMail -print ''."\n"; -// Login -if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''."\n"; - print ''."\n"; - print ''."\n"; -} // Birthday print ''; print ''; print ''."\n"; - // Add specific fields used by Dolibarr foundation for example +// Add specific fields used by Dolibarr foundation for example +// TODO Move this into generic feature. if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+'); 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 20/47] 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 21/47] 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("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + 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); @@ -541,7 +560,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { //print ''; print ''; $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id; - $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2); + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5'); $linksuggest .= '&securekey='.urlencode($encodedsecurekey); //print ''; $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); + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //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); diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 7dd52818798..faa2013ceb5 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -142,17 +142,10 @@ 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 page -# -SubscriptionOk = Your subscription has been validated -# -# Subscription validation mail -# +SubscriptionOk = Your registration has been validated ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to an event -# -# Payment page -# Attendee = Attendee PaymentConferenceAttendee = Conference attendee payment PaymentBoothLocation = Booth location payment + +RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email %s diff --git a/htdocs/public/eventorganization/attendee_registration.php b/htdocs/public/eventorganization/attendee_registration.php index 385152e420a..fdfd9a3f2e3 100644 --- a/htdocs/public/eventorganization/attendee_registration.php +++ b/htdocs/public/eventorganization/attendee_registration.php @@ -279,10 +279,16 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // At this point, we have an existing $confattendee. It may not be linked to a thirdparty. //var_dump($confattendee); - // If the attendee has already been paid - if (!empty($confattendee->date_subscription)) { - $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + // If the registration has already been paid for this attendee + if (!empty($confattendee->date_subscription) && !empty($confattendee->amount)) { + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'master'); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); + + $mesg = $langs->trans("RegistrationAndPaymentWereAlreadyRecorder", $email); + setEventMessages($mesg, null, 'mesgs'); + + $db->commit(); + Header("Location: ".$redirection); exit; } @@ -359,6 +365,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); + // Update attendee country to match country of thirdparty $confattendee->fk_soc = $thirdparty->id; $confattendee->update($user); } @@ -370,6 +377,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $outputlangs = $langs; // TODO Use default language of $thirdparty->default_lang to build $outputlang + // Get product to use for invoice $productforinvoicerow = new Product($db); $productforinvoicerow->id = 0; @@ -378,6 +386,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION); } + // Create invoice if ($resultprod < 0) { $error++; $errmsg .= $productforinvoicerow->error; @@ -442,6 +451,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $redirection .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } + Header("Location: ".$redirection); exit; } else { From 724badb522ebfdfb155969d9b7446b9ead86f5b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Sep 2021 13:29:19 +0200 Subject: [PATCH 17/47] Fix deletion of shipment when there is batch record --- htdocs/expedition/class/expedition.class.php | 8 +++----- htdocs/expedition/class/expeditionbatch.class.php | 4 +--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 752da8aca04..0d505a46007 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1455,11 +1455,9 @@ class Expedition extends CommonObject } } - // delete batch expedition line - if (!$error && $conf->productbatch->enabled) - { - if (ExpeditionLineBatch::deletefromexp($this->db, $this->id) < 0) - { + // delete batch expedition line (we try deletion even if module not enabled in case of the module were enabled and disabled previously) + if (!$error) { + if (ExpeditionLineBatch::deletefromexp($this->db, $this->id) < 0) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } } diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index 637f9dd749c..0cf9a3a68e8 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -153,10 +153,8 @@ class ExpeditionLineBatch extends CommonObject */ public static function deletefromexp($db, $id_expedition) { - $id_expedition = (int) $id_expedition; - $sql = "DELETE FROM ".MAIN_DB_PREFIX.self::$_table_element; - $sql .= " WHERE fk_expeditiondet in (SELECT rowid FROM ".MAIN_DB_PREFIX."expeditiondet WHERE fk_expedition=".$id_expedition.")"; + $sql .= " WHERE fk_expeditiondet in (SELECT rowid FROM ".MAIN_DB_PREFIX."expeditiondet WHERE fk_expedition=".((int) $id_expedition).")"; dol_syslog(__METHOD__, LOG_DEBUG); if ($db->query($sql)) From 3f7a75b0a3a8165bcd2c609a323b581b72c8add6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Sep 2021 19:02:17 +0200 Subject: [PATCH 18/47] FIX translation into email for member at membership validation. --- htdocs/adherents/card.php | 8 ++++---- htdocs/adherents/class/adherent.class.php | 4 ++-- htdocs/install/mysql/data/llx_c_email_templates.sql | 2 +- htdocs/societe/class/societe.class.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 7dd164c38b5..56643d80632 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -645,7 +645,7 @@ if (empty($reshook)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; @@ -716,7 +716,7 @@ if (empty($reshook)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION; @@ -787,7 +787,7 @@ if (empty($reshook)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION; @@ -1506,7 +1506,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index df9e35651c2..b7f2810912b 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1900,8 +1900,8 @@ class Adherent extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; $sql .= " statut = ".self::STATUS_VALIDATED; $sql .= ", datevalid = '".$this->db->idate($now)."'"; - $sql .= ", fk_user_valid=".$user->id; - $sql .= " WHERE rowid = ".$this->id; + $sql .= ", fk_user_valid=".((int) $user->id); + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::validate", LOG_DEBUG); $result = $this->db->query($sql); diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index 4005506e887..69a41a5b3ef 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -29,7 +29,7 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civility)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -- Recruiting INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

\n\n__(YourCandidatureAnswerMessage)__
__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 69aecc885c7..ff6e9474d34 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1759,7 +1759,7 @@ class Societe extends CommonObject $this->country_id = $obj->country_id; $this->country_code = $obj->country_id ? $obj->country_code : ''; - $this->country = $obj->country_id ? ($langs->transnoentities('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : ''; + $this->country = $obj->country_id ? (($langs->transnoentities('Country'.$obj->country_code) != 'Country'.$obj->country_code) ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : ''; $this->state_id = $obj->state_id; $this->state_code = $obj->state_code; From 4a2d3a55d41645e50d9f5e946895f7fb4f9f03e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Sep 2021 19:33:30 +0200 Subject: [PATCH 19/47] FIX Selection of type "people" for membership must hide the company --- htdocs/adherents/admin/website.php | 4 +-- htdocs/public/members/new.php | 46 +++++++++++++++++------------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index bb320e9f48a..e99e20452cc 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -56,7 +56,7 @@ if ($action == 'setMEMBER_ENABLE_PUBLIC') { if ($action == 'update') { $public = GETPOST('MEMBER_ENABLE_PUBLIC'); - $amount = GETPOST('MEMBER_NEWFORM_AMOUNT'); + $amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2); $editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT'); $payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE'); $forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int'); @@ -205,7 +205,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print '
'; print $langs->trans("DefaultAmount"); print ''; - print ''; + print ''; print "
'.$langs->trans("Company").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print '
'.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').'
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("Gender").''; $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); print '
'.$langs->trans("Company").'
'.$langs->trans("Address").''."\n"; print '
'.$langs->trans('Country').''; -$country_id = GETPOST('country_id'); +print img_picto('', 'country', 'class="pictofixedwidth"'); +$country_id = GETPOST('country_id', 'int'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); } @@ -644,14 +656,6 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print '
'.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').'
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); @@ -669,7 +673,8 @@ print ''.$langs->trans("Comments").'
'.$langs->trans("TurnoverOrBudget").' *'; @@ -712,6 +717,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { '; print '
'.$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 '