Merge pull request #12241 from frederic34/contactphone

Contactphone
This commit is contained in:
Laurent Destailleur 2019-10-30 02:52:11 +01:00 committed by GitHub
commit 248016cd5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 31 deletions

View File

@ -1162,11 +1162,11 @@ class Contact extends CommonObject
//if ($this->civility_id) $label.= '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate cibilty_id code
if (! empty($this->poste)) $label.= '<br><b>' . $langs->trans("Poste") . ':</b> '.$this->poste;
$label.= '<br><b>' . $langs->trans("EMail") . ':</b> '.$this->email;
$phonelist=array();
if ($this->phone_pro) $phonelist[]=$this->phone_pro;
if ($this->phone_mobile) $phonelist[]=$this->phone_mobile;
if ($this->phone_perso) $phonelist[]=$this->phone_perso;
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ', $phonelist);
$phonelist = array();
if ($this->phone_pro) $phonelist[] = dol_print_phone($this->phone_pro, $this->country_code, $this->id, 0, '', '&nbsp;', 'phone');
if ($this->phone_mobile) $phonelist[] = dol_print_phone($this->phone_mobile, $this->country_code, $this->id, 0, '', '&nbsp;', 'mobile');
if ($this->phone_perso) $phonelist[] = dol_print_phone($this->phone_perso, $this->country_code, $this->id, 0, '', '&nbsp;', 'phone');
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.implode('&nbsp;', $phonelist);
$label.= '<br><b>' . $langs->trans("Address") . ':</b> '.dol_format_address($this, 1, ' ', $langs);
$url = DOL_URL_ROOT.'/contact/card.php?id='.$this->id;

View File

@ -277,7 +277,7 @@ $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("
$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, p.skype,";
$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.= " co.code as country_code";
$sql.= " co.label as country, co.code as country_code";
// Add fields from extrafields
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
@ -796,6 +796,8 @@ while ($i < min($num, $limit))
$contactstatic->phone_mobile=$obj->phone_mobile;
$contactstatic->zip=$obj->zip;
$contactstatic->town=$obj->town;
$contactstatic->country = $obj->country;
$contactstatic->country_code = $obj->country_code;
// ID
if (! empty($arrayfields['p.rowid']['checked']))

View File

@ -86,7 +86,9 @@ class box_contacts extends ModeleBoxes
$sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile, sp.email as spemail";
$sql.= ", s.nom as socname, s.name_alias, s.email as semail";
$sql.= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur";
$sql.= ", co.label as country, co.code as country_code";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON sp.fk_pays = co.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE sp.entity IN (".getEntity('socpeople').")";
@ -121,6 +123,8 @@ class box_contacts extends ModeleBoxes
$contactstatic->address = $objp->address;
$contactstatic->zip = $objp->zip;
$contactstatic->town = $objp->town;
$contactstatic->country = $objp->country;
$contactstatic->country_code = $objp->country_code;
$societestatic->id = $objp->fk_soc;
$societestatic->name = $objp->socname;

View File

@ -59,7 +59,7 @@ UPDATE llx_rights_def SET subperms = 'write' WHERE perms = 'fiscalyear' AND modu
ALTER TABLE llx_bom_bom ADD COLUMN duration double(8,4) DEFAULT NULL;
ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL DEFAULT 0;
ALTER TABLE llx_bom_bomline ADD COLUMN qty_frozen smallint DEFAULT 0;
ALTER TABLE llx_bom_bomline ADD COLUMN disable_stock_change smallint DEFAULT 0;
ALTER TABLE llx_bom_bomline ADD COLUMN disable_stock_change smallint DEFAULT 0;
ALTER TABLE llx_bom_bomline DROP COLUMN rank;
@ -357,32 +357,32 @@ create table llx_c_shipment_package_type
rowid integer AUTO_INCREMENT PRIMARY KEY,
label varchar(50) NOT NULL, -- Short name
description varchar(255), -- Description
active integer DEFAULT 1 NOT NULL, -- Active or not
entity integer DEFAULT 1 NOT NULL -- Multi company id
active integer DEFAULT 1 NOT NULL, -- Active or not
entity integer DEFAULT 1 NOT NULL -- Multi company id
)ENGINE=innodb;
CREATE TABLE llx_mrp_mo(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
entity integer DEFAULT 1 NOT NULL,
label varchar(255),
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
entity integer DEFAULT 1 NOT NULL,
label varchar(255),
qty real NOT NULL,
fk_warehouse integer,
fk_soc integer,
note_public text,
note_private text,
date_creation datetime NOT NULL,
tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
status integer NOT NULL,
fk_product integer NOT NULL,
date_start_planned datetime,
date_end_planned datetime,
fk_bom integer,
fk_warehouse integer,
fk_soc integer,
note_public text,
note_private text,
date_creation datetime NOT NULL,
tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
status integer NOT NULL,
fk_product integer NOT NULL,
date_start_planned datetime,
date_end_planned datetime,
fk_bom integer,
fk_project integer
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
@ -391,7 +391,7 @@ CREATE TABLE llx_mrp_mo(
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_ref (ref);
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_entity (entity);
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_fk_soc (fk_soc);
ALTER TABLE llx_mrp_mo ADD CONSTRAINT llx_mrp_mo_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES user(rowid);
ALTER TABLE llx_mrp_mo ADD CONSTRAINT fk_mrp_mo_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_status (status);
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_fk_product (fk_product);
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_date_start_planned (date_start_planned);
@ -400,7 +400,7 @@ ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_fk_bom (fk_bom);
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_fk_project (fk_project);
create table llx_mrp_myobject_extrafields
create table llx_mrp_mo_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
@ -408,7 +408,7 @@ create table llx_mrp_myobject_extrafields
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_mrp_myobject_extrafields ADD INDEX idx_fk_object(fk_object);
ALTER TABLE llx_mrp_mo_extrafields ADD INDEX idx_fk_object(fk_object);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_VALIDATE','BOM validated','Executed when a BOM is validated','bom',400);

View File

@ -18,7 +18,7 @@
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_ref (ref);
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_entity (entity);
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_fk_soc (fk_soc);
ALTER TABLE llx_mrp_mo ADD CONSTRAINT llx_mrp_mo_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES user(rowid);
ALTER TABLE llx_mrp_mo ADD CONSTRAINT fk_mrp_mo_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_status (status);
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_fk_product (fk_product);
ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_date_start_planned (date_start_planned);