mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Merge branch 'ent-2929-Check-servicios-favoritos' into 'develop'
Added control for favourites filter in TreeService class See merge request artica/pandorafms!3098
This commit is contained in:
commit
1a8539fe81
@ -122,6 +122,8 @@ class TreeService extends Tree
|
|||||||
{
|
{
|
||||||
$fields = $this->getFirstLevelFields();
|
$fields = $this->getFirstLevelFields();
|
||||||
|
|
||||||
|
$is_favourite = $this->getServiceFavouriteFilter();
|
||||||
|
|
||||||
if (users_can_manage_group_all('AR')) {
|
if (users_can_manage_group_all('AR')) {
|
||||||
$groups_acl = '';
|
$groups_acl = '';
|
||||||
} else {
|
} else {
|
||||||
@ -143,13 +145,15 @@ class TreeService extends Tree
|
|||||||
ON ts.id=tse.id_service
|
ON ts.id=tse.id_service
|
||||||
WHERE
|
WHERE
|
||||||
1=1
|
1=1
|
||||||
|
%s
|
||||||
%s
|
%s
|
||||||
GROUP BY id
|
GROUP BY id
|
||||||
) as t1
|
) as t1
|
||||||
ON tss.id_service_child = t1.id
|
ON tss.id_service_child = t1.id
|
||||||
WHERE tss.id_service_child IS NULL
|
WHERE tss.id_service_child IS NULL
|
||||||
",
|
",
|
||||||
$groups_acl
|
$groups_acl,
|
||||||
|
$is_favourite
|
||||||
);
|
);
|
||||||
|
|
||||||
$stats = db_get_all_rows_sql($sql);
|
$stats = db_get_all_rows_sql($sql);
|
||||||
@ -364,4 +368,14 @@ class TreeService extends Tree
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected function getServiceFavouriteFilter()
|
||||||
|
{
|
||||||
|
if (isset($this->filter['is_favourite']) && !empty($this->filter['is_favourite'])) {
|
||||||
|
return ' AND is_favourite = 1';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user