Fix: Corrections divers sur gestion actions. On utilise le code type action pour identifier type action plutot que id

This commit is contained in:
Laurent Destailleur 2006-10-22 02:52:57 +00:00
parent 995bdcf45e
commit f924eabd62
10 changed files with 205 additions and 169 deletions

View File

@ -79,7 +79,7 @@ class ActionComm
{ {
global $langs,$conf; global $langs,$conf;
dolibarr_syslog("ActionComm.class::add datep=".strftime("%x %X",$this->datep)." datea=".$this->datea); dolibarr_syslog("ActionComm.class::add type_id=".$this->type_id." datep=".strftime("%x %X",$this->datep)." datea=".$this->datea);
if (! $this->percent) $this->percent = 0; if (! $this->percent) $this->percent = 0;
if (! $this->priority) $this->priority = 0; if (! $this->priority) $this->priority = 0;
@ -121,86 +121,96 @@ class ActionComm
} }
/** /**
* \brief Charge l'objet action depuis la base * \brief Charge l'objet action depuis la base
* \param id id de l'action a récupérer * \param id id de l'action a récupérer
*/ */
function fetch($id) function fetch($id)
{ {
global $langs; global $langs;
$sql = "SELECT ".$this->db->pdate("a.datea")." as datea,"; $sql = "SELECT a.id, ".$this->db->pdate("a.datea")." as datea,";
$sql.= " ".$this->db->pdate("a.datep")." as datep,"; $sql.= " ".$this->db->pdate("a.datep")." as datep,";
$sql.= " ".$this->db->pdate("a.datec")." as datec, tms as datem,"; $sql.= " ".$this->db->pdate("a.datec")." as datec, tms as datem,";
$sql.= " a.note, a.label, a.fk_action as type_id,"; $sql.= " a.note, a.label, a.fk_action as type_id,";
$sql.= " c.code, c.libelle, fk_soc, fk_user_author, fk_contact, fk_facture, a.percent, a.fk_commande"; $sql.= " fk_soc, fk_user_author, fk_contact, fk_facture, a.percent, a.fk_commande,";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c"; $sql.= " c.id as type_id, c.code, c.libelle";
$sql.= " WHERE a.id=".$id." AND a.fk_action=c.id"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c";
$sql.= " WHERE a.id=".$id." AND a.fk_action=c.id";
$resql=$this->db->query($sql); dolibarr_syslog("ActionComm.class::fetch sql=".$sql);
if ($resql)
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->num_rows($resql))
{
$obj = $this->db->fetch_object($resql);
$this->id = $obj->id;
$this->type_id = $obj->type_id;
$this->type_code = $obj->code;
$transcode=$langs->trans("Action".$obj->code);
$type_libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
$this->type = $type_libelle;
$this->label = $obj->label;
$this->date = $obj->datea;
$this->datep = $obj->datep;
$this->datec = $obj->datec;
$this->datem = $obj->datem;
$this->note =$obj->note;
$this->percent =$obj->percent;
$this->societe->id = $obj->fk_soc;
$this->author->id = $obj->fk_user_author;
$this->contact->id = $obj->fk_contact;
$this->fk_facture = $obj->fk_facture;
if ($this->fk_facture)
{
$this->objet_url = img_object($langs->trans("ShowBill"),'bill').' '.'<a href="'. DOL_URL_ROOT . '/compta/facture.php?facid='.$this->fk_facture.'">'.$langs->trans("Bill").'</a>';
$this->objet_url_type = 'facture';
}
$this->fk_propal = $obj->propalrowid;
if ($this->fk_propal)
{
$this->objet_url = img_object($langs->trans("ShowPropal"),'propal').' '.'<a href="'. DOL_URL_ROOT . '/propal/fiche.php?rowid='.$this->fk_propal.'">'.$langs->trans("Propal").'</a>';
$this->objet_url_type = 'propal';
}
$this->fk_commande = $obj->fk_commande;
if ($this->fk_commande)
{
$this->objet_url = img_object($langs->trans("ShowOrder"),'order').' '.'<a href="'. DOL_URL_ROOT . '/commande/fiche.php?id='.$this->fk_commande.'">'.$langs->trans("Order").'</a>';
$this->objet_url_type = 'order';
}
}
$this->db->free($resql);
return 1;
}
else
{
$this->error=$this->db->error();
return -1;
}
}
/**
* \brief Supprime l'action de la base
* \return int <0 si ko, >0 si ok
*/
function delete()
{ {
if ($this->db->num_rows($resql)) $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm";
{ $sql.= " WHERE id=".$this->id;
$obj = $this->db->fetch_object($resql);
$this->id = $id; if ($this->db->query($sql))
$this->type_id = $obj->type_id;
$this->type_code = $obj->code;
$transcode=$langs->trans("Action".$obj->code);
$type_libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
$this->type = $type_libelle;
$this->label = $obj->label;
$this->date = $obj->datea;
$this->datep = $obj->datep;
$this->datec = $obj->datec;
$this->datem = $obj->datem;
$this->note =$obj->note;
$this->percent =$obj->percent;
$this->societe->id = $obj->fk_soc;
$this->author->id = $obj->fk_user_author;
$this->contact->id = $obj->fk_contact;
$this->fk_facture = $obj->fk_facture;
if ($this->fk_facture)
{
$this->objet_url = img_object($langs->trans("ShowBill"),'bill').' '.'<a href="'. DOL_URL_ROOT . '/compta/facture.php?facid='.$this->fk_facture.'">'.$langs->trans("Bill").'</a>';
$this->objet_url_type = 'facture';
}
$this->fk_propal = $obj->propalrowid;
if ($this->fk_propal)
{
$this->objet_url = img_object($langs->trans("ShowPropal"),'propal').' '.'<a href="'. DOL_URL_ROOT . '/propal/fiche.php?rowid='.$this->fk_propal.'">'.$langs->trans("Propal").'</a>';
$this->objet_url_type = 'propal';
}
$this->fk_commande = $obj->fk_commande;
if ($this->fk_commande)
{
$this->objet_url = img_object($langs->trans("ShowOrder"),'order').' '.'<a href="'. DOL_URL_ROOT . '/commande/fiche.php?id='.$this->fk_commande.'">'.$langs->trans("Order").'</a>';
$this->objet_url_type = 'order';
}
}
$this->db->free($resql);
}
else
{
dolibarr_print_error($this->db);
}
}
/**
* \brief Supprime l'action de la base
* \param id id de l'action a effacer
* \return int 1 en cas de succès
*/
function delete($id)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm WHERE id=$id;";
if ($this->db->query($sql) )
{ {
return 1; return 1;
} }
else
{
$this->error=$this->db->error()." sql=".$sql;
return -1;
}
} }
/** /**

View File

@ -59,15 +59,16 @@ class CActioncomm {
/** /**
* \brief Charge l'objet type d'action depuis la base * \brief Charge l'objet type d'action depuis la base
* \param id id du type d'action à récupérer * \param id id ou code du type d'action à récupérer
* \return int 1=ok, 0=aucune action, -1=erreur * \return int 1=ok, 0=aucune action, -1=erreur
*/ */
function fetch($id) function fetch($id)
{ {
$sql = "SELECT code, type, libelle, active"; $sql = "SELECT id, code, type, libelle, active";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
$sql.= " WHERE id=$id"; if (is_numeric($id)) $sql.= " WHERE id=".$id;
else $sql.= " WHERE code='".$id."'";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
@ -76,7 +77,7 @@ class CActioncomm {
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $id; $this->id = $obj->id;
$this->code = $obj->code; $this->code = $obj->code;
$this->type = $obj->type; $this->type = $obj->type;
$this->libelle = $obj->libelle; $this->libelle = $obj->libelle;
@ -101,14 +102,17 @@ class CActioncomm {
/* /*
* \brief Renvoi la liste des types d'actions existant * \brief Renvoi la liste des types d'actions existant
* \param active 1 ou 0 pour un filtre sur l'etat actif ou non ('' par defaut = pas de filtre) * \param active 1 ou 0 pour un filtre sur l'etat actif ou non ('' par defaut = pas de filtre)
* \return array tableau des types d'actions actifs si ok, <0 si erreur * \return array Tableau des types d'actions actifs si ok, <0 si erreur
*/ */
function liste_array($active='') function liste_array($active='',$idorcode='id')
{ {
global $langs,$conf; global $langs,$conf;
$langs->load("commercial"); $langs->load("commercial");
$ga = array(); $repid = array();
$repcode = array();
dolibarr_syslog("CActionComm.class::liste_array active=$active idorcode=$idorcode");
$sql = "SELECT id, code, libelle, module"; $sql = "SELECT id, code, libelle, module";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
@ -137,13 +141,15 @@ class CActioncomm {
if ($qualified) if ($qualified)
{ {
$transcode=$langs->trans("Action".$obj->code); $transcode=$langs->trans("Action".$obj->code);
$ga[$obj->id] = ($transcode!="Action".$obj->code?$transcode:$obj->libelle); $repid[$obj->id] = ($transcode!="Action".$obj->code?$transcode:$obj->libelle);
$repcode[$obj->code] = ($transcode!="Action".$obj->code?$transcode:$obj->libelle);
} }
$i++; $i++;
} }
} }
$this->liste_array=$ga; if ($idorcode == 'id') $this->liste_array=$repid;
return $ga; if ($idorcode == 'code') $this->liste_array=$repcode;
return $this->liste_array;
} }
else else
{ {
@ -152,47 +158,62 @@ class CActioncomm {
} }
/* /*
* \brief Renvoie le nom sous forme d'un libellé traduit d'un type d'action * \brief Renvoie le nom sous forme d'un libellé traduit d'un type d'action
* \param id id du type d'action * \param id id ou code du type d'action
* \return string libelle du type d'action * \return string libelle du type d'action
*/ */
function get_nom($id) function get_nom($id)
{ {
global $langs; global $langs;
if (! isset($this->type_actions[$id])) if (! isset($this->type_actions[$id]))
{ {
// Si valeur non disponible en cache // Si valeur non disponible en cache
$sql = 'SELECT code, libelle'; $sql = 'SELECT id, code, libelle';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm';
$sql.= " WHERE id='".$id."'"; if (is_numeric($id)) $sql.= " WHERE id=".$id;
else $sql.= " WHERE code='".$id."'";
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
if ($this->db->num_rows($result)) if ($this->db->num_rows($result))
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
$transcode=$langs->trans("Action".$obj->code); $transcode=$langs->trans("Action".$obj->code);
$libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle); $libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
$this->type_actions[$id]=$libelle; // Met en cache $this->type_actions[$obj->id]=$libelle; // Met en cache
return $libelle; return $libelle;
} }
$this->db->free($result); $this->db->free($result);
} }
else { else {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
} }
else { else {
// Si valeur disponible en cache // Si valeur disponible en cache
return $this->type_actions[$id]; return $this->type_actions[$id];
} }
} }
/*
* \brief Renvoie le nom sous forme d'un libellé traduit d'un type d'action
* \return string Libelle du type d'action
*/
function getNom()
{
global $langs;
$transcode=$langs->trans("Action".$this->code);
$libelle=($transcode!="Action".$this->code ? $transcode : $this->get_nom($this->code));
return $libelle;
}
} }
?> ?>

View File

@ -24,7 +24,7 @@
/** /**
\file htdocs/comm/action/fiche.php \file htdocs/comm/action/fiche.php
\ingroup commercial \ingroup commercial
\brief Page de la fiche action commercial \brief Page de la fiche action
\version $Revision$ \version $Revision$
*/ */
@ -78,7 +78,7 @@ if ($_POST["action"] == 'add_action')
$contact->fetch($_POST["contactid"]); $contact->fetch($_POST["contactid"]);
} }
if (! $_POST["actionid"]) if (! $_POST["actioncode"])
{ {
$error=1; $error=1;
$_GET["action"] = 'create'; $_GET["action"] = 'create';
@ -104,18 +104,18 @@ if ($_POST["action"] == 'add_action')
$db->begin(); $db->begin();
$cactioncomm = new CActionComm($db); $cactioncomm = new CActionComm($db);
$cactioncomm->fetch($_POST["actionid"]); $cactioncomm->fetch($_POST["actioncode"]);
// Initialisation objet actioncomm // Initialisation objet actioncomm
$actioncomm = new ActionComm($db); $actioncomm = new ActionComm($db);
$actioncomm->type_id = $_POST["actionid"]; $actioncomm->type_id = $cactioncomm->id;
$actioncomm->type_code = $cactioncomm->code; $actioncomm->type_code = $cactioncomm->code;
$actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0; $actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0;
$actioncomm->label = trim($_POST["label"]); $actioncomm->label = trim($_POST["label"]);
if (! $_POST["label"]) if (! $_POST["label"])
{ {
if ($_POST["actionid"] == 5 && $contact->fullname) if ($_POST["actioncode"] == 'AC_RDV' && $contact->fullname)
{ {
$actioncomm->label = $langs->trans("TaskRDVWith",$contact->fullname); $actioncomm->label = $langs->trans("TaskRDVWith",$contact->fullname);
} }
@ -131,7 +131,7 @@ if ($_POST["action"] == 'add_action')
$actioncomm->datep = $datep; $actioncomm->datep = $datep;
$actioncomm->date = $datea; $actioncomm->date = $datea;
if ($_POST["percentage"] < 100 && ! $actioncomm->datep) $actioncomm->datep=$actioncomm->date; if ($_POST["percentage"] < 100 && ! $actioncomm->datep) $actioncomm->datep=$actioncomm->date;
if ($actioncomm->type_id == 5) if ($actioncomm->type_code == 'AC_RDV')
{ {
// RDV // RDV
if ($actioncomm->date) if ($actioncomm->date)
@ -207,10 +207,18 @@ if ($_POST["action"] == 'add_action')
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')
{ {
$actioncomm = new ActionComm($db); $actioncomm = new ActionComm($db);
$actioncomm->delete($_GET["id"]); $actioncomm->fetch($_GET["id"]);
$result=$actioncomm->delete();
Header("Location: index.php"); if ($result >= 0)
exit; {
Header("Location: index.php");
exit;
}
else
{
$mesg=$actioncomm->error;
}
} }
/* /*
@ -296,7 +304,7 @@ if ($_GET["action"] == 'create')
* Si action de type Rendez-vous * Si action de type Rendez-vous
* *
*/ */
if ($_GET["actionid"] == 5) if ($_GET["actioncode"] == 'AC_RDV')
{ {
print_titre ($langs->trans("AddActionRendezVous")); print_titre ($langs->trans("AddActionRendezVous"));
print "<br>"; print "<br>";
@ -308,7 +316,7 @@ if ($_GET["action"] == 'create')
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Type d'action // Type d'action
print '<input type="hidden" name="actionid" value="5">'; print '<input type="hidden" name="actioncode" value="AC_RDV">';
// Societe, contact // Societe, contact
print '<tr><td nowrap>'.$langs->trans("ActionOnCompany").'</td><td>'; print '<tr><td nowrap>'.$langs->trans("ActionOnCompany").'</td><td>';
@ -419,10 +427,6 @@ if ($_GET["action"] == 'create')
} }
} }
/*
*
*
*/
print_titre ($langs->trans("AddAnAction")); print_titre ($langs->trans("AddAnAction"));
print "<br>"; print "<br>";
@ -433,17 +437,17 @@ if ($_GET["action"] == 'create')
// Type d'action actifs // Type d'action actifs
print '<tr><td>'.$langs->trans("Type").'</td><td>'; print '<tr><td>'.$langs->trans("Type").'</td><td>';
if ($_GET["actionid"]) if ($_GET["actioncode"])
{ {
print '<input type="hidden" name="actionid" value="'.$_GET["actionid"].'">'."\n"; print '<input type="hidden" name="actioncode" value="'.$_GET["actioncode"].'">'."\n";
print $caction->get_nom($_GET["actionid"]); print $caction->get_nom($_GET["actioncode"]);
} }
else else
{ {
$arraylist=$caction->liste_array(1); $arraylist=$caction->liste_array(1,'code');
$arraylist[0]='&nbsp;'; $arraylist[0]='&nbsp;';
sort($arraylist); asort($arraylist);
$html->select_array("actionid", $arraylist, 0); $html->select_array("actioncode", $arraylist, 0);
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -62,7 +62,8 @@ if ($_GET["action"] == 'builddoc')
if ($action=='delete_action') if ($action=='delete_action')
{ {
$actioncomm = new ActionComm($db); $actioncomm = new ActionComm($db);
$result=$actioncomm->delete($actionid); $actioncomm->fetch($actionid);
$result=$actioncomm->delete();
} }

View File

@ -176,9 +176,9 @@ if ($result)
print '<td><a href="contact.php?type='.$type.'&socid='.$obj->idp.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;'; print '<td><a href="contact.php?type='.$type.'&socid='.$obj->idp.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;';
print "<a href=\"".$urlfiche."?socid=$obj->idp\">$obj->nom</a></td>\n"; print "<a href=\"".$urlfiche."?socid=$obj->idp\">$obj->nom</a></td>\n";
print '<td><a href="action/fiche.php?action=create&actionid=4&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->email.'</a>&nbsp;</td>'; print '<td><a href="action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->email.'</a>&nbsp;</td>';
print '<td><a href="action/fiche.php?action=create&actionid=1&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.dolibarr_print_phone($obj->phone).'</a>&nbsp;</td>'; print '<td><a href="action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.dolibarr_print_phone($obj->phone).'</a>&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -712,20 +712,20 @@ if ($socid > 0)
// Lien click to dial // Lien click to dial
if (strlen($obj->phone) && $user->clicktodial_enabled == 1) if (strlen($obj->phone) && $user->clicktodial_enabled == 1)
{ {
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&amp;socid='.$objsoc->id.'&amp;call='.$obj->phone.'">'; print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->idp.'&amp;socid='.$objsoc->id.'&amp;call='.$obj->phone.'">';
print img_phone_out("Appel émis") ; print img_phone_out("Appel émis") ;
} }
print '</td><td>'; print '</td><td>';
print '<a href="action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.dolibarr_print_phone($obj->phone).'</a>&nbsp;</td>'; print '<a href="action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.dolibarr_print_phone($obj->phone).'</a>&nbsp;</td>';
print '<td><a href="action/fiche.php?action=create&actionid=2&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.dolibarr_print_phone($obj->fax).'</a>&nbsp;</td>'; print '<td><a href="action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.dolibarr_print_phone($obj->fax).'</a>&nbsp;</td>';
print '<td><a href="action/fiche.php?action=create&actionid=4&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.$obj->email.'</a>&nbsp;</td>'; print '<td><a href="action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'.$obj->email.'</a>&nbsp;</td>';
print '<td align="center">'; print '<td align="center">';
print "<a href=\"../contact/fiche.php?action=edit&amp;id=$obj->idp\">"; print "<a href=\"../contact/fiche.php?action=edit&amp;id=$obj->idp\">";
print img_edit(); print img_edit();
print '</a></td>'; print '</a></td>';
print '<td align="center"><a href="action/fiche.php?action=create&actionid=5&contactid='.$obj->idp.'&socid='.$objsoc->id.'">'; print '<td align="center"><a href="action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->idp.'&socid='.$objsoc->id.'">';
print img_object($langs->trans("Rendez-Vous"),"action"); print img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>'; print '</a></td>';

View File

@ -285,17 +285,17 @@ if ($socid > 0)
} }
print '</td>'; print '</td>';
print '<td>'.$obj->poste.'&nbsp;</td>'; print '<td>'.$obj->poste.'&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->phone; print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->phone;
if (strlen($obj->phone) && $user->clicktodial_enabled == 1) if (strlen($obj->phone) && $user->clicktodial_enabled == 1)
{ {
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&amp;socid='.$societe->id.'&amp;call='.$obj->phone.'">'; print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->idp.'&amp;socid='.$societe->id.'&amp;call='.$obj->phone.'">';
print img_phone_out("Appel émis") ; print img_phone_out("Appel émis") ;
} }
print '</a></td>'; print '</a></td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=2&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->fax.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->fax.'</a>&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=4&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->email.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->email.'</a>&nbsp;</td>';
print '<td align="center">'; print '<td align="center">';
@ -309,7 +309,7 @@ if ($socid > 0)
print '</td>'; print '</td>';
print '<td align="center"><a href="../comm/action/fiche.php?action=create&actionid=5&contactid='.$obj->idp.'&socid='.$societe->id.'">'; print '<td align="center"><a href="../comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->idp.'&socid='.$societe->id.'">';
print img_object($langs->trans("Rendez-Vous"),"action"); print img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>'; print '</a></td>';

View File

@ -404,9 +404,9 @@ if ($socid > 0)
} }
print '</td>'; print '</td>';
print '<td>'.$obj->poste.'&nbsp;</td>'; print '<td>'.$obj->poste.'&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->phone.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->phone.'</a>&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=2&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->fax.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->fax.'</a>&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=4&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->email.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->email.'</a>&nbsp;</td>';
print '<td align="center">'; print '<td align="center">';
@ -420,7 +420,7 @@ if ($socid > 0)
print '</td>'; print '</td>';
print '<td align="center"><a href="../comm/action/fiche.php?action=create&actionid=5&contactid='.$obj->idp.'&socid='.$societe->id.'">'; print '<td align="center"><a href="../comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->idp.'&socid='.$societe->id.'">';
print img_object($langs->trans("Rendez-Vous"),"action"); print img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>'; print '</a></td>';

View File

@ -251,7 +251,7 @@ if ($result)
print '&nbsp;'; print '&nbsp;';
} }
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;actionid=1&amp;contactid='.$obj->cidp.'&amp;socid='.$obj->idp.'">'.dolibarr_print_phone($obj->phone).'</a>&nbsp;</td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;actioncode=AC_TEL&amp;contactid='.$obj->cidp.'&amp;socid='.$obj->idp.'">'.dolibarr_print_phone($obj->phone).'</a>&nbsp;</td>';
if ($_GET["view"] == 'phone') if ($_GET["view"] == 'phone')
{ {

View File

@ -340,9 +340,9 @@ if ( $societe->fetch($socid) )
} }
print "</td>"; print "</td>";
print "<td>$obj->poste&nbsp;</td>"; print "<td>$obj->poste&nbsp;</td>";
print '<td><a href="../comm/action/fiche.php?action=create&actionid=1&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->phone.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->phone.'</a>&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=2&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->fax.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->fax.'</a>&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actionid=4&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->email.'</a>&nbsp;</td>'; print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->idp.'&socid='.$societe->id.'">'.$obj->email.'</a>&nbsp;</td>';
if ($user->rights->societe->contact->creer) if ($user->rights->societe->contact->creer)
{ {