From 17f77b8edb934d36fab2edcb707a7c8389d36259 Mon Sep 17 00:00:00 2001 From: abb Date: Tue, 9 Feb 2021 23:46:07 +0100 Subject: [PATCH 01/10] New : Hook selectForFormsListWhere --- htdocs/core/class/html.form.class.php | 51 +++++++++++++++------------ 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4284b009019..4a5b7fcb443 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6300,7 +6300,7 @@ class Form */ public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled = 0) { - global $conf, $langs, $user; + global $conf, $langs, $user,$hookmanager; //print "$objecttmp->filter, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled"; @@ -6346,27 +6346,34 @@ class Form } if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE 1=1"; - if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; - if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) { - $sql .= ' AND parenttable.entity = t.'.$tmparray[0]; - } - if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { - if ($objecttmp->element == 'societe') $sql .= " AND t.rowid = ".$user->socid; - else $sql .= " AND t.fk_soc = ".$user->socid; - } - if ($searchkey != '') $sql .= natural_search(explode(',', $fieldstoshow), $searchkey); - if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { - if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; - } - if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" - /*if (! DolibarrApi::_checkFilters($objecttmp->filter)) - { - throw new RestException(503, 'Error when validating parameter sqlfilters '.$objecttmp->filter); - }*/ - $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; - $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'Form::forgeCriteriaCallback', $objecttmp->filter).")"; - } + + // Add where from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('selectForFormsListWhere', $parameters); // Note that $action and $object may have been modified by hook + if(!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint; + else { + $sql .= " WHERE 1=1"; + if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; + if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) { + $sql .= ' AND parenttable.entity = t.'.$tmparray[0]; + } + if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { + if ($objecttmp->element == 'societe') $sql .= " AND t.rowid = ".$user->socid; + else $sql .= " AND t.fk_soc = ".$user->socid; + } + if ($searchkey != '') $sql .= natural_search(explode(',', $fieldstoshow), $searchkey); + if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { + if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + } + if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + /*if (! DolibarrApi::_checkFilters($objecttmp->filter)) + { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$objecttmp->filter); + }*/ + $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'Form::forgeCriteriaCallback', $objecttmp->filter).")"; + } + } $sql .= $this->db->order($fieldstoshow, "ASC"); //$sql.=$this->db->plimit($limit, 0); //print $sql; From 72bfa81082f3b539d7d85544fceed6e61eea1b12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Feb 2021 14:14:28 +0100 Subject: [PATCH 02/10] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4a5b7fcb443..a68b67e1dde 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6350,7 +6350,7 @@ class Form // Add where from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('selectForFormsListWhere', $parameters); // Note that $action and $object may have been modified by hook - if(!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint; + if (!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint; else { $sql .= " WHERE 1=1"; if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; From e37a4be1d62b4e3e4f1592fcef4663a7283a1a52 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Feb 2021 20:10:15 +0100 Subject: [PATCH 03/10] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a68b67e1dde..f31254a4c95 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6300,7 +6300,7 @@ class Form */ public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled = 0) { - global $conf, $langs, $user,$hookmanager; + global $conf, $langs, $user, $hookmanager; //print "$objecttmp->filter, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled"; From f186e7bf4b591f5c5f1c791d974ee619b0e0735c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 15 Feb 2021 12:18:08 +0100 Subject: [PATCH 04/10] project list and card ok --- htdocs/langs/en_US/eventorganization.lang | 4 +-- htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/card.php | 32 +++++++++++++++++++---- htdocs/projet/class/project.class.php | 8 +++--- htdocs/projet/list.php | 27 ++++++++++++++++++- 5 files changed, 61 insertions(+), 11 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 8a0475758e5..247663135db 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -18,7 +18,7 @@ # ModuleEventOrganizationName = Event Organization -EventOrganizationDescription = Event Organization +EventOrganizationDescription = Event Organization through Module Project EventOrganizationDescriptionLong= Manage Event organization for conference, attendees, speaker, and attendees, with public subcription page # @@ -42,7 +42,7 @@ EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Template of email of massaction # Object # EventOrganizationConfOrBooth= Conference Or Booth - +ManageOrganizeEvent = Manage event organisation # # Template Mail diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 279bf99d162..b6d9e236c18 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -269,3 +269,4 @@ OneLinePerPeriod=One line per period RefTaskParent=Ref. Parent Task ProfitIsCalculatedWith=Profit is calculated using AddPersonToTask=Add also to tasks +UsageOrganizeEvent=Usage: Event Organization diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 364cb30633a..0462f9d3391 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -35,7 +35,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page -$langs->loadLangs(array('projects', 'companies')); +$langsLoad=array('projects', 'companies'); +if (!empty($conf->eventorganization->enabled)) { + $langsLoad[]='eventorganization'; +} + +$langs->loadLangs($langsLoad); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); @@ -569,10 +574,14 @@ if ($action == 'create' && $user->rights->projet->creer) print ''; print '
'; } - /* - print ' '; - $htmltext = $langs->trans("OrganizeEvent"); - print $form->textwithpicto($langs->trans("OrganizeEvent"), $htmltext);*/ + + if (!empty($conf->eventorganization->enabled)) + { + print ' '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print ''; print ''; @@ -855,6 +864,12 @@ if ($action == 'create' && $user->rights->projet->creer) print $form->textwithpicto($langs->trans("BillTime"), $htmltext); print '
'; } + if (!empty($conf->eventorganization->enabled)) + { + print ' '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } print ''; // Thirdparty @@ -1020,6 +1035,13 @@ if ($action == 'create' && $user->rights->projet->creer) print $form->textwithpicto($langs->trans("BillTime"), $htmltext); print '
'; } + + if (!empty($conf->eventorganization->enabled)) + { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } print ''; // Visibility diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 4fff4297854..589c67aee75 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -200,7 +200,7 @@ class Project extends CommonObject 'usage_bill_time' =>array('type'=>'integer', 'label'=>'UsageBillTimeShort', 'enabled'=>1, 'visible'=>-1, 'position'=>130), 'usage_opportunity' =>array('type'=>'integer', 'label'=>'UsageOpportunity', 'enabled'=>1, 'visible'=>-1, 'position'=>135), 'usage_task' =>array('type'=>'integer', 'label'=>'UsageTasks', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'usage_organize_event' =>array('type'=>'integer', 'label'=>'Usage organize event', 'enabled'=>1, 'visible'=>-1, 'position'=>145), + 'usage_organize_event' =>array('type'=>'integer', 'label'=>'UsageOrganizeEvent', 'enabled'=>1, 'visible'=>-1, 'position'=>145), 'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>-2, 'position'=>200), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>205), 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>210), @@ -232,6 +232,8 @@ class Project extends CommonObject */ public function __construct($db) { + global $conf; + $this->db = $db; $this->statuts_short = array(0 => 'Draft', 1 => 'Opened', 2 => 'Closed'); @@ -248,12 +250,12 @@ class Project extends CommonObject $this->fields['usage_opportunity']['enabled'] = 0; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { + if (!empty($conf->global->PROJECT_HIDE_TASKS)) { $this->fields['usage_bill_time']['visible'] = 0; $this->fields['usage_task']['visible'] = 0; } - if (empty($conf->global->PROJECT_ORGANIZE_EVENTS)) { + if (empty($conf->eventorganization->enabled)) { $this->fields['usage_organize_event']['visible'] = 0; } } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index ad8418dfc0e..c51713d1cce 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -92,6 +92,7 @@ $search_sale = GETPOST('search_sale', 'int'); $search_usage_opportunity = GETPOST('search_usage_opportunity', 'int'); $search_usage_task = GETPOST('search_usage_task', 'int'); $search_usage_bill_time = GETPOST('search_usage_bill_time', 'int'); +$search_usage_event_organization = GETPOST('search_usage_event_organization', 'int'); $optioncss = GETPOST('optioncss', 'alpha'); $mine = $_REQUEST['mode'] == 'mine' ? 1 : 0; @@ -207,6 +208,7 @@ if (empty($reshook)) $search_usage_opportunity = ''; $search_usage_task = ''; $search_usage_bill_time = ''; + $search_usage_event_organization = ''; $toselect = ''; $search_array_options = array(); $search_category_array = array(); @@ -300,7 +302,8 @@ if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0] = '0'; / $distinct = 'DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once. $sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat"; -$sql .= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount, p.usage_opportunity, p.usage_task, p.usage_bill_time"; +$sql .= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount "; +$sql .= ", p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event"; $sql .= ", s.rowid as socid, s.nom as name, s.email"; $sql .= ", cls.code as opp_status_code"; // Add fields from extrafields @@ -369,6 +372,7 @@ if ($search_budget_amount != '') $sql .= natural_search('p.budget_amount', $sear if ($search_usage_opportunity != '' && $search_usage_opportunity >= 0) $sql .= natural_search('p.usage_opportunity', $search_usage_opportunity, 2); if ($search_usage_task != '' && $search_usage_task >= 0) $sql .= natural_search('p.usage_task', $search_usage_task, 2); if ($search_usage_bill_time != '' && $search_usage_bill_time >= 0) $sql .= natural_search('p.usage_bill_time', $search_usage_bill_time, 2); +if ($search_usage_event_organization != '' && $search_usage_event_organization >= 0) $sql .= natural_search('p.usage_organize_event', $search_usage_event_organization, 2); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -443,6 +447,9 @@ if ($search_project_user != '') $param .= '&search_project_user='.urlencode($s if ($search_sale > 0) $param .= '&search_sale='.urlencode($search_sale); if ($search_opp_amount != '') $param .= '&search_opp_amount='.urlencode($search_opp_amount); if ($search_budget_amount != '') $param .= '&search_budget_amount='.urlencode($search_budget_amount); +if ($search_usage_task != '') $param .= '&search_usage_task='.urlencode($search_usage_task); +if ($search_usage_bill_time != '') $param .= '&search_usage_opportunity='.urlencode($search_usage_bill_time); +if ($search_usage_event_organization != '') $param .= '&search_usage_event_organization='.urlencode($search_usage_event_organization); if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -650,6 +657,12 @@ if (!empty($arrayfields['p.usage_bill_time']['checked'])) print $form->selectyesno('search_usage_bill_time', $search_usage_bill_time, 1, false, 1); print ''; } +if (!empty($arrayfields['p.usage_organize_event']['checked'])) +{ + print ''; + print $form->selectyesno('search_usage_event_organization', $search_usage_event_organization, 1, false, 1); + print ''; +} // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -703,6 +716,7 @@ if (!empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre( if (!empty($arrayfields['p.usage_opportunity']['checked'])) print_liste_field_titre($arrayfields['p.usage_opportunity']['label'], $_SERVER["PHP_SELF"], 'p.usage_opportunity', "", $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['p.usage_task']['checked'])) print_liste_field_titre($arrayfields['p.usage_task']['label'], $_SERVER["PHP_SELF"], 'p.usage_task', "", $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); +if (!empty($arrayfields['p.usage_organize_event']['checked'])) print_liste_field_titre($arrayfields['p.usage_organize_event']['label'], $_SERVER["PHP_SELF"], 'p.usage_organize_event', "", $param, '', $sortfield, $sortorder, 'right '); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields @@ -927,6 +941,17 @@ while ($i < min($num, $limit)) print ''; if (!$i) $totalarray['nbfield']++; } + // Event Organization + if (!empty($arrayfields['p.usage_organize_event']['checked'])) + { + print ''; + if ($obj->usage_event_organization) + { + print yn($obj->usage_event_organization); + } + print ''; + if (!$i) $totalarray['nbfield']++; + } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook From b3c9274341b100c31daae606db6ef5031bde3605 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 15 Feb 2021 11:21:54 +0000 Subject: [PATCH 05/10] Fixing style errors. --- htdocs/modulebuilder/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 7838581fdc4..06d7e5690f1 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1707,7 +1707,6 @@ if (is_array($listofmodules) && count($listofmodules) > 0) { } else { if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) { - $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1); $linktoenabledisable .= '   '.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''; } else { From 7f0dc9e894cad324b0814a74f9b86d1b44e59c64 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Wed, 17 Feb 2021 11:58:22 +0100 Subject: [PATCH 06/10] FIX possible warning --- htdocs/projet/class/task.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index a2e670906ca..39a572e6510 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -390,7 +390,7 @@ class Task extends CommonObject } } - if (!$error && $conf->global->PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE) { + if (!$error && !empty($conf->global->PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE)) { // Close the parent project if it is open (validated) and its tasks are 100% completed $project = new Project($this->db); if ($project->fetch($this->fk_project) > 0 && $project->statut == Project::STATUS_VALIDATED) { From 060bfde08237648902000d44bc2089d68d6025e5 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 17 Feb 2021 15:26:56 +0100 Subject: [PATCH 07/10] 20200217 --- htdocs/adherents/class/adherent.class.php | 1 + htdocs/societe/class/societe.class.php | 1 + htdocs/user/class/user.class.php | 3 +++ 3 files changed, 5 insertions(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 8e5cdbe8067..bd09dd4e5a8 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -627,6 +627,7 @@ class Adherent extends CommonObject $this->address = ($this->address ? $this->address : $this->address); $this->zip = ($this->zip ? $this->zip : $this->zip); $this->town = ($this->town ? $this->town : $this->town); + $this->setUpperOrLowerCase(); $this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id); $this->state_id = ($this->state_id > 0 ? $this->state_id : $this->state_id); $this->setUpperOrLowerCase(); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c4d355ab62c..f855a80ef7f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -984,6 +984,7 @@ class Societe extends CommonObject $contact->email = $this->email; $contact->zip = $this->zip; $contact->town = $this->town; + $this->setUpperOrLowerCase(); $contact->phone_pro = $this->phone; $contactId = $contact->create($user); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 8f8f8c67ca8..12b5c1f87ff 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1402,6 +1402,7 @@ class User extends CommonObject $this->address = $contact->address; $this->zip = $contact->zip; $this->town = $contact->town; + $this->setUpperOrLowerCase(); $this->state_id = $contact->state_id; $this->country_id = $contact->country_id; $this->employee = 0; @@ -1480,6 +1481,7 @@ class User extends CommonObject $this->address = $member->address; $this->zip = $member->zip; $this->town = $member->town; + $this->setUpperOrLowerCase(); $this->state_id = $member->state_id; $this->country_id = $member->country_id; $this->socialnetworks = $member->socialnetworks; @@ -1637,6 +1639,7 @@ class User extends CommonObject $this->address = empty($this->address) ? '' : $this->address; $this->zip = empty($this->zip) ? '' : $this->zip; $this->town = empty($this->town) ? '' : $this->town; + $this->setUpperOrLowerCase(); $this->accountancy_code = trim($this->accountancy_code); $this->color = empty($this->color) ? '' : $this->color; $this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment; From ae9582286d86b736e07732e27ded9c1cf4e2fff5 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 17 Feb 2021 16:39:03 +0100 Subject: [PATCH 08/10] Update user.class.php --- htdocs/user/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 12b5c1f87ff..8712bcc4615 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1475,7 +1475,7 @@ class User extends CommonObject $this->civility_code = $member->civility_id; $this->lastname = $member->lastname; $this->firstname = $member->firstname; - $this->gender = $member->gender; + $this->gender = $member->gender; $this->email = $member->email; $this->fk_member = $member->id; $this->address = $member->address; From 1795435d6bfbdc33e66758fb4521339ce17b7ed8 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 18 Feb 2021 08:45:48 +0100 Subject: [PATCH 09/10] Change erreur --- htdocs/adherents/class/adherent.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index bd09dd4e5a8..8e5cdbe8067 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -627,7 +627,6 @@ class Adherent extends CommonObject $this->address = ($this->address ? $this->address : $this->address); $this->zip = ($this->zip ? $this->zip : $this->zip); $this->town = ($this->town ? $this->town : $this->town); - $this->setUpperOrLowerCase(); $this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id); $this->state_id = ($this->state_id > 0 ? $this->state_id : $this->state_id); $this->setUpperOrLowerCase(); From 75b378edd3eda74944e3a28952b16b14b2aea608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 18 Feb 2021 22:47:41 +0100 Subject: [PATCH 10/10] remove unused code --- htdocs/commande/contact.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 7df7dbea130..add4244d7dc 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -128,23 +129,17 @@ $userstatic = new User($db); /* */ /* *************************************************************************** */ -if ($id > 0 || !empty($ref)) -{ - $langs->trans("OrderCard"); - - if ($object->fetch($id, $ref) > 0) - { +if ($id > 0 || !empty($ref)) { + if ($object->fetch($id, $ref) > 0) { $object->fetch_thirdparty(); $head = commande_prepare_head($object); print dol_get_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), -1, 'order'); - // Order card $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref = '
'; // Ref customer $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);