Allow the fine-grained configuration of notification settings for
each section and reword the help texts quite a bit. This will later be used to collect the correct set of email addresses to notify a particular audience about changes in a particular section. Notice that a project admin will have to explicitely opt-in for "Others" notifications, i.e. unless the checkbox is checked, existing email addresses won't be notified anymore. This is surely debatable for existing setups, but makes much more sense for new setups. Eventually we'll write a small migration script to add the specific enabled setting for those (existing) projects that have a non-empty mail list configured. This commit has been sponsored by SciLab.
This commit is contained in:
@@ -57,20 +57,44 @@ class IDF_Form_TabsConf extends Pluf_Form
|
||||
'widget' => 'Pluf_Form_Widget_SelectInput',
|
||||
));
|
||||
}
|
||||
$ak = array('downloads_notification_email',
|
||||
'review_notification_email',
|
||||
'wiki_notification_email',
|
||||
'source_notification_email',
|
||||
'issues_notification_email',);
|
||||
foreach ($ak as $key) {
|
||||
$this->fields[$key] = new IDF_Form_Field_EmailList(
|
||||
array('required' => false,
|
||||
'label' => $key,
|
||||
'initial' => $this->conf->getVal($key, ''),
|
||||
'widget_attrs' => array('size' => 40),
|
||||
));
|
||||
}
|
||||
|
||||
$sections = array(
|
||||
'downloads_notification',
|
||||
'review_notification',
|
||||
'wiki_notification',
|
||||
'source_notification',
|
||||
'issues_notification',
|
||||
);
|
||||
|
||||
foreach ($sections as $section) {
|
||||
$this->fields[$section.'_owners_enabled'] = new Pluf_Form_Field_Boolean(
|
||||
array('required' => false,
|
||||
'label' => __('Project owners'),
|
||||
'initial' => $this->conf->getVal($section.'_owners_enabled', false),
|
||||
'widget' => 'Pluf_Form_Widget_CheckboxInput',
|
||||
));
|
||||
$this->fields[$section.'_members_enabled'] = new Pluf_Form_Field_Boolean(
|
||||
array('required' => false,
|
||||
'label' => __('Project members'),
|
||||
'initial' => $this->conf->getVal($section.'_members_enabled', false),
|
||||
'widget' => 'Pluf_Form_Widget_CheckboxInput',
|
||||
));
|
||||
$this->fields[$section.'_email_enabled'] = new Pluf_Form_Field_Boolean(
|
||||
array('required' => false,
|
||||
'label' => __('Others'),
|
||||
'initial' => $this->conf->getVal($section.'_email_enabled', false),
|
||||
'widget' => 'Pluf_Form_Widget_CheckboxInput',
|
||||
));
|
||||
if ($this->conf->getVal($section.'_email_enabled', false)) {
|
||||
$attrs['readonly'] = 'readonly';
|
||||
}
|
||||
$this->fields[$section.'_email'] = new IDF_Form_Field_EmailList(
|
||||
array('required' => false,
|
||||
'label' => null,
|
||||
'initial' => $this->conf->getVal($section.'_email', ''),
|
||||
'widget_attrs' => array('size' => 20),
|
||||
));
|
||||
}
|
||||
|
||||
$this->fields['private_project'] = new Pluf_Form_Field_Boolean(
|
||||
array('required' => false,
|
||||
|
Reference in New Issue
Block a user