Uploaded image for project: 'FreePBX'
  1. FreePBX
  2. FREEPBX-16399

Timegroups sorted by month and day

    XMLWordPrintable

    Details

    • 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

      Description

      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

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bhoeneis bhoeneis
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  NextupJiraPlusStatus

                  Error rendering 'slack.nextup.jira:nextup-jira-plus-status'. Please contact your Jira administrators.