Indefero

Indefero Commit Details


Date:2011-11-03 18:46:33 (13 years 1 month ago)
Author:Thomas Keller
Branch:develop, release-1.3
Commit:2b5efb7fee5e0702d461ec5761abb5a4e2a856a9
Parents: 099e4888e8899b04564e81fda9286a142a156de5
Message: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.
Changes:

File differences

NEWS.mdtext
1212
1313
1414
15
16
1517
1618
1719
implementations of this web hook as this setting is likely to be removed
in future versions of Indefero.
- Indefero now needs PHP's zip module which is not enabled by default.
- Existing email notifications now have to be explicitely activated in the
project's administrative area.
## New Features
src/IDF/Form/TabsConf.php
5757
5858
5959
60
61
62
63
64
65
66
67
68
69
70
71
72
7360
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
7498
7599
76100
'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,
src/IDF/Views/Project.php
508508
509509
510510
511
511
512512
513513
514514
515515
516516
517517
518
519
520
521
522
523
524
525
518
519
520
521
522
523
524
525
526
527
528
526529
527530
528531
}
}
$form->save(); // Save the authorized users.
$request->user->setMessage(__('The project tabs access rights have been saved.'));
$request->user->setMessage(__('The project tabs access rights and notification settings have been saved.'));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Project::adminTabs',
array($prj->shortname));
return new Pluf_HTTP_Response_Redirect($url);
}
} else {
$params = array();
$keys = array('downloads_access_rights', 'source_access_rights',
'issues_access_rights', 'review_access_rights',
'wiki_access_rights',
'downloads_notification_email',
'review_notification_email',
'wiki_notification_email',
'source_notification_email',
'issues_notification_email');
$sections = array('downloads', 'wiki', 'source', 'issues', 'review');
$keys = array();
foreach ($sections as $section) {
$keys[] = $section.'_access_rights';
$keys[] = $section.'_notification_owners_enabled';
$keys[] = $section.'_notification_members_enabled';
$keys[] = $section.'_notification_email_enabled';
$keys[] = $section.'_notification_email';
}
foreach ($keys as $key) {
$_val = $request->conf->getVal($key, false);
if ($_val !== false) {
src/IDF/templates/idf/admin/tabs.html
1010
1111
1212
13
13
1414
1515
16
17
16
17
1818
1919
2020
......
2222
2323
2424
25
26
27
28
29
30
2531
2632
2733
......
3137
3238
3339
40
41
42
43
44
45
3446
3547
3648
......
4052
4153
4254
55
56
57
58
59
60
4361
4462
4563
......
4967
5068
5169
70
71
72
73
74
75
5276
5377
5478
5579
56
57
58
59
60
61
62
63
64
6580
6681
6782
6883
6984
85
86
87
88
89
90
7091
7192
7293
7394
74
95
96
97
7598
76
77
99
100
78101
79102
80103
......
94117
95118
96119
97
98
99
100
101
120
121
122
123
124
125
126
127
102128
103129
104130
105131
106132
107
108
109
133
134
135
110136
111
112
113
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
114154
115
155
116156
117157
118
158
159
119160
120161
</div>
{/if}
<form method="post" action=".">
<table class="form" summary="">
<table class="form access-rights" summary="">
<tr>
<th>&nbsp;</th>
<th class="a-c"><strong>{trans 'Access Rights'}</strong></th>
<th class="a-c"><strong>{trans 'Notification Email'}</strong></th>
<th class="left"><strong>{trans 'Access Rights'}</strong></th>
<th class="left"><strong>{trans 'Notifications'}</strong></th>
</tr>
<tr>
<th><strong>{$form.f.downloads_access_rights.labelTag}:</strong></th>
{$form.f.downloads_access_rights|unsafe}
</td>
<td>{if $form.f.downloads_notification_email.errors}{$form.f.downloads_notification_email.fieldErrors}{/if}
{$form.f.downloads_notification_owners_enabled|unsafe}
{$form.f.downloads_notification_owners_enabled.labelTag}
{$form.f.downloads_notification_members_enabled|unsafe}
{$form.f.downloads_notification_members_enabled.labelTag}
{$form.f.downloads_notification_email_enabled|unsafe}
{$form.f.downloads_notification_email_enabled.labelTag}
{$form.f.downloads_notification_email|unsafe}
</td>
</tr>
{$form.f.wiki_access_rights|unsafe}
</td>
<td>{if $form.f.wiki_notification_email.errors}{$form.f.wiki_notification_email.fieldErrors}{/if}
{$form.f.wiki_notification_owners_enabled|unsafe}
{$form.f.wiki_notification_owners_enabled.labelTag}
{$form.f.wiki_notification_members_enabled|unsafe}
{$form.f.wiki_notification_members_enabled.labelTag}
{$form.f.wiki_notification_email_enabled|unsafe}
{$form.f.wiki_notification_email_enabled.labelTag}
{$form.f.wiki_notification_email|unsafe}
</td>
</tr>
{$form.f.issues_access_rights|unsafe}
</td>
<td>{if $form.f.issues_notification_email.errors}{$form.f.issues_notification_email.fieldErrors}{/if}
{$form.f.issues_notification_owners_enabled|unsafe}
{$form.f.issues_notification_owners_enabled.labelTag}
{$form.f.issues_notification_members_enabled|unsafe}
{$form.f.issues_notification_members_enabled.labelTag}
{$form.f.issues_notification_email_enabled|unsafe}
{$form.f.issues_notification_email_enabled.labelTag}
{$form.f.issues_notification_email|unsafe}
</td>
</tr>
{$form.f.source_access_rights|unsafe}
</td>
<td>{if $form.f.source_notification_email.errors}{$form.f.source_notification_email.fieldErrors}{/if}
{$form.f.source_notification_owners_enabled|unsafe}
{$form.f.source_notification_owners_enabled.labelTag}
{$form.f.source_notification_members_enabled|unsafe}
{$form.f.source_notification_members_enabled.labelTag}
{$form.f.source_notification_email_enabled|unsafe}
{$form.f.source_notification_email_enabled.labelTag}
{$form.f.source_notification_email|unsafe}
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2" class="helptext">
{blocktrans}
Only project members and admins have write access to the source.<br />
If you restrict the access to the source, anonymous access is<br />
not provided and the users must authenticate themselves with their<br />
password or SSH key.{/blocktrans}
</td></tr>
<tr>
<th><strong>{$form.f.review_access_rights.labelTag}:</strong></th>
<td>{if $form.f.review_access_rights.errors}{$form.f.review_access_rights.fieldErrors}{/if}
{$form.f.review_access_rights|unsafe}
</td>
<td>{if $form.f.review_notification_email.errors}{$form.f.review_notification_email.fieldErrors}{/if}
{$form.f.review_notification_owners_enabled|unsafe}
{$form.f.review_notification_owners_enabled.labelTag}
{$form.f.review_notification_members_enabled|unsafe}
{$form.f.review_notification_members_enabled.labelTag}
{$form.f.review_notification_email_enabled|unsafe}
{$form.f.review_notification_email_enabled.labelTag}
{$form.f.review_notification_email|unsafe}
</td>
</tr>
<tr>
<th>{if $form.f.private_project.errors}{$form.f.private_project.fieldErrors}{/if}
<th>&nbsp;</th>
<td>
{if $form.f.private_project.errors}{$form.f.private_project.fieldErrors}{/if}
{$form.f.private_project|unsafe}
</th>
<td>{$form.f.private_project.labelTag}</td>
{$form.f.private_project.labelTag}
</td>
</tr>
<tr id="authorized-users-row">
<td>&nbsp;</td>
{/block}
{block context}
<div class="issue-submit-info">
<p><strong>{trans 'Instructions:'}</strong></p>
<p>{blocktrans}You can configure here the project tabs access rights and notification emails.{/blocktrans}</p>
<p>{blocktrans}Notification emails will be sent from the <strong>{$from_email}</strong> address, if you send the email to a mailing list, you may need to register this email address. Multiple email addresses must be separated through commas (','). If you do not want to send emails for a given type of changes, simply leave the corresponding field empty.{/blocktrans}</p>
<p>{blocktrans}If you mark a project as private, only the project members and administrators, together with the extra authorized users you provide will have access to the project. You will still be able to define further access rights for the different tabs but the "Open to all" and "Signed in users" will default to authorized users only.{/blocktrans}</p>
<p>{blocktrans}Specify each person by its login. Each person must have already registered with the given login. Separate the logins with commas and/or new lines.{/blocktrans}</p>
<p>{blocktrans}This section allows you to configure project tabs access rights and notifications.{/blocktrans}</p>
<p><strong>{trans 'Access Rights'}</strong></p>
<p>{blocktrans}Tab access controls whether a single user can navigate into a particular section of your project via the main menu or automatically generated object links.{/blocktrans}</p>
<p>{blocktrans}If you mark a project as private, only the project members and administrators, together with the extra authorized users you provide will have access to the project as a whole. You will still be able to define further access rights for the different tabs but the "Open to all" and "Signed in users" will default to authorized users only.{/blocktrans}</p>
<p>{blocktrans}For the extra authorized user list, specify each person by its login. Each person must have already registered with the given login. Separate the logins with commas and/or new lines.{/blocktrans}</p>
<p>{blocktrans}Only project members and admins have write access to the source. If you restrict the access to the source, anonymous access is not provided and the users must authenticate themselves with their password or SSH key.{/blocktrans}</p>
<p><strong>{trans 'Notifications'}</strong></p>
<p>{blocktrans}Here you can configure who should be notified about changes in a particular section. You can also configure additional addresses, like the one of a mailing list, that should be notified. (Keep in mind that you might have to register the sender address <strong>{$from_email}</strong> to let the mailing list actually accept notification emails.) Multiple email addresses must be separated through commas (',').{/blocktrans}</p>
</div>
{/block}
{block javascript}{literal}
<script type="text/javascript">
$(document).ready(function(){
// If not checked, hide
if (!$("#id_private_project").is(":checked"))
$(document).ready(function() {
// if not checked, hide
if (!$("#id_private_project").is(":checked")) {
$("#authorized-users-row").hide();
$("#id_private_project").click(function(){
if ($("#id_private_project").is(":checked")) {
$("#authorized-users-row").show();
}
$("#id_private_project").click(function() {
if ($("#id_private_project").is(":checked")) {
$("#authorized-users-row").show();
} else {
$("#authorized-users-row").hide();
}
});
// if not checked, hide
$.each(['downloads', 'wiki', 'issues', 'source', 'review'], function(index, section) {
if (!$("#id_" + section + "_notification_email_enabled").is(":checked")) {
$("#id_" + section + "_notification_email").hide();
}
$("#id_" + section + "_notification_email_enabled").click(function() {
if ($("#id_" + section + "_notification_email_enabled").is(":checked")) {
$("#id_" + section + "_notification_email").show();
} else {
$("#authorized-users-row").hide();
$("#id_" + section + "_notification_email").hide();
}
});
});
});
});
</script>
{/literal}{/block}
www/media/idf/css/style.css
4343
4444
4545
46
47
48
49
4650
47
51
4852
4953
5054
......
12321236
12331237
12341238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
padding: 0 1em;
}
.left {
text-align: left !important;
}
.right {
text-align: right;
text-align: right !important;
}
.a-c {
table.issue-summary td.graph-percent {
padding-left: 1em;
}
table.form.access-rights {}
table.form.access-rights th + th,
table.form.access-rights td + td {
padding-left: 1em;
}
table.form.access-rights td + td label {
padding-right: 0.5em;
}
table.form.access-rights th *,
table.form.access-rights td * {
vertical-align: middle;
}

Archive Download the corresponding diff file

Page rendered in 0.09607s using 13 queries.