Uses S::user()->login() instead of S::v('forlife') in all calls to PlUpload.
[platal.git] / include / userset.inc.php
index 7efd5c1..21d5b0b 100644 (file)
@@ -19,7 +19,6 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require_once('xorg.misc.inc.php');
 require_once('user.func.inc.php');
 
 global $globals;
@@ -64,8 +63,7 @@ class SearchSet extends UserSet
 
     public function __construct($quick = false, $no_search = false, $join = '', $where = '')
     {
-        require_once dirname(__FILE__).'/../modules/search/search.inc.php';
-
+        Platal::load('search', 'search.inc.php');
         if ($no_search) {
             return;
         }
@@ -80,7 +78,7 @@ class SearchSet extends UserSet
 
     private function getQuick($join, $where)
     {
-        require_once dirname(__FILE__).'/../modules/search/search.inc.php';
+        Platal::load('search', 'search.inc.php');
         global $globals;
         if (!S::logged()) {
             Env::kill('with_soundex');
@@ -139,7 +137,7 @@ class ArraySet extends UserSet
     {
         $where = $this->getUids($users);
         if ($where) {
-            $where = "a.alias IN ($where)";
+            $where = "u.hruid IN ($where)";
         } else {
             $where = " 0 ";
         }
@@ -148,7 +146,7 @@ class ArraySet extends UserSet
 
     private function getUids(array $users)
     {
-        $users = get_users_forlife_list($users, true, '_silent_user_callback');
+        $users = User::getBulkHruid($users, array('User', '_silent_user_callback'));
         if (is_null($users)) {
             return '';
         }
@@ -210,6 +208,23 @@ class MinificheView extends MultipageView
                  : "");
     }
 
+    public function bounds()
+    {
+        $order = Env::v('order', $this->defaultkey);
+        $show_bounds = 0;
+        if (($order == "name") || ($order == "-name")) {
+            $this->bound_field = "nom";
+            $show_bounds = 1;
+        } elseif (($order == "promo") || ($order == "-promo")) {
+            $this->bound_field = "promo";
+            $show_bounds = -1;
+        }
+        if ($order{0} == '-') {
+            $show_bounds = -$show_bounds;
+        }
+        return $show_bounds;
+    }
+
     public function templateName()
     {
         return 'include/plview.minifiche.tpl';
@@ -235,6 +250,23 @@ class MentorView extends MultipageView
                 ms.secteur, ms.ss_secteur";
     }
 
+    public function bounds()
+    {
+        $order = Env::v('order', $this->defaultkey);
+        $show_bounds = 0;
+        if (($order == "name") || ($order == "-name")) {
+            $this->bound_field = "nom";
+            $show_bounds = 1;
+        } elseif (($order == "promo") || ($order == "-promo")) {
+            $this->bound_field = "promo";
+            $show_bounds = -1;
+        }
+        if ($order{0} == '-') {
+            $show_bounds = -$show_bounds;
+        }
+        return $show_bounds;
+    }
+
     public function templateName()
     {
         return 'include/plview.referent.tpl';
@@ -265,6 +297,23 @@ class TrombiView extends MultipageView
         return "INNER JOIN  photo AS p ON (p.uid = u.user_id) ";
     }
 
+    public function bounds()
+    {
+        $order = Env::v('order', $this->defaultkey);
+        $show_bounds = 0;
+        if (($order == "name") || ($order == "-name")) {
+            $this->bound_field = "nom";
+            $show_bounds = 1;
+        } elseif (($order == "promo") || ($order == "-promo")) {
+            $this->bound_field = "promo";
+            $show_bounds = -1;
+        }
+        if ($order{0} == '-') {
+            $show_bounds = -$show_bounds;
+        }
+        return $show_bounds;
+    }
+
     public function templateName()
     {
         return 'include/plview.trombi.tpl';