Fix: when sending a mail the default template used should be the first positionned template

This commit is contained in:
Laurent Dinclaux 2017-05-11 13:38:17 +11:00
parent 922fa088b4
commit 8ae05a9651

View File

@ -828,7 +828,7 @@ class FormMail extends Form
if ($active >= 0) $sql.=" AND active = ".$active;
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
if (!empty($id)) $sql.= " AND rowid=".$id;
$sql.= $db->order("lang,label","ASC");
$sql.= $db->order("position,lang,label","ASC");
//print $sql;
$resql = $db->query($sql);