From ac803f7247291a3c2c27d96e75fead86e61efa47 Mon Sep 17 00:00:00 2001 From: mbinformatique68 Date: Thu, 26 Aug 2021 14:36:12 +0200 Subject: [PATCH 1/4] NEW Added address field into contacts list --- htdocs/contact/list.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index a63a1bf7e49..dac21970a84 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -89,6 +89,7 @@ $search_categ_thirdparty = GETPOST("search_categ_thirdparty", 'int'); $search_categ_supplier = GETPOST("search_categ_supplier", 'int'); $search_status = GETPOST("search_status", 'int'); $search_type = GETPOST('search_type', 'alpha'); +$search_address = GETPOST('search_address', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_import_key = GETPOST("search_import_key", "alpha"); @@ -260,6 +261,7 @@ if (empty($reshook)) { $search_firstname = ""; $search_societe = ""; $search_town = ""; + $search_address = ""; $search_zip = ""; $search_country = ""; $search_poste = ""; @@ -353,7 +355,7 @@ if ($resql) { } $sql = "SELECT s.rowid as socid, s.nom as name,"; -$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.no_email,"; +$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email, p.no_email,"; $sql .= " p.socialnetworks, p.photo,"; $sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,"; $sql .= " st.libelle as stcomm, st.picto as stcomm_picto, p.fk_stcommcontact as stcomm_id, p.fk_prospectcontactlevel,"; @@ -485,6 +487,9 @@ if (!empty($conf->socialnetworks->enabled)) { if (strlen($search_email)) { $sql .= natural_search('p.email', $search_email); } +if (strlen($search_address)) { + $sql .= natural_search("p.address", $search_address); +} if (strlen($search_zip)) { $sql .= natural_search("p.zip", $search_zip); } @@ -594,6 +599,9 @@ if ($search_firstname != '') { if ($search_societe != '') { $param .= '&search_societe='.urlencode($search_societe); } +if ($search_address != '') { + $param .= '&search_address='.urlencode($search_address); +} if ($search_zip != '') { $param .= '&search_zip='.urlencode($search_zip); } @@ -775,6 +783,11 @@ if (!empty($arrayfields['p.poste']['checked'])) { print ''; print ''; } +if (!empty($arrayfields['p.address']['checked'])) { + print ''; + print ''; + print ''; +} if (!empty($arrayfields['p.zip']['checked'])) { print ''; print ''; @@ -923,6 +936,9 @@ if (!empty($arrayfields['p.firstname']['checked'])) { if (!empty($arrayfields['p.poste']['checked'])) { print_liste_field_titre($arrayfields['p.poste']['label'], $_SERVER["PHP_SELF"], "p.poste", $begin, $param, '', $sortfield, $sortorder); } +if (!empty($arrayfields['p.address']['checked'])) { + print_liste_field_titre($arrayfields['p.address']['label'], $_SERVER["PHP_SELF"], "p.address", $begin, $param, '', $sortfield, $sortorder); +} if (!empty($arrayfields['p.zip']['checked'])) { print_liste_field_titre($arrayfields['p.zip']['label'], $_SERVER["PHP_SELF"], "p.zip", $begin, $param, '', $sortfield, $sortorder); } @@ -1016,6 +1032,7 @@ while ($i < min($num, $limit)) { $contactstatic->phone_pro = $obj->phone_pro; $contactstatic->phone_perso = $obj->phone_perso; $contactstatic->phone_mobile = $obj->phone_mobile; + $contactstatic->address = $obj->address; $contactstatic->zip = $obj->zip; $contactstatic->town = $obj->town; $contactstatic->socialnetworks = $arraysocialnetworks; @@ -1059,6 +1076,13 @@ while ($i < min($num, $limit)) { $totalarray['nbfield']++; } } + // Address + if (!empty($arrayfields['p.address']['checked'])) { + print ''.$obj->address.''; + if (!$i) { + $totalarray['nbfield']++; + } + } // Zip if (!empty($arrayfields['p.zip']['checked'])) { print ''.$obj->zip.''; From 9752501ef606326fc605fd02dec1726544729ff2 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Fri, 27 Aug 2021 15:32:53 +0200 Subject: [PATCH 2/4] change links for thirdparty to target the type customer|supplier tab --- htdocs/commande/card.php | 4 ++-- htdocs/contrat/card.php | 4 ++-- htdocs/fourn/commande/card.php | 6 +++--- htdocs/fourn/facture/card.php | 4 ++-- htdocs/supplier_proposal/card.php | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 004b5a3c205..58a8edb67e7 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1568,7 +1568,7 @@ if ($action == 'create' && $usercancreate) { print ''.$langs->trans('Customer').''; if ($socid > 0) { print ''; - print $soc->getNomUrl(1); + print $soc->getNomUrl(1, 'customer'); print ''; print ''; } else { @@ -2014,7 +2014,7 @@ if ($action == 'create' && $usercancreate) { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 470895a2c22..d07176d1670 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1089,7 +1089,7 @@ if ($action == 'create') { print ''.$langs->trans('ThirdParty').''; if ($socid > 0) { print ''; - print $soc->getNomUrl(1); + print $soc->getNomUrl(1, 'customer'); print ''; print ''; } else { @@ -1296,7 +1296,7 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 6ea356e189e..71268635ffb 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1617,7 +1617,7 @@ if ($action == 'create') { print ''; if ($societe->id > 0) { - print $societe->getNomUrl(1); + print $societe->getNomUrl(1, 'supplier'); print ''; } else { print img_picto('', 'company').$form->select_company((empty($socid) ? '' : $socid), 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); @@ -1743,7 +1743,7 @@ if ($action == 'create') { print ''; $newclassname = $classname; - print ''.$langs->trans($newclassname).''.$objectsrc->getNomUrl(1).''; + print ''.$langs->trans($newclassname).''.$objectsrc->getNomUrl(1, 'supplier').''; print ''.$langs->trans('AmountHT').''.price($objectsrc->total_ht).''; print ''.$langs->trans('AmountVAT').''.price($objectsrc->total_tva).""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { // Localtax1 RE @@ -1966,7 +1966,7 @@ if ($action == 'create') { if (!empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && $object->statut == CommandeFournisseur::STATUS_DRAFT) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty')).''; } - $morehtmlref .= ' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= ' : '.$object->thirdparty->getNomUrl(1, 'supplier'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ae0d306b2cd..7f24223f912 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1927,7 +1927,7 @@ if ($action == 'create') { if ($societe->id > 0) { $absolute_discount = $societe->getAvailableDiscounts('', '', 0, 1); - print $societe->getNomUrl(1); + print $societe->getNomUrl(1, 'supplier'); print ''; } else { print img_picto('', 'company').$form->select_company($societe->id, 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 widthcentpercentminusxx'); @@ -2629,7 +2629,7 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'supplier'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index cc553555b5b..75cd0e9ccc0 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1126,7 +1126,7 @@ if ($action == 'create') { print ''.$langs->trans('Supplier').''; if ($socid > 0) { print ''; - print $soc->getNomUrl(1); + print $soc->getNomUrl(1, 'supplier'); print ''; print ''; } else { @@ -1437,7 +1437,7 @@ if ($action == 'create') { //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreateorder, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreateorder, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'supplier'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } From 6b8f6acf32d76427b606200b2a52a6553d07acf5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Aug 2021 15:26:06 +0200 Subject: [PATCH 3/4] Update card.php --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d07176d1670..232d5e0798b 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1089,7 +1089,7 @@ if ($action == 'create') { print ''.$langs->trans('ThirdParty').''; if ($socid > 0) { print ''; - print $soc->getNomUrl(1, 'customer'); + print $soc->getNomUrl(1); print ''; print ''; } else { From fae0b3c8bec15fe415561005ae7b98d2d98e8629 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Aug 2021 15:26:36 +0200 Subject: [PATCH 4/4] Update card.php --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 232d5e0798b..470895a2c22 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1296,7 +1296,7 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; }