Fix: delete deprecated code
Fix: change select_contact for view exclude contcat in grey mode
This commit is contained in:
parent
fdffc4758c
commit
827eed5d39
@ -571,7 +571,7 @@ if ($action == 'create')
|
||||
if (GETPOST("contactid") > 0 || GETPOST("socid") > 0)
|
||||
{
|
||||
print '<tr><td nowrap>'.$langs->trans("ActionOnContact").'</td><td>';
|
||||
$html->select_contacts(GETPOST("socid"),GETPOST('contactid'),'contactid',1,1);
|
||||
$html->select_contacts(GETPOST("socid"),GETPOST('contactid'),'contactid',1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -284,8 +284,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
print '<td colspan="1">';
|
||||
//$contactAlreadySelected = $propal->getListContactId('external'); // On ne doit pas desactiver un contact deja selectionner car on doit pouvoir le seclectionner une deuxieme fois pour un autre type
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid', 0, $contactAlreadySelected);
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid');
|
||||
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -281,8 +281,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
print '<td colspan="1">';
|
||||
// $contactAlreadySelected = $commande->getListContactId('external'); // On ne doit pas desactiver un contact deja selectionne car on doit pouvoir le selectionner une deuxieme fois pour un autre type
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid', 0, $contactAlreadySelected);
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid');
|
||||
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -1164,6 +1164,9 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
$remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0));
|
||||
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
||||
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
|
||||
|
||||
// Object source contacts list
|
||||
$srccontactslist = $objectsrc->liste_contact(-1,'external',1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1207,7 +1210,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
* Contact de la commande
|
||||
*/
|
||||
print "<tr><td>".$langs->trans("DefaultContact").'</td><td>';
|
||||
$html->select_contacts($soc->id,$setcontact,'contactidp',1);
|
||||
$html->select_contacts($soc->id,$setcontact,'contactidp',1,$srccontactslist);
|
||||
print '</td></tr>';
|
||||
|
||||
// Ligne info remises tiers
|
||||
|
||||
@ -276,8 +276,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
//$contactAlreadySelected = $facture->getListContactId('external'); // On ne doit pas desactiver un contact deja selectionne car on doit pouvoir le seclectionner une deuxieme fois pour un autre type
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid', 0, $contactAlreadySelected);
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid');
|
||||
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -279,8 +279,7 @@ if ($id > 0)
|
||||
print '</td>';
|
||||
|
||||
print '<td colspan="1">';
|
||||
//$contactAlreadySelected = $contrat->getListContactId('external'); // On ne doit pas desactiver un contact deja selectionner car on doit pouvoir le seclectionner une deuxieme fois pour un autre type
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid', 0, $contactAlreadySelected);
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid');
|
||||
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -261,12 +261,13 @@ class CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get array of all contacts for an object
|
||||
* \param statut Status of lines to get (-1=all)
|
||||
* \param source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
|
||||
* \return array Array of id of contacts
|
||||
* Get array of all contacts for an object
|
||||
* @param statut Status of lines to get (-1=all)
|
||||
* @param source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
|
||||
* @param list 0:all, 1:just id
|
||||
* @return array Array of contacts
|
||||
*/
|
||||
function liste_contact($statut=-1,$source='external')
|
||||
function liste_contact($statut=-1,$source='external',$list=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -300,12 +301,21 @@ class CommonObject
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$transkey="TypeContact_".$obj->element."_".$obj->source."_".$obj->code;
|
||||
$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
|
||||
$tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,'nom'=>$obj->nom, 'firstname'=>$obj->firstname,
|
||||
'rowid'=>$obj->rowid,'code'=>$obj->code,'libelle'=>$libelle_type,'status'=>$obj->statut);
|
||||
if (! $list)
|
||||
{
|
||||
$transkey="TypeContact_".$obj->element."_".$obj->source."_".$obj->code;
|
||||
$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
|
||||
$tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,'nom'=>$obj->nom, 'firstname'=>$obj->firstname,
|
||||
'rowid'=>$obj->rowid,'code'=>$obj->code,'libelle'=>$libelle_type,'status'=>$obj->statut);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tab[$i]=$obj->id;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $tab;
|
||||
}
|
||||
else
|
||||
|
||||
@ -680,18 +680,11 @@ class Form
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
// Permettre l'exclusion de contacts
|
||||
if (is_array($exclude))
|
||||
{
|
||||
$excludeContacts = implode("','",$exclude);
|
||||
}
|
||||
|
||||
// On recherche les societes
|
||||
$sql = "SELECT s.rowid, s.name, s.firstname, s.poste FROM";
|
||||
$sql.= " ".MAIN_DB_PREFIX ."socpeople as s";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND fk_soc=".$socid;
|
||||
if (is_array($exclude) && $excludeContacts) $sql.= " AND s.rowid NOT IN ('".$excludeContacts."')";
|
||||
$sql.= " ORDER BY s.name ASC";
|
||||
|
||||
dol_syslog("Form::select_contacts sql=".$sql);
|
||||
@ -721,6 +714,7 @@ class Form
|
||||
if ($htmlname != 'none')
|
||||
{
|
||||
$disabled=0;
|
||||
if (is_array($exclude) && sizeof($exclude) && in_array($obj->rowid,$exclude)) $disabled=1;
|
||||
if (is_array($limitto) && sizeof($limitto) && ! in_array($obj->rowid,$limitto)) $disabled=1;
|
||||
if ($selected && $selected == $obj->rowid)
|
||||
{
|
||||
|
||||
@ -266,8 +266,7 @@ if ($id > 0)
|
||||
print '</td>';
|
||||
|
||||
print '<td colspan="1">';
|
||||
//$contactAlreadySelected = $fichinter->getListContactId('external'); // On ne doit pas desactiver un contact deja selectionner car on doit pouvoir le seclectionner une deuxieme fois pour un autre type
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid', 0, $contactAlreadySelected);
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid');
|
||||
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -273,8 +273,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
print '<td colspan="1">';
|
||||
// $contactAlreadySelected = $commande->getListContactId('external'); // On ne doit pas desactiver un contact deja selectionner car on doit pouvoir le seclectionner une deuxieme fois pour un autre type
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid', 0, $contactAlreadySelected);
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid');
|
||||
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -266,8 +266,7 @@ if ($id > 0)
|
||||
print '</td>';
|
||||
|
||||
print '<td colspan="1">';
|
||||
//$contactAlreadySelected = $facture->getListContactId('external'); // On ne doit pas desactiver un contact deja selectionner car on doit pouvoir le seclectionner une deuxieme fois pour un autre type
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid', 0, $contactAlreadySelected);
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid');
|
||||
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -296,7 +296,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
print '<td colspan="1">';
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid', 0);
|
||||
$nbofcontacts=$html->select_contacts($selectedCompany, '', 'contactid');
|
||||
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user