瀏覽代碼

Fix bad link
Fix missing css

Laurent Destailleur 10 年之前
父節點
當前提交
85f344a23e
共有 4 個文件被更改,包括 14 次插入5 次删除
  1. 1 1
      htdocs/contact/card.php
  2. 6 0
      htdocs/contact/class/contact.class.php
  3. 3 2
      htdocs/contact/vcard.php
  4. 4 2
      htdocs/societe/index.php

+ 1 - 1
htdocs/contact/card.php

@@ -1151,7 +1151,7 @@ else
 
         print '<tr><td>';
         print $langs->trans("ExportCardToFormat").'</td><td colspan="3">';
-		print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$contact->id.'">';
+		print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$object->id.'">';
 		print img_picto($langs->trans("VCard"),'vcard.png').' ';
 		print $langs->trans("VCard");
 		print '</a>';

+ 6 - 0
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,";

+ 3 - 2
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;

+ 4 - 2
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 '<br>';
-	print '<table class="noborder" width="100%">';
+
+	print '<table class="noborder nohover" width="100%">';
 	print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>';
 	print '<tr '.$bc[0].'><td align="center" colspan="2">';
 	$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 '<tr $bc[$var]><td>'.$obj->label.'</td><td>'.$obj->nb.'</td></tr>';
+				print '<tr '.$bc[$var].'><td>'.$obj->label.'</td><td>'.$obj->nb.'</td></tr>';
 				$total+=$obj->nb;
 				$i++;
 			}