From dddd4186a864b53574b61d65d850c28ccf5c2fb0 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 13 Jun 2022 15:37:43 +0200 Subject: [PATCH 01/24] NEW show product label on inventory --- htdocs/core/class/commonobject.class.php | 11 ++++++++- .../fourn/class/fournisseur.product.class.php | 20 ++++++++++++---- htdocs/product/class/product.class.php | 24 ++++++++++++------- .../inventory/class/inventory.class.php | 2 +- 4 files changed, 41 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1f64741385f..1f258fa2ba4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7556,11 +7556,20 @@ abstract class CommonObject if ($classname && class_exists($classname)) { $object = new $classname($this->db); if ($object->element === 'product') { // Special cas for product because default valut of fetch are wrong + $getnomurlparam3 = (!isset($InfoFieldList[5]) ? 0 : $InfoFieldList[5]); + $getnomurlparam4 = (!isset($InfoFieldList[6]) ? -1 : $InfoFieldList[6]); + $getnomurlparam5 = (!isset($InfoFieldList[7]) ? 0 : $InfoFieldList[7]); + $getnomurlparam6 = (!isset($InfoFieldList[8]) ? 0 : $InfoFieldList[8]); + + /** + * @var Product $object + */ $object->fetch($value, '', '', '', 0, 1, 1); + $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2, $getnomurlparam3, $getnomurlparam4, $getnomurlparam5, $getnomurlparam6); } else { $object->fetch($value); + $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); } - $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); } } else { dol_syslog('Error bad setup of extrafield', LOG_WARNING); diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index d113eadd8a7..774dd192659 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1091,12 +1091,15 @@ class ProductFournisseur extends Product * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @param string $option On what the link point to ('nolink', ...) - * @param int $notooltip 1=Disable tooltip - * @param string $morecss Add more css on link + * @param int $maxlength Maxlength of ref * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $notooltip No tooltip + * @param int $add_label 0=Default, 1=Add label into string, >1=Add first chars into string + * @param string $sep ' - '=Separator between ref and label if option 'add_label' is set + * @param string $morecss ''=Add more css on link * @return string String with URL */ - public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $save_lastsearch_value = -1, $notooltip = 0, $add_label = 0, $sep = ' - ', $morecss = '') { global $db, $conf, $langs, $hookmanager; @@ -1107,6 +1110,11 @@ class ProductFournisseur extends Product $result = ''; $label = ''; + $newref = $this->ref; + if ($maxlength) { + $newref = dol_trunc($newref, $maxlength, 'middle'); + } + if (!empty($this->entity)) { $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80); if ($this->nbphoto > 0) { @@ -1228,10 +1236,12 @@ class ProductFournisseur extends Product $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); } if ($withpicto != 2) { - $result .= $this->ref.($this->ref_supplier ? ' ('.$this->ref_supplier.')' : ''); + $result .= $newref.($this->ref_supplier ? ' ('.$this->ref_supplier.')' : ''); } $result .= $linkend; - //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + if ($withpicto != 2) { + $result .= (($add_label && $this->label) ? $sep.dol_trunc($this->label, ($add_label > 1 ? $add_label : 0)) : ''); + } global $action; $hookmanager->initHooks(array($this->element . 'dao')); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5a7990cd0a7..c5eb211de2c 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4882,14 +4882,17 @@ class Product extends CommonObject /** * Return clicable link of object (with eventually picto) * - * @param int $withpicto Add picto into link - * @param string $option Where point the link ('stock', 'composition', 'category', 'supplier', '') - * @param int $maxlength Maxlength of ref - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking - * @param int $notooltip No tooltip - * @return string String with URL + * @param int $withpicto Add picto into link + * @param string $option Where point the link ('stock', 'composition', 'category', 'supplier', '') + * @param int $maxlength Maxlength of ref + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $notooltip No tooltip + * @param int $add_label 0=Default, 1=Add label into string, >1=Add first chars into string + * @param string $sep ' - '=Separator between ref and label if option 'add_label' is set + * @param string $morecss ''=Add more css on link + * @return string String with URL */ - public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $save_lastsearch_value = -1, $notooltip = 0) + public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $save_lastsearch_value = -1, $notooltip = 0, $add_label = 0, $sep = ' - ', $morecss = '') { global $conf, $langs, $hookmanager; include_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; @@ -4997,9 +5000,9 @@ class Product extends CommonObject } $linkclose .= ' title="'.dol_escape_htmltag($label, 1, 1).'"'; - $linkclose .= ' class="nowraponall classfortooltip"'; + $linkclose .= ' class="nowraponall classfortooltip'.($morecss ? ' '.$morecss : '').'"'; } else { - $linkclose = ' class="nowraponall"'; + $linkclose = ' class="nowraponall'.($morecss ? ' '.$morecss : '').'"'; } if ($option == 'supplier' || $option == 'category') { @@ -5038,6 +5041,9 @@ class Product extends CommonObject } $result .= $newref; $result .= $linkend; + if ($withpicto != 2) { + $result .= (($add_label && $this->label) ? $sep.dol_trunc($this->label, ($add_label > 1 ? $add_label : 0)) : ''); + } global $action; $hookmanager->initHooks(array('productdao')); diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 80823c7ba5a..c755b92b3e4 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -101,7 +101,7 @@ class Inventory extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax200'), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php::::0:-1:0:1', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35), // This date is not used so disabled by default. 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), From 65d20bdc61e512f924a6cc6ad3eea9cd30e0f4ae Mon Sep 17 00:00:00 2001 From: lvessiller Date: Thu, 16 Jun 2022 12:06:06 +0200 Subject: [PATCH 02/24] NEW add attached file in presend email form of thirdparty card --- htdocs/core/tpl/card_presend.tpl.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 7b47c4676a6..9a99faef526 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -41,14 +41,16 @@ if ($action == 'presend') { $object->fetch_projet(); - if (!in_array($object->element, array('societe', 'user', 'member'))) { + $ref = dol_sanitizeFileName($object->ref); + if (!in_array($object->element, array('user', 'member'))) { // TODO get also the main_lastdoc field of $object. If not found, try to guess with following code - $ref = dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Special case if ($object->element == 'invoice_supplier') { $fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+'); + } elseif ($object->element == 'societe') { + $fileparams = dol_most_recent_file($diroutput.'/'.$ref); } else { $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+'); } @@ -82,12 +84,15 @@ if ($action == 'presend') { // Build document if it not exists $forcebuilddoc = true; - if (in_array($object->element, array('societe', 'user', 'member'))) { + if (in_array($object->element, array('user', 'member'))) { $forcebuilddoc = false; } if ($object->element == 'invoice_supplier' && empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)) { $forcebuilddoc = false; } + if ($object->element == 'societe' && empty($conf->global->COMPANY_ADDON_PDF)) { + $forcebuilddoc = false; + } if ($forcebuilddoc) { // If there is no default value for supplier invoice, we do not generate file, even if modelpdf was set by a manual generation if ((!$file || !is_readable($file)) && method_exists($object, 'generateDocument')) { $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); @@ -97,6 +102,8 @@ if ($action == 'presend') { } if ($object->element == 'invoice_supplier') { $fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+'); + } elseif ($object->element == 'societe') { + $fileparams = dol_most_recent_file($diroutput.'/'.$ref); } else { $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+'); } From 61a9521e3c7f48ac29e4df7bec471c586eecb0e3 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Fri, 17 Jun 2022 17:32:22 +0200 Subject: [PATCH 03/24] NEW Changelog and reorder getNomUrl parameters --- ChangeLog | 7 +++++++ htdocs/core/class/commonobject.class.php | 5 +++-- htdocs/fourn/class/fournisseur.product.class.php | 4 ++-- htdocs/product/class/product.class.php | 4 ++-- htdocs/product/inventory/class/inventory.class.php | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 37957f61c1d..5813c185885 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 17.0.0 compared to 16.0.0 ***** + +For developers or integrators: +------------------------------ + +Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product ***** ChangeLog for 16.0.0 compared to 15.0.0 ***** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 10b6fd5e690..a9b7edf6078 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7565,12 +7565,13 @@ abstract class CommonObject $getnomurlparam3 = (!isset($InfoFieldList[5]) ? 0 : $InfoFieldList[5]); $getnomurlparam4 = (!isset($InfoFieldList[6]) ? -1 : $InfoFieldList[6]); $getnomurlparam5 = (!isset($InfoFieldList[7]) ? 0 : $InfoFieldList[7]); - $getnomurlparam6 = (!isset($InfoFieldList[8]) ? 0 : $InfoFieldList[8]); + $getnomurlparam6 = (!isset($InfoFieldList[8]) ? '' : $InfoFieldList[8]); + $getnomurlparam7 = (!isset($InfoFieldList[9]) ? 0 : $InfoFieldList[9]); /** * @var Product $object */ - $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2, $getnomurlparam3, $getnomurlparam4, $getnomurlparam5, $getnomurlparam6); + $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2, $getnomurlparam3, $getnomurlparam4, $getnomurlparam5, $getnomurlparam6, $getnomurlparam7); } else { $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); } diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 774dd192659..349a317b1d2 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1094,12 +1094,12 @@ class ProductFournisseur extends Product * @param int $maxlength Maxlength of ref * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $notooltip No tooltip + * @param string $morecss ''=Add more css on link * @param int $add_label 0=Default, 1=Add label into string, >1=Add first chars into string * @param string $sep ' - '=Separator between ref and label if option 'add_label' is set - * @param string $morecss ''=Add more css on link * @return string String with URL */ - public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $save_lastsearch_value = -1, $notooltip = 0, $add_label = 0, $sep = ' - ', $morecss = '') + public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $save_lastsearch_value = -1, $notooltip = 0, $morecss = '', $add_label = 0, $sep = ' - ') { global $db, $conf, $langs, $hookmanager; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c5eb211de2c..c268929d59c 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4887,12 +4887,12 @@ class Product extends CommonObject * @param int $maxlength Maxlength of ref * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $notooltip No tooltip + * @param string $morecss ''=Add more css on link * @param int $add_label 0=Default, 1=Add label into string, >1=Add first chars into string * @param string $sep ' - '=Separator between ref and label if option 'add_label' is set - * @param string $morecss ''=Add more css on link * @return string String with URL */ - public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $save_lastsearch_value = -1, $notooltip = 0, $add_label = 0, $sep = ' - ', $morecss = '') + public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $save_lastsearch_value = -1, $notooltip = 0, $morecss = '', $add_label = 0, $sep = ' - ') { global $conf, $langs, $hookmanager; include_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index c755b92b3e4..ddf7d582fba 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -101,7 +101,7 @@ class Inventory extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax200'), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php::::0:-1:0:1', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php::::0:-1:0::1', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35), // This date is not used so disabled by default. 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), From dd9e77e764f09632147330b499b153441e47cea7 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 21 Jun 2022 17:57:00 +0200 Subject: [PATCH 04/24] NEW 21000 Added columns 'alias_name' on poject list --- htdocs/projet/list.php | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index eaf9c5022a3..eab0d8cd8be 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -91,6 +91,7 @@ $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alph $search_ref = GETPOST("search_ref", 'alpha'); $search_label = GETPOST("search_label", 'alpha'); $search_societe = GETPOST("search_societe", 'alpha'); +$search_societe_alias = GETPOST("search_societe_alias", 'alpha'); $search_status = GETPOST("search_status", 'int'); $search_opp_status = GETPOST("search_opp_status", 'alpha'); $search_opp_percent = GETPOST("search_opp_percent", 'alpha'); @@ -198,6 +199,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; // Add non object fields to fields for list $arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1)); +$arrayfields['s.name_alias'] = array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>22); $arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'position'=>23); $arrayfields['c.assigned'] = array('label'=>$langs->trans("AssignedTo"), 'checked'=>-1, 'position'=>120); $arrayfields['opp_weighted_amount'] = array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'position'=> 116, 'enabled'=>(empty($conf->global->PROJECT_USE_OPPORTUNITIES) ? 0 : 1), 'position'=>106); @@ -246,6 +248,7 @@ if (empty($reshook)) { $search_ref = ""; $search_label = ""; $search_societe = ""; + $search_societe_alias = ''; $search_status = -1; $search_opp_status = -1; $search_opp_amount = ''; @@ -447,6 +450,9 @@ if ($search_label) { if ($search_societe) { $sql .= natural_search('s.nom', $search_societe); } +if ($search_societe_alias) { + $sql .= natural_search('s.name_alias', $search_societe_alias); +} if ($search_opp_amount) { $sql .= natural_search('p.opp_amount', $search_opp_amount, 1); } @@ -687,6 +693,9 @@ if ($search_label != '') { if ($search_societe != '') { $param .= '&search_societe='.urlencode($search_societe); } +if ($search_societe_alias != '') { + $param .= '&search_societe_alias='.urlencode($search_societe_alias); +} if ($search_status >= 0) { $param .= '&search_status='.urlencode($search_status); } @@ -887,6 +896,18 @@ if (!empty($arrayfields['s.nom']['checked'])) { print ''; print ''; } + +// Alias +if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + if ($socid > 0) { + $tmpthirdparty = new Societe($db); + $tmpthirdparty->fetch($socid); + $search_societe_alias = $tmpthirdparty->name_alias; + } + print ''; + print ''; +} // Sale representative if (!empty($arrayfields['commercial']['checked'])) { print ' '; @@ -1050,6 +1071,9 @@ if (!empty($arrayfields['p.title']['checked'])) { if (!empty($arrayfields['s.nom']['checked'])) { print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder); } +if (!empty($arrayfields['s.name_alias']['checked'])) { + print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], "s.name_alias", "", $param, "", $sortfield, $sortorder); +} if (!empty($arrayfields['commercial']['checked'])) { print_liste_field_titre($arrayfields['commercial']['label'], $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder, 'tdoverflowmax100imp '); } @@ -1185,7 +1209,20 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['s.nom']['checked'])) { print ''; if ($obj->socid) { - print $companystatic->getNomUrl(1); + print $companystatic->getNomUrl(1, '', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); + } else { + print ' '; + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Alias + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + if ($obj->socid) { + print $companystatic->name_alias; } else { print ' '; } From e76b49c360ae4db85eef85453d65e9f92f0151ef Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 21 Jun 2022 18:06:58 +0200 Subject: [PATCH 05/24] NEW 21000 Added columns 'alias_name' on poject list --- htdocs/projet/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index eab0d8cd8be..1ec8245b868 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -199,7 +199,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; // Add non object fields to fields for list $arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1)); -$arrayfields['s.name_alias'] = array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>22); +$arrayfields['s.name_alias'] = array('label'=>"AliasNameShort", 'checked'=>0, 'position'=>22); $arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'position'=>23); $arrayfields['c.assigned'] = array('label'=>$langs->trans("AssignedTo"), 'checked'=>-1, 'position'=>120); $arrayfields['opp_weighted_amount'] = array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'position'=> 116, 'enabled'=>(empty($conf->global->PROJECT_USE_OPPORTUNITIES) ? 0 : 1), 'position'=>106); From 57d2a0352e5200a0733843689240f17a3b254565 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 21 Jun 2022 18:30:23 +0200 Subject: [PATCH 06/24] NEW 21000 Added columns 'alias_name' on tasks list --- htdocs/projet/tasks/list.php | 37 ++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index bfda3ad31be..f6da556e8d7 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -154,6 +154,7 @@ $arrayfields = array( 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1), 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>0), + 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1), 'p.fk_statut'=>array('label'=>"ProjectStatus", 'checked'=>1), 't.planned_workload'=>array('label'=>"PlannedWorkload", 'checked'=>1, 'position'=>102), 't.duration_effective'=>array('label'=>"TimeSpent", 'checked'=>1, 'position'=>103), @@ -326,7 +327,7 @@ if (count($listoftaskcontacttype) == 0) { $distinct = 'DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is assigned only once. $sql = "SELECT ".$distinct." p.rowid as projectid, p.ref as projectref, p.title as projecttitle, p.fk_statut as projectstatus, p.datee as projectdatee, p.fk_opp_status, p.public, p.fk_user_creat as projectusercreate, p.usage_bill_time,"; -$sql .= " s.nom as name, s.rowid as socid,"; +$sql .= " s.nom as name, s.name_alias as alias, s.rowid as socid,"; $sql .= " t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_update,"; $sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut, "; $sql .= " t.description, t.fk_task_parent"; @@ -413,6 +414,9 @@ if ($search_task_budget_amount) { if ($search_societe) { $sql .= natural_search('s.nom', $search_societe); } +if ($search_societe_alias) { + $sql .= natural_search('s.name_alias', $search_societe_alias); +} if ($search_date_start) { $sql .= " AND t.dateo >= '".$db->idate($search_date_start)."'"; } @@ -768,6 +772,11 @@ if (!empty($arrayfields['s.nom']['checked'])) { print ''; print ''; } +if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + print ''; + print ''; +} if (!empty($arrayfields['p.fk_statut']['checked'])) { print ''; $arrayofstatus = array(); @@ -890,6 +899,10 @@ if (!empty($arrayfields['s.nom']['checked'])) { print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder); $totalarray['nbfield']++; } +if (!empty($arrayfields['s.name_alias']['checked'])) { + print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], "s.name_alias", "", $param, "", $sortfield, $sortorder); + $totalarray['nbfield']++; +} if (!empty($arrayfields['p.fk_statut']['checked'])) { print_liste_field_titre($arrayfields['p.fk_statut']['label'], $_SERVER["PHP_SELF"], "p.fk_statut", "", $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; @@ -992,6 +1005,11 @@ while ($i < $imaxinloop) { $projectstatic->statut = $obj->projectstatus; $projectstatic->datee = $db->jdate($obj->projectdatee); + if ($obj->socid) { + $socstatic->id = $obj->socid; + $socstatic->name = $obj->name; + $socstatic->name_alias = $obj->alias; + } if ($mode == 'kanban') { if ($i == 0) { print ''; @@ -1101,9 +1119,20 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['s.nom']['checked'])) { print ''; if ($obj->socid) { - $socstatic->id = $obj->socid; - $socstatic->name = $obj->name; - print $socstatic->getNomUrl(1); + print $socstatic->getNomUrl(1, '', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); + } else { + print ' '; + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Alias + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + if ($obj->socid) { + print $socstatic->name_alias; } else { print ' '; } From 0adc7116a6a8a562da02ba1fad5c2feafe9877f3 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 21 Jun 2022 19:21:50 +0200 Subject: [PATCH 07/24] NEW 21000 Added columns 'alias_name' on supplier order list --- htdocs/fourn/commande/list.php | 36 ++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 22c4921b5b1..6f2669ac877 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -93,6 +93,7 @@ $search_product_category = GETPOST('search_product_category', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); $search_refsupp = GETPOST('search_refsupp', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); +$search_company_alias = GETPOST('search_company_alias', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state", 'alpha'); @@ -181,6 +182,7 @@ $checkedtypetiers = 0; // Definition of array of fields for columns $arrayfields = array( + 's.name_alias'=>array('label'=>"AliasNameShort", 'position'=>47, 'checked'=>0), 's.town'=>array('label'=>"Town", 'enabled'=>1, 'position'=>47, 'checked'=>1), 's.zip'=>array('label'=>"Zip", 'enabled'=>1, 'position'=>47, 'checked'=>1), 'state.nom'=>array('label'=>"StateShort", 'enabled'=>1, 'position'=>48), @@ -246,6 +248,7 @@ if (empty($reshook)) { $search_ref = ''; $search_refsupp = ''; $search_company = ''; + $search_company_alias = ''; $search_town = ''; $search_zip = ""; $search_state = ""; @@ -657,6 +660,9 @@ if (empty($reshook)) { if ($search_company) { $param .= '&search_company='.urlencode($search_company); } + if ($search_company_alias) { + $param .= '&search_company_alias='.urlencode($search_company_alias); + } //if ($search_ref_customer) $param .= '&search_ref_customer='.urlencode($search_ref_customer); if ($search_user > 0) { $param .= '&search_user='.urlencode($search_user); @@ -741,7 +747,7 @@ $sql = 'SELECT'; if ($sall || $search_product_category > 0) { $sql = 'SELECT DISTINCT'; } -$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.email,'; +$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.email,'; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " cf.rowid, cf.ref, cf.ref_supplier, cf.fk_statut, cf.billed, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_user_author, cf.date_commande as date_commande, cf.date_livraison as date_livraison,cf.date_valid, cf.date_approve,"; @@ -803,6 +809,9 @@ if ($sall) { if ($search_company) { $sql .= natural_search('s.nom', $search_company); } +if ($search_company_alias) { + $sql .= natural_search('s.name_alias', $search_company_alias); +} if ($search_request_author) { $sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_request_author); } @@ -861,6 +870,9 @@ if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { if ($search_company) { $sql .= natural_search('s.nom', $search_company); } +if ($search_company_alias) { + $sql .= natural_search('s.name_alias', $search_company_alias); +} if ($search_sale > 0) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } @@ -1032,6 +1044,9 @@ if ($resql) { if ($search_company) { $param .= '&search_company='.urlencode($search_company); } + if ($search_company_alias) { + $param .= '&search_company_alias='.urlencode($search_company_alias); + } if ($search_user > 0) { $param .= '&search_user='.urlencode($search_user); } @@ -1275,6 +1290,10 @@ if ($resql) { if (!empty($arrayfields['cf.fk_soc']['checked'])) { print ''; } + // Alias + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + } // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; @@ -1447,6 +1466,9 @@ if ($resql) { if (!empty($arrayfields['cf.fk_soc']['checked'])) { print_liste_field_titre($arrayfields['cf.fk_soc']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); } + if (!empty($arrayfields['s.name_alias']['checked'])) { + print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], "s.name_alias", "", $param, '', $sortfield, $sortorder); + } if (!empty($arrayfields['s.town']['checked'])) { print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); } @@ -1623,7 +1645,17 @@ if ($resql) { $thirdpartytmp->id = $obj->socid; $thirdpartytmp->name = $obj->name; $thirdpartytmp->email = $obj->email; - print $thirdpartytmp->getNomUrl(1, 'supplier'); + $thirdpartytmp->name_alias = $obj->alias; + print $thirdpartytmp->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); + print ''."\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + //alias + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + print $obj->alias; print ''."\n"; if (!$i) { $totalarray['nbfield']++; From 08ba39f70444d2e3b1992dc26039aac1606d2e6e Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 21 Jun 2022 19:25:38 +0200 Subject: [PATCH 08/24] NEW 21000 Added columns 'alias_name' on supplier order list --- htdocs/projet/tasks/list.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index f6da556e8d7..183a53783fb 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -68,6 +68,7 @@ $search_task_user = GETPOST('search_task_user', 'int'); $search_task_progress = GETPOST('search_task_progress'); $search_task_budget_amount = GETPOST('search_task_budget_amount'); $search_societe = GETPOST('search_societe'); +$search_societe_alias = GETPOST('search_societe_alias'); $search_opp_status = GETPOST("search_opp_status", 'alpha'); $mine = GETPOST('mode', 'alpha') == 'mine' ? 1 : 0; @@ -206,6 +207,8 @@ if (empty($reshook)) { $search_categ = ""; $search_projectstatus = -1; $search_project_ref = ""; + $search_societe = ""; + $search_societe_alias = ""; $search_project_title = ""; $search_task_ref = ""; $search_task_label = ""; @@ -583,6 +586,9 @@ if ($search_task_progress != '') { if ($search_societe != '') { $param .= '&search_societe='.urlencode($search_societe); } +if ($search_societe != '') { + $param .= '&search_societe_alias='.urlencode($search_societe_alias); +} if ($search_projectstatus != '') { $param .= '&search_projectstatus='.urlencode($search_projectstatus); } @@ -774,7 +780,7 @@ if (!empty($arrayfields['s.nom']['checked'])) { } if (!empty($arrayfields['s.name_alias']['checked'])) { print ''; - print ''; + print ''; print ''; } if (!empty($arrayfields['p.fk_statut']['checked'])) { From df8580dd4cdba7ed69ec658fd57b88bc2a72c161 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 21 Jun 2022 19:50:05 +0200 Subject: [PATCH 09/24] NEW 21000 Added columns 'alias_name' on supplier invoice list --- htdocs/fourn/facture/list.php | 36 ++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 70a7334196a..4df04f30f70 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -77,6 +77,7 @@ $search_refsupplier = GETPOST('search_refsupplier', 'alpha'); $search_type = GETPOST('search_type', 'int'); $search_project = GETPOST('search_project', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); +$search_company_alias = GETPOST('search_company_alias', 'alpha'); $search_montant_ht = GETPOST('search_montant_ht', 'alpha'); $search_montant_vat = GETPOST('search_montant_vat', 'alpha'); $search_montant_localtax1 = GETPOST('search_montant_localtax1', 'alpha'); @@ -178,6 +179,7 @@ $arrayfields = array( 'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1), 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>0), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1), + 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>0), 's.town'=>array('label'=>"Town", 'checked'=>-1), 's.zip'=>array('label'=>"Zip", 'checked'=>1), 'state.nom'=>array('label'=>"StateShort", 'checked'=>0), @@ -252,6 +254,7 @@ if (empty($reshook)) { $search_label = ""; $search_project = ''; $search_company = ""; + $search_company_alias = ""; $search_amount_no_tax = ""; $search_amount_all_tax = ""; $search_montant_ht = ''; @@ -413,7 +416,7 @@ $sql .= " f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,"; $sql .= ' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva as multicurrency_total_vat, f.multicurrency_total_ttc,'; $sql .= " f.note_public, f.note_private,"; $sql .= " f.fk_user_author,"; -$sql .= " s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,"; +$sql .= " s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,"; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " country.code as country_code,"; @@ -518,6 +521,9 @@ if ($search_project) { if ($search_company) { $sql .= natural_search('s.nom', $search_company); } +if ($search_company_alias) { + $sql .= natural_search('s.name_alias', $search_company_alias); +} if ($search_town) { $sql .= natural_search('s.town', $search_town); } @@ -693,6 +699,7 @@ if ($resql) { $soc->fetch($socid); if (empty($search_company)) { $search_company = $soc->name; + $search_company_alias = $soc->name_alias; } } @@ -757,6 +764,9 @@ if ($resql) { if ($search_company) { $param .= '&search_company='.urlencode($search_company); } + if ($search_company_alias) { + $param .= '&search_company_alias='.urlencode($search_company_alias); + } if ($search_login) { $param .= '&search_login='.urlencode($search_login); } @@ -1004,6 +1014,10 @@ if ($resql) { if (!empty($arrayfields['s.nom']['checked'])) { print ''; } + // Alias + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + } // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; @@ -1181,6 +1195,9 @@ if ($resql) { if (!empty($arrayfields['s.nom']['checked'])) { print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder); } + if (!empty($arrayfields['s.name_alias']['checked'])) { + print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER['PHP_SELF'], 's.name_alias', '', $param, '', $sortfield, $sortorder); + } if (!empty($arrayfields['s.town']['checked'])) { print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); } @@ -1188,7 +1205,10 @@ if ($resql) { print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder, 'center '); } if (!empty($arrayfields['state.nom']['checked'])) { - print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.name_alias", "", $param, '', $sortfield, $sortorder); + } + if (!empty($arrayfields['state.name_alias']['checked'])) { + print_liste_field_titre($arrayfields['state.name_alias']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); } if (!empty($arrayfields['country.code_iso']['checked'])) { print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); @@ -1293,6 +1313,7 @@ if ($resql) { $thirdparty->id = $obj->socid; $thirdparty->name = $obj->name; + $thirdparty->name_alias = $obj->alias; $thirdparty->client = $obj->client; $thirdparty->fournisseur = $obj->fournisseur; $thirdparty->code_client = $obj->code_client; @@ -1417,7 +1438,16 @@ if ($resql) { // Third party if (!empty($arrayfields['s.nom']['checked'])) { print ''; - print $thirdparty->getNomUrl(1, 'supplier'); + print $thirdparty->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Alias + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + print $thirdparty->name_alias; print ''; if (!$i) { $totalarray['nbfield']++; From 15abd76ef4a5e5f21d3efb7465036491b2c483e2 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 21 Jun 2022 20:04:35 +0200 Subject: [PATCH 10/24] NEW 21000 Added columns 'alias_name' on supplier propals list --- htdocs/supplier_proposal/list.php | 32 +++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 96f8a2b2cca..894c16cacf7 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -61,6 +61,7 @@ $search_user = GETPOST('search_user', 'int'); $search_sale = GETPOST('search_sale', 'int'); $search_ref = GETPOST('sf_ref') ?GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_societe = GETPOST('search_societe', 'alpha'); +$search_societe_alias = GETPOST('search_societe_alias', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); @@ -168,6 +169,7 @@ $checkedtypetiers = 0; $arrayfields = array( 'sp.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), 's.nom'=>array('label'=>$langs->trans("Supplier"), 'checked'=>1), + 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>0), 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0), @@ -224,6 +226,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_sale = ''; $search_ref = ''; $search_societe = ''; + $search_societe_alias = ''; $search_montant_ht = ''; $search_montant_vat = ''; $search_montant_ttc = ''; @@ -292,7 +295,7 @@ $sql = 'SELECT'; if ($sall || $search_product_category > 0 || $search_user > 0) { $sql = 'SELECT DISTINCT'; } -$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; +$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= ' sp.rowid, sp.note_public, sp.note_private, sp.total_ht, sp.total_tva, sp.total_ttc, sp.localtax1, sp.localtax2, sp.ref, sp.fk_statut as status, sp.fk_user_author, sp.date_valid, sp.date_livraison as dp,'; @@ -363,6 +366,9 @@ if ($search_ref) { if ($search_societe) { $sql .= natural_search('s.nom', $search_societe); } +if ($search_societe_alias) { + $sql .= natural_search('s.name_alias', $search_societe_alias); +} if ($search_login) { $sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_login); } @@ -521,6 +527,9 @@ if ($resql) { if ($search_societe) { $param .= '&search_societe='.urlencode($search_societe); } + if ($search_societe_alias) { + $param .= '&search_societe_alias='.urlencode($search_societe_alias); + } if ($search_user > 0) { $param .= '&search_user='.urlencode($search_user); } @@ -677,6 +686,11 @@ if ($resql) { print ''; print ''; } + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + print ''; + print ''; + } if (!empty($arrayfields['s.town']['checked'])) { print ''; } @@ -816,6 +830,9 @@ if ($resql) { if (!empty($arrayfields['s.nom']['checked'])) { print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder); } + if (!empty($arrayfields['s.name_alias']['checked'])) { + print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], 's.name_alias', '', $param, '', $sortfield, $sortorder); + } if (!empty($arrayfields['s.town']['checked'])) { print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); } @@ -904,6 +921,7 @@ if ($resql) { // Company $companystatic->id = $obj->socid; $companystatic->name = $obj->name; + $companystatic->name_alias = $obj->alias; $companystatic->client = $obj->client; $companystatic->code_client = $obj->code_client; @@ -942,7 +960,17 @@ if ($resql) { // Thirdparty if (!empty($arrayfields['s.nom']['checked'])) { print ''; - print $companystatic->getNomUrl(1, 'supplier'); + print $companystatic->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Alias + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + print $companystatic->name_alias; print ''; if (!$i) { $totalarray['nbfield']++; From 7856aea24d718c5f91eea7e2b3894b6129c062a6 Mon Sep 17 00:00:00 2001 From: Faustin Date: Thu, 23 Jun 2022 22:50:23 +0200 Subject: [PATCH 11/24] NEW #20650 thirdparty list : making the dropdown select appears on screen when checked boxes appears on left --- 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 88f7f7aaa9a..31d54797489 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8366,7 +8366,7 @@ class Form