Revision 36afc80f
Vérification des permissions pour l'auto-complétion dans les groupes d'hôtes/services.
Simplification du template principal de Vigiboard.
git-svn-id: https://vigilo-dev.si.c-s.fr/svn@1613 b22e2e97-25c9-44ff-b637-2e5ceca36478
vigiboard/controllers/root.py | ||
---|---|---|
10 | 10 |
from tg.i18n import get_lang |
11 | 11 |
from pylons.controllers.util import abort |
12 | 12 |
from sqlalchemy import not_, and_, asc |
13 |
from sqlalchemy.orm import aliased |
|
13 | 14 |
from datetime import datetime |
14 | 15 |
import math |
15 | 16 |
import urllib |
16 | 17 |
|
17 | 18 |
from vigiboard.model import DBSession |
18 | 19 |
from vigiboard.model import Event, EventHistory, CorrEvent, \ |
19 |
Host, HostGroup, \ |
|
20 |
Host, HostGroup, ServiceGroup, \
|
|
20 | 21 |
StateName, User, ServiceLowLevel |
21 | 22 |
from repoze.what.predicates import Any, not_anonymous |
22 | 23 |
from vigiboard.widgets.edit_event import edit_event_status_options |
... | ... | |
109 | 110 |
if hostgroup: |
110 | 111 |
search['hostgroup'] = hostgroup |
111 | 112 |
hostgroup = sql_escape_like(hostgroup) |
112 |
aggregates.add_filter(HostGroup.name.ilike('%%%s%%' % hostgroup)) |
|
113 |
hg_alias = aliased(HostGroup) |
|
114 |
aggregates.add_outer_join((hg_alias, hg_alias.idgroup == \ |
|
115 |
HOST_GROUP_TABLE.c.idgroup)) |
|
116 |
aggregates.add_filter(hg_alias.name.ilike('%%%s%%' % hostgroup)) |
|
113 | 117 |
|
114 | 118 |
if servicegroup: |
115 | 119 |
search['servicegroup'] = servicegroup |
116 | 120 |
servicegroup = sql_escape_like(servicegroup) |
117 |
aggregates.add_filter(ServiceGroup.name.ilike( |
|
121 |
sg_alias = aliased(ServiceGroup) |
|
122 |
aggregates.add_outer_join((sg_alias, sg_alias.idgroup == \ |
|
123 |
SERVICE_GROUP_TABLE.c.idgroup)) |
|
124 |
aggregates.add_filter(sg_alias.name.ilike( |
|
118 | 125 |
'%%%s%%' % servicegroup)) |
119 | 126 |
|
120 | 127 |
if host: |
vigiboard/controllers/vigiboardrequest.py | ||
---|---|---|
30 | 30 |
} |
31 | 31 |
|
32 | 32 |
def __init__(self, user, lang): |
33 |
|
|
34 | 33 |
""" |
35 | 34 |
Initialisation de toutes les variables nécessaires : |
36 | 35 |
- la liste des groupes de l'utilisateur, |
... | ... | |
154 | 153 |
self.req = self.req.group_by(i) |
155 | 154 |
for i in self.orderby: |
156 | 155 |
self.req = self.req.order_by(i) |
156 |
# raise ValueError, self.req.statement |
|
157 | 157 |
|
158 | 158 |
def num_rows(self): |
159 | 159 |
|
Also available in: Unified diff