Add support for restriction on mailing participants
This commit is contained in:
parent
86350939a0
commit
d9f26f6099
|
@ -250,7 +250,7 @@ class ConfigDirectory(Directory):
|
||||||
|
|
||||||
def logo(self):
|
def logo(self):
|
||||||
if not quota.can_logo():
|
if not quota.can_logo():
|
||||||
raise errors.NotAvailableFeature()
|
raise quota.NotAvailableFeature()
|
||||||
|
|
||||||
form = Form(enctype='multipart/form-data', use_tokens=False)
|
form = Form(enctype='multipart/form-data', use_tokens=False)
|
||||||
form.add(FileWidget, 'file', title = _('Theme'), required=True)
|
form.add(FileWidget, 'file', title = _('Theme'), required=True)
|
||||||
|
|
|
@ -46,6 +46,8 @@ from wcs.admin.fields import FieldWidget, FieldDefPage, FieldsDirectory
|
||||||
from participanttokens import ParticipantToken
|
from participanttokens import ParticipantToken
|
||||||
from boresults import FormResultDirectory
|
from boresults import FormResultDirectory
|
||||||
|
|
||||||
|
import quota
|
||||||
|
|
||||||
access_mode_labels = {
|
access_mode_labels = {
|
||||||
'disabled': N_('Disabled'),
|
'disabled': N_('Disabled'),
|
||||||
'public': N_('Public'),
|
'public': N_('Public'),
|
||||||
|
@ -467,7 +469,8 @@ class DiffusionDirectory(Directory):
|
||||||
'<li><a href="import-disabled" rel="popup">%s</a></li>' % _(
|
'<li><a href="import-disabled" rel="popup">%s</a></li>' % _(
|
||||||
'Import list of participants to disable')
|
'Import list of participants to disable')
|
||||||
'<li><a href="mail-access-codes">%s</a></li>' % _('Mail access codes')
|
'<li><a href="mail-access-codes">%s</a></li>' % _('Mail access codes')
|
||||||
'<li><a href="mail-participants">%s</a></li>' % _('Mail participants')
|
if quota.can_mail():
|
||||||
|
'<li><a href="mail-participants">%s</a></li>' % _('Mail participants')
|
||||||
'</ul>'
|
'</ul>'
|
||||||
|
|
||||||
'<h4>%s</h4>' % _('Search a participant')
|
'<h4>%s</h4>' % _('Search a participant')
|
||||||
|
@ -830,6 +833,9 @@ class DiffusionDirectory(Directory):
|
||||||
if get_request().form.get('job'):
|
if get_request().form.get('job'):
|
||||||
return self.participants_mailing()
|
return self.participants_mailing()
|
||||||
|
|
||||||
|
if not quota.can_mail():
|
||||||
|
raise quota.NotAvailableFeature()
|
||||||
|
|
||||||
emails_cfg = get_cfg('emails', {})
|
emails_cfg = get_cfg('emails', {})
|
||||||
|
|
||||||
default_subject = EmailsDirectory.get_subject('asec-skeleton-participant-mail')
|
default_subject = EmailsDirectory.get_subject('asec-skeleton-participant-mail')
|
||||||
|
|
|
@ -90,6 +90,9 @@ def can_logo():
|
||||||
def can_theme():
|
def can_theme():
|
||||||
return get_boolean_quota('x-asec-can-theme')
|
return get_boolean_quota('x-asec-can-theme')
|
||||||
|
|
||||||
|
def can_mail():
|
||||||
|
return get_boolean_quota('x-asec-can-mail')
|
||||||
|
|
||||||
def is_locked():
|
def is_locked():
|
||||||
return get_boolean_quota('x-asec-locked')
|
return get_boolean_quota('x-asec-locked')
|
||||||
|
|
||||||
|
|
Reference in New Issue