class_sort.php
authorRobert Sesek <rsesek@bluestatic.org>
Wed, 25 Jun 2008 18:25:30 +0000 (14:25 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Wed, 25 Jun 2008 18:25:30 +0000 (14:25 -0400)
includes/class_sort.php

index dba22913e36689e86f6da7938c4a90cba8d28a95..8052ecdc2f2a2134a30543fe08e85be7721ca628 100644 (file)
@@ -37,7 +37,7 @@ class ListSorter
        * @var  object
        * @access       private
        */
-       var $registry;
+       var $db;
        
        /**
        * Page name
@@ -77,7 +77,7 @@ class ListSorter
        function ListSorter($page)
        {
                global $bugsys;
-               $this->registry = $bugsys;
+               $this->db = BSApp::$db;
                $this->page = $page;
                $this->process_incoming();
        }
@@ -91,13 +91,13 @@ class ListSorter
        */
        function process_incoming()
        {
-               $this->sortkey = $this->registry->in['by'];
-               if (!$this->fetch_by_text($this->registry->in['by']))
+               $this->sortkey = BSApp::$input->in['by'];
+               if (!$this->fetch_by_text(BSApp::$input->in['by']))
                {
                        $this->sortkey = (isset(bugdar::$userinfo['defaultsortkey']) ? bugdar::$userinfo['defaultsortkey'] : bugdar::$options['defaultsortkey']);
                }
                
-               $this->direction = $this->registry->in['as'];
+               $this->direction = BSApp::$input->in['as'];
                if (!in_array($this->direction, array('asc', 'desc')))
                {
                        $this->direction = (isset(bugdar::$userinfo['defaultsortas']) ? bugdar::$userinfo['defaultsortas'] : bugdar::$options['defaultsortas']);
@@ -524,7 +524,7 @@ class ListSorter
                
                if ($doPerm)
                {
-                       $fields_fetch = $bugsys->db->query("
+                       $fields_fetch = BSApp::$db->query("
                                SELECT bugfield.*, MAX(permission.mask) AS mask
                                FROM " . TABLE_PREFIX . "bugfield AS bugfield
                                LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission
@@ -536,10 +536,10 @@ class ListSorter
                }
                else
                {
-                       $fields_fetch = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield");
+                       $fields_fetch = BSApp::$db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield");
                }
                
-               while ($field = $bugsys->db->fetch_array($fields_fetch))
+               foreach ($fields_fetch as $field)
                {
                        if ($doPerm)
                        {