diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 77c3b7a318c..a45437b3a39 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1151,7 +1151,7 @@ else print ''; print $langs->trans("ExportCardToFormat").''; - print ''; + print ''; print img_picto($langs->trans("VCard"),'vcard.png').' '; print $langs->trans("VCard"); print ''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 0d9f4116026..ade96390a76 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -519,6 +519,12 @@ class Contact extends CommonObject dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); global $langs; + if (empty($id) && empty($ref_ext)) + { + $this->error='BadParameter'; + return -1; + } + $langs->load("companies"); $sql = "SELECT c.rowid, c.fk_soc, c.ref_ext, c.civility as civility_id, c.lastname, c.firstname,"; diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 5d71ba88f26..e695fad0572 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -36,11 +36,12 @@ $id = GETPOST('id', 'int'); // Security check $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); + $result=$contact->fetch($id); -if (! $result) +if ($result <= 0) { dol_print_error($contact->error); - exit; + exit; } $physicalperson=1; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index efc669ddd78..d8723ceabcf 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -181,8 +181,10 @@ if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHS { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $elementtype = 'societe'; + print '
'; - print ''; + + print '
'; print ''; print ''; + print ''; $total+=$obj->nb; $i++; }
'.$langs->trans("Categories").'
'; $sql = "SELECT c.label, count(*) as nb"; @@ -226,7 +228,7 @@ if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHS { $obj = $db->fetch_object($result); $var=!$var; - print '
'.$obj->label.''.$obj->nb.'
'.$obj->label.''.$obj->nb.'