Skip to content

Commit

Permalink
Fix: missing contactid and socid
Browse files Browse the repository at this point in the history
Fix: missing contact in event if no company
  • Loading branch information
hregis committed Mar 22, 2011
1 parent 609d01d commit 745acdf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion htdocs/comm/action/fiche.php
Expand Up @@ -573,7 +573,7 @@ function setdatefields()
print '</td></tr>';

// If company is forced, we propose contacts (may be contact is also forced)
if (GETPOST("socid") > 0)
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);
Expand Down
13 changes: 6 additions & 7 deletions htdocs/contact/index.php
Expand Up @@ -136,19 +136,19 @@

if ($search_nom) // filtre sur le nom
{
$sql .= " AND p.name like '%".addslashes($search_nom)."%'";
$sql .= " AND p.name like '%".$db->escape($search_nom)."%'";
}
if ($search_prenom) // filtre sur le prenom
{
$sql .= " AND p.firstname like '%".addslashes($search_prenom)."%'";
$sql .= " AND p.firstname like '%".$db->escape($search_prenom)."%'";
}
if ($search_societe) // filtre sur la societe
{
$sql .= " AND s.nom like '%".addslashes($search_societe)."%'";
$sql .= " AND s.nom like '%".$db->escape($search_societe)."%'";
}
if ($search_email) // filtre sur l'email
{
$sql .= " AND p.email like '%".addslashes($search_email)."%'";
$sql .= " AND p.email like '%".$db->escape($search_email)."%'";
}
if ($type == "o") // filtre sur type
{
Expand All @@ -168,7 +168,7 @@
}
if ($sall)
{
$sql .= " AND (p.name like '%".addslashes($sall)."%' OR p.firstname like '%".addslashes($sall)."%' OR p.email like '%".addslashes($sall)."%') ";
$sql .= " AND (p.name like '%".$db->escape($sall)."%' OR p.firstname like '%".$db->escape($sall)."%' OR p.email like '%".$db->escape($sall)."%') ";
}
if ($socid)
{
Expand Down Expand Up @@ -339,8 +339,7 @@

// Links Add action and Export vcard
print '<td align="right">';
$link='<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;backtopage=1&amp;contactid='.$cid.'&amp;socid='.$socid.'">'.img_object($langs->trans("AddAction"),"calendar").'</a>';
print $link;
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;backtopage=1&amp;contactid='.$obj->cidp.'&amp;socid='.$obj->socid.'">'.img_object($langs->trans("AddAction"),"calendar").'</a>';
print ' &nbsp; ';
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$obj->cidp.'">';
print img_picto($langs->trans("VCard"),'vcard.png').' ';
Expand Down

0 comments on commit 745acdf

Please sign in to comment.