2013-07-25 Sergio Martin <sergio.martin@artica.es>

* include/functions_tags.php: Sort the tags by name for
	bug #2355



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8570 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-07-25 08:27:01 +00:00
parent b313ba8811
commit eb5d03a44d
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2013-07-25 Sergio Martin <sergio.martin@artica.es>
* include/functions_tags.php: Sort the tags by name for
bug #2355
2013-07-24 Ramon Novoa <rnovoa@artica.es> 2013-07-24 Ramon Novoa <rnovoa@artica.es>
* godmode/alerts/configure_alert_template.php: Fixed a translation that * godmode/alerts/configure_alert_template.php: Fixed a translation that

View File

@ -131,24 +131,24 @@ function tags_search_tag ($tag_name_description = false, $filter = false, $only_
$sql = 'SELECT * $sql = 'SELECT *
FROM ttag FROM ttag
WHERE ((name COLLATE utf8_general_ci LIKE "%'. $tag_name_description .'%") OR WHERE ((name COLLATE utf8_general_ci LIKE "%'. $tag_name_description .'%") OR
(description COLLATE utf8_general_ci LIKE "%'. $tag_name_description .'%"))'; (description COLLATE utf8_general_ci LIKE "%'. $tag_name_description .'%")) ORDER BY name';
break; break;
case "postgresql": case "postgresql":
$sql = 'SELECT * $sql = 'SELECT *
FROM ttag FROM ttag
WHERE ((name COLLATE utf8_general_ci LIKE \'%'. $tag_name_description .'%\') OR WHERE ((name COLLATE utf8_general_ci LIKE \'%'. $tag_name_description .'%\') OR
(description COLLATE utf8_general_ci LIKE \'%'. $tag_name_description .'%\'))'; (description COLLATE utf8_general_ci LIKE \'%'. $tag_name_description .'%\')) ORDER BY name';
break; break;
case "oracle": case "oracle":
$sql = 'SELECT * $sql = 'SELECT *
FROM ttag FROM ttag
WHERE (UPPER(name) LIKE UPPER (\'%'. $tag_name_description .'%\') OR WHERE (UPPER(name) LIKE UPPER (\'%'. $tag_name_description .'%\') OR
UPPER(dbms_lob.substr(description, 4000, 1)) LIKE UPPER (\'%'. $tag_name_description .'%\'))'; UPPER(dbms_lob.substr(description, 4000, 1)) LIKE UPPER (\'%'. $tag_name_description .'%\')) ORDER BY name';
break; break;
} }
} }
else { else {
$sql = 'SELECT * FROM ttag'; $sql = 'SELECT * FROM ttag ORDER BY name';
} }
if ($filter !== false) { if ($filter !== false) {
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
@ -550,7 +550,7 @@ function tags_get_policy_module_tags ($id_policy_module) {
* @return mixed Array with tags. * @return mixed Array with tags.
*/ */
function tags_get_all_tags ($return_url = false) { function tags_get_all_tags ($return_url = false) {
$tags = db_get_all_fields_in_table('ttag', 'name'); $tags = db_get_all_fields_in_table('ttag', 'name', '', 'name');
if ($tags === false) if ($tags === false)
return false; return false;