-
Type:
Improvement
-
Status: Closed
-
Priority:
Minor
-
Resolution: Won't Do
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Time Groups
-
Labels:None
-
ToDo:
-
Asterisk Version:any
-
Distro Version:any
-
Distro:FreePBX Distro
When editing timegroups it would be handy if those are sorted by month of the year and day of the month. This should be easy to achieve, if the SELECT statement that fetches the time groups contains some specific 'ORDER BY's. I made the following fast hack, which accomplished the goal of sorting:
{noformat}SELECT *
FROM timegroups_details
ORDER BY
STR_TO_DATE(LEFT(SUBSTRING_INDEX(SUBSTRING_INDEX(time,char(124),-2),char(124),-1),3), '%b'),
STR_TO_DATE(SUBSTRING_INDEX(SUBSTRING_INDEX(time,char(124),-2),char(124),1), '%e')
;{noformat}
IMHO if the following lines are enhanced with the ORDER_BY statements above the sorting should work:
- /var/www/html/admin/modules/timeconditions/functions.inc.php:
$sql = "SELECT id, time FROM timegroups_details WHERE timegroupid = $timegroup"; - /var/www/html/admin/modules/timeconditions/install.php:
$sql = "select id, time from timegroups_details where timegroupid = $timegroup";
Best,
Bernie