mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
Merge branch 'master' into feature-3716/Messaging_inbox_outbox_user
This commit is contained in:
@@ -15,7 +15,7 @@ class Bisverwendung_model extends DB_Model
|
||||
/**
|
||||
* Get latest (active) Verwendung of the user.
|
||||
* @param string $uid
|
||||
* @param bool $active If false, returns latest Verwendung no matter if actual or not (ignores ending/beginning date).
|
||||
* @param bool $active If false, returns latest Verwendung no matter if it is still actual.
|
||||
* @return array
|
||||
*/
|
||||
public function getLast($uid, $active = true)
|
||||
@@ -28,14 +28,14 @@ class Bisverwendung_model extends DB_Model
|
||||
mitarbeiter_uid = '. $this->escape($uid). '
|
||||
AND ( beginn <= NOW() OR beginn IS NULL )
|
||||
AND ( ende >= NOW() OR ende IS NULL )
|
||||
ORDER BY ende DESC NULLS LAST, beginn DESC NULLS LAST
|
||||
ORDER BY ende DESC NULLS FIRST, beginn DESC NULLS LAST
|
||||
';
|
||||
}
|
||||
else
|
||||
{
|
||||
$condition = '
|
||||
mitarbeiter_uid = '. $this->escape($uid). '
|
||||
ORDER BY ende DESC NULLS LAST, beginn DESC NULLS LAST
|
||||
ORDER BY ende DESC NULLS FIRST, beginn DESC NULLS LAST
|
||||
';
|
||||
}
|
||||
|
||||
|
||||
@@ -205,28 +205,12 @@ class Person_model extends DB_Model
|
||||
*/
|
||||
public function getLanguage($uid)
|
||||
{
|
||||
$language = DEFAULT_LANGUAGE;
|
||||
|
||||
$this->addSelect('public.tbl_person.sprache');
|
||||
$this->addJoin('public.tbl_benutzer', 'person_id');
|
||||
$this->addJoin('public.tbl_sprache', 'sprache');
|
||||
$this->addOrder('public.tbl_person.updateamum', 'DESC');
|
||||
$this->addOrder('public.tbl_person.insertvon', 'DESC');
|
||||
|
||||
$persons = $this->loadWhere(array('uid' => $uid));
|
||||
|
||||
if (hasData($persons))
|
||||
{
|
||||
for ($i = 0; $i < count($persons->retval); $i++)
|
||||
{
|
||||
$person = $persons->retval[$i];
|
||||
|
||||
if (!isEmptyString($person->sprache))
|
||||
{
|
||||
$language = $person->sprache;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $language;
|
||||
return $this->loadWhere(array('uid' => $uid, 'content' => true));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user