mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
Add sort on last applied template
This commit is contained in:
@@ -139,6 +139,7 @@ class User_Query implements User_QueryInterface
|
||||
* @var int
|
||||
*/
|
||||
protected $offset_start;
|
||||
protected $last_model;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -228,7 +229,7 @@ class User_Query implements User_QueryInterface
|
||||
$sql .= ' AND usr.invite=0 ';
|
||||
}
|
||||
|
||||
if (! $this->email_not_null) {
|
||||
if ($this->email_not_null) {
|
||||
$sql .= ' AND usr.usr_mail IS NOT NULL ';
|
||||
}
|
||||
|
||||
@@ -321,6 +322,10 @@ class User_Query implements User_QueryInterface
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->last_model) {
|
||||
$sql .= ' AND usr.lastModel = "' . mysql_real_escape_string($this->last_model) . '" ';
|
||||
}
|
||||
|
||||
$sql_like = array();
|
||||
|
||||
foreach ($this->like_field as $like_field => $like_value) {
|
||||
@@ -397,6 +402,13 @@ class User_Query implements User_QueryInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function last_model_is($login = null)
|
||||
{
|
||||
$this->last_model = $login instanceof \User_Adapter ? $login->get_login() : $login;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function include_phantoms($boolean = true)
|
||||
{
|
||||
$this->include_phantoms = ! ! $boolean;
|
||||
|
Reference in New Issue
Block a user