Przeglądaj źródła

Fix name into popup of member in list of subscriptions

Laurent Destailleur 4 lat temu
rodzic
commit
7bf12c8720

+ 2 - 2
htdocs/adherents/class/adherent.class.php

@@ -1988,7 +1988,7 @@ class Adherent extends CommonObject
 	 *	@param	int		$withpictoimg				0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small)
 	 *	@param	int		$maxlen						length max label
 	 *	@param	string	$option						Page for link ('card', 'category', 'subscription', ...)
-	 *	@param  string  $mode           			''=Show firstname+lastname as label (using default order), 'firstname'=Show only firstname, 'login'=Show login, 'ref'=Show ref
+	 *	@param  string  $mode           			''=Show firstname+lastname as label (using default order), 'firstname'=Show only firstname, 'lastname'=Show only lastname, 'login'=Show login, 'ref'=Show ref
 	 *	@param  string  $morecss        			Add more css on link
 	 *	@param  int		$save_lastsearch_value    	-1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
 	 *	@param	int		$notooltip					1=Disable tooltip
@@ -2072,7 +2072,7 @@ class Adherent extends CommonObject
 			} elseif ($mode == 'ref') {
 				$result .= $this->id;
 			} else {
-				$result .= $this->getFullName($langs, '', ($mode == 'firstname' ? 2 : -1), $maxlen);
+				$result .= $this->getFullName($langs, '', ($mode == 'firstname' ? 2 : ($mode == 'lastname' ? 4 : -1)), $maxlen);
 			}
 			if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= '</span>';
 		}

+ 1 - 3
htdocs/adherents/subscription/list.php

@@ -433,9 +433,7 @@ while ($i < min($num, $limit)) {
 
 	// Lastname
 	if (!empty($arrayfields['d.lastname']['checked'])) {
-		$adherent->firstname = '';
-		print '<td>'.$adherent->getNomUrl(-1).'</td>';
-		$adherent->firstname = $obj->firstname;
+		print '<td>'.$adherent->getNomUrl(-1, 0, 'card', 'lastname').'</td>';
 		if (!$i) $totalarray['nbfield']++;
 	}
 	// Firstname