Merge pull request #6831 from Gecka-Apps/5.0-fixes

Fix: when sending a mail the default template used should be the first positioned template
This commit is contained in:
Laurent Destailleur 2017-05-13 19:35:58 +02:00 committed by GitHub
commit e0abba5cf2

View File

@ -848,7 +848,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);