FIX: Fix the prospecting level colomn on contact list by normalize the field namein the table with the name defined in the fields list of the contact class
This commit is contained in:
parent
ff16d74bd2
commit
60eb3340d1
@ -339,9 +339,9 @@ class Contact extends CommonObject
|
||||
$this->fields['fk_soc']['searchall'] = 0;
|
||||
}
|
||||
|
||||
if (empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { // Default behaviour
|
||||
$this->field['fk_stcommcontact']['enabled'] = 0;
|
||||
$this->field['fk_prospectcontactlevel']['enabled'] = 0;
|
||||
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { // Default behaviour
|
||||
$this->fields['fk_stcommcontact']['enabled'] = 0;
|
||||
$this->fields['fk_prospectlevel']['enabled'] = 0;
|
||||
}
|
||||
|
||||
// Unset fields that are disabled
|
||||
@ -588,7 +588,7 @@ class Contact extends CommonObject
|
||||
$sql .= ", phone_perso = ".(isset($this->phone_perso) ? "'".$this->db->escape($this->phone_perso)."'" : "NULL");
|
||||
$sql .= ", phone_mobile = ".(isset($this->phone_mobile) ? "'".$this->db->escape($this->phone_mobile)."'" : "NULL");
|
||||
$sql .= ", priv = '".$this->db->escape($this->priv)."'";
|
||||
$sql .= ", fk_prospectcontactlevel = '".$this->db->escape($this->fk_prospectlevel)."'";
|
||||
$sql .= ", fk_prospectlevel = '".$this->db->escape($this->fk_prospectlevel)."'";
|
||||
if (isset($this->stcomm_id)) {
|
||||
$sql .= ", fk_stcommcontact = ".($this->stcomm_id > 0 || $this->stcomm_id == -1 ? $this->stcomm_id : "0");
|
||||
}
|
||||
@ -967,7 +967,7 @@ class Contact extends CommonObject
|
||||
$sql .= " c.socialnetworks,";
|
||||
$sql .= " c.photo,";
|
||||
$sql .= " c.priv, c.note_private, c.note_public, c.default_lang, c.canvas,";
|
||||
$sql .= " c.fk_prospectcontactlevel, c.fk_stcommcontact, st.libelle as stcomm, st.picto as stcomm_picto,";
|
||||
$sql .= " c.fk_prospectlevel, c.fk_stcommcontact, st.libelle as stcomm, st.picto as stcomm_picto,";
|
||||
$sql .= " c.import_key,";
|
||||
$sql .= " c.datec as date_creation, c.tms as date_modification,";
|
||||
$sql .= " co.label as country, co.code as country_code,";
|
||||
@ -1034,7 +1034,7 @@ class Contact extends CommonObject
|
||||
$this->poste = $obj->poste;
|
||||
$this->statut = $obj->statut;
|
||||
|
||||
$this->fk_prospectlevel = $obj->fk_prospectcontactlevel;
|
||||
$this->fk_prospectlevel = $obj->fk_prospectlevel;
|
||||
|
||||
$transcode = $langs->trans('StatusProspect'.$obj->fk_stcommcontact);
|
||||
$libelle = ($transcode != 'StatusProspect'.$obj->fk_stcommcontact ? $transcode : $obj->stcomm);
|
||||
|
||||
@ -369,7 +369,7 @@ $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,";
|
||||
$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,";
|
||||
$sql .= " st.libelle as stcomm, st.picto as stcomm_picto, p.fk_stcommcontact as stcomm_id, p.fk_prospectlevel,";
|
||||
$sql .= " co.label as country, co.code as country_code";
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
@ -411,7 +411,7 @@ if (!empty($userid)) { // propre au commercial
|
||||
$sql .= " AND p.fk_user_creat=".((int) $userid);
|
||||
}
|
||||
if ($search_level) {
|
||||
$sql .= natural_search("p.fk_prospectcontactlevel", join(',', $search_level), 3);
|
||||
$sql .= natural_search("p.fk_prospectlevel", join(',', $search_level), 3);
|
||||
}
|
||||
if ($search_stcomm != '' && $search_stcomm != -2) {
|
||||
$sql .= natural_search("p.fk_stcommcontact", $search_stcomm, 2);
|
||||
@ -877,7 +877,7 @@ if (!empty($arrayfields['p.priv']['checked'])) {
|
||||
print '</td>';
|
||||
}
|
||||
// Prospect level
|
||||
if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) {
|
||||
if (!empty($arrayfields['p.fk_prospectlevel']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->multiselectarray('search_level', $tab_level, $search_level, 0, 0, 'width75', 0, 0, '', '', '', 2);
|
||||
print '</td>';
|
||||
@ -987,8 +987,8 @@ if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
if (!empty($arrayfields['p.priv']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['p.fk_prospectcontactlevel']['label'], $_SERVER["PHP_SELF"], "p.fk_prospectcontactlevel", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['p.fk_prospectlevel']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['p.fk_prospectlevel']['label'], $_SERVER["PHP_SELF"], "p.fk_prospectlevel", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['p.fk_stcommcontact']['label'], $_SERVER["PHP_SELF"], "p.fk_stcommcontact", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
@ -1042,9 +1042,9 @@ while ($i < min($num, $limit)) {
|
||||
$contactstatic->country_code = $obj->country_code;
|
||||
$contactstatic->photo = $obj->photo;
|
||||
|
||||
$contactstatic->fk_prospectlevel = $obj->fk_prospectcontactlevel;
|
||||
$contactstatic->fk_prospectlevel = $obj->fk_prospectlevel;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr class="oddeven" id="rowid-' . $obj->rowid . '">';
|
||||
|
||||
// ID
|
||||
if (!empty($arrayfields['p.rowid']['checked'])) {
|
||||
@ -1196,7 +1196,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) {
|
||||
if (!empty($arrayfields['p.fk_prospectlevel']['checked'])) {
|
||||
// Prospect level
|
||||
print '<td class="center">';
|
||||
print $contactstatic->getLibProspLevel();
|
||||
|
||||
@ -655,3 +655,6 @@ ALTER TABLE llx_c_socialnetworks DROP INDEX idx_c_socialnetworks_code;
|
||||
ALTER TABLE llx_c_socialnetworks ADD UNIQUE INDEX idx_c_socialnetworks_code_entity (code, entity);
|
||||
|
||||
ALTER TABLE llx_propaldet ADD COLUMN import_key varchar(14);
|
||||
|
||||
-- Rename prospect level on contact
|
||||
ALTER TABLE llx_socpeople CHANGE fk_prospectcontactlevel fk_prospectlevel varchar(12);
|
||||
|
||||
@ -58,7 +58,7 @@ create table llx_socpeople
|
||||
photo varchar(255),
|
||||
no_email smallint NOT NULL DEFAULT 0, -- deprecated. Use table llx_mailing_unsubscribe instead
|
||||
priv smallint NOT NULL DEFAULT 0,
|
||||
fk_prospectcontactlevel varchar(12), -- prospect level (in llx_c_prospectcontactlevel)
|
||||
fk_prospectlevel varchar(12), -- prospect level (in llx_c_prospectcontactlevel)
|
||||
fk_stcommcontact integer DEFAULT 0 NOT NULL, -- commercial statut
|
||||
fk_user_creat integer DEFAULT 0, -- user qui a creel'enregistrement
|
||||
fk_user_modif integer,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user