|
@ -18,29 +18,34 @@ class Event(): |
|
|
self.participants = list() |
|
|
self.participants = list() |
|
|
self.leaders = list() |
|
|
self.leaders = list() |
|
|
self.number_of_guests = 0 |
|
|
self.number_of_guests = 0 |
|
|
|
|
|
self.event_with_registration = False |
|
|
|
|
|
|
|
|
sql = f"""SELECT mem_usr_id, mem_leader, mem_count_guests, mem_approved |
|
|
|
|
|
|
|
|
if self.rol_id: |
|
|
|
|
|
# Admidio only assigns a rol id when you can register for it |
|
|
|
|
|
self.event_with_registration = True |
|
|
|
|
|
|
|
|
|
|
|
sql = f"""SELECT mem_usr_id, mem_leader, mem_count_guests, mem_approved |
|
|
FROM {self.admidio.prefix}_members |
|
|
FROM {self.admidio.prefix}_members |
|
|
WHERE mem_rol_id = {self.rol_id} |
|
|
WHERE mem_rol_id = {self.rol_id} |
|
|
AND mem_end = '9999-12-31'""" |
|
|
AND mem_end = '9999-12-31'""" |
|
|
self.__c.execute(sql) |
|
|
|
|
|
|
|
|
|
|
|
for row in self.__c.fetchall(): |
|
|
|
|
|
try: |
|
|
|
|
|
self.number_of_guests += row[2] |
|
|
|
|
|
|
|
|
|
|
|
# Distinguish between members that will attend, not |
|
|
|
|
|
# attend, or will maybe attend. |
|
|
|
|
|
if row[1] == 1: |
|
|
|
|
|
self.leaders.append( |
|
|
|
|
|
[row[3], self.admidio.getMemberFromID(row[0])]) |
|
|
|
|
|
else: |
|
|
|
|
|
self.participants.append( |
|
|
|
|
|
[row[3], self.admidio.getMemberFromID(row[0])]) |
|
|
|
|
|
|
|
|
|
|
|
except MemberNotFoundException: |
|
|
|
|
|
print( |
|
|
|
|
|
f"Member with id {row[0]} not found, group id: {self.id}") |
|
|
|
|
|
|
|
|
self.__c.execute(sql) |
|
|
|
|
|
|
|
|
|
|
|
for row in self.__c.fetchall(): |
|
|
|
|
|
try: |
|
|
|
|
|
self.number_of_guests += row[2] |
|
|
|
|
|
|
|
|
|
|
|
# Distinguish between members that will attend, not |
|
|
|
|
|
# attend, or will maybe attend. |
|
|
|
|
|
if row[1] == 1: |
|
|
|
|
|
self.leaders.append( |
|
|
|
|
|
[row[3], self.admidio.getMemberFromID(row[0])]) |
|
|
|
|
|
else: |
|
|
|
|
|
self.participants.append( |
|
|
|
|
|
[row[3], self.admidio.getMemberFromID(row[0])]) |
|
|
|
|
|
|
|
|
|
|
|
except MemberNotFoundException: |
|
|
|
|
|
print( |
|
|
|
|
|
f"Member with id {row[0]} not found, group id: {self.id}") |
|
|
|
|
|
|
|
|
def getAllMembers(self): |
|
|
def getAllMembers(self): |
|
|
"""Return leaders and members in group, combined""" |
|
|
"""Return leaders and members in group, combined""" |
|
|