getAttributes() orders attributes by attr def name

This commit is contained in:
Uwe Steinmann 2016-09-06 11:31:03 +02:00
parent f6504c2aab
commit 8fd19944a4

View File

@ -75,13 +75,13 @@ class SeedDMS_Core_Object { /* {{{ */
switch(get_class($this)) {
case "SeedDMS_Core_Document":
$queryStr = "SELECT * FROM tblDocumentAttributes WHERE document = " . $this->_id." ORDER BY `id`";
$queryStr = "SELECT a.* FROM tblDocumentAttributes a LEFT JOIN tblAttributeDefinitions b ON a.attrdef=b.id WHERE a.document = " . $this->_id." ORDER BY b.`name`";
break;
case "SeedDMS_Core_DocumentContent":
$queryStr = "SELECT * FROM tblDocumentContentAttributes WHERE content = " . $this->_id." ORDER BY `id`";
$queryStr = "SELECT a.* FROM tblDocumentContentAttributes a LEFT JOIN tblAttributeDefinitions b ON a.attrdef=b.id WHERE a.content = " . $this->_id." ORDER BY b.`name`";
break;
case "SeedDMS_Core_Folder":
$queryStr = "SELECT * FROM tblFolderAttributes WHERE folder = " . $this->_id." ORDER BY `id`";
$queryStr = "SELECT a.* FROM tblFolderAttributes a LEFT JOIN tblAttributeDefinitions b ON a.attrdef=b.id WHERE a.folder = " . $this->_id." ORDER BY b.`name`";
break;
default:
return false;