Skip to content

Commit 585fce9

Browse files
author
Michele
committed
Implemented first version of mlmmj config panel
Subscription and removal tab doesn't works yet...
1 parent 5c60033 commit 585fce9

File tree

7 files changed

+416
-2
lines changed

7 files changed

+416
-2
lines changed

interface/web/mail/form/mail_mailinglist.tform.php

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
3939
*/
4040

41+
$app->uses('getconf');
42+
$mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager'];
43+
4144
$form["title"] = "Mailing List";
4245
$form["description"] = "";
4346
$form["name"] = "mail_mailinglist";
@@ -151,4 +154,149 @@
151154
//#################################
152155
)
153156
);
157+
158+
if($mlManager == 'mlmmj') {
159+
$form["tabs"]['options'] = array (
160+
'title' => "Options",
161+
'width' => 100,
162+
'template' => "templates/mail_mailinglist_options.htm",
163+
'fields' => array (
164+
//#################################
165+
// Begin Datatable fields
166+
//#################################
167+
'admins' => array (
168+
'datatype' => 'TEXT',
169+
'formtype' => 'TEXTAREA',
170+
'cols' => '30',
171+
'rows' => '5'
172+
),
173+
'subject_prefix' => array (
174+
'datatype' => 'VARCHAR',
175+
'formtype' => 'TEXT',
176+
'default' => '',
177+
'value' => '',
178+
'width' => '30',
179+
'maxlength' => '255',
180+
),
181+
'mail_footer' => array (
182+
'datatype' => 'TEXT',
183+
'formtype' => 'TEXTAREA',
184+
'cols' => '30',
185+
'rows' => '5'
186+
),
187+
'archive' => array (
188+
'datatype' => 'VARCHAR',
189+
'formtype' => 'CHECKBOX',
190+
'default' => 'n',
191+
'value' => array(0 => 'n', 1 => 'y')
192+
),
193+
)
194+
);
195+
196+
$form["tabs"]['membership'] = array (
197+
'title' => "Membership",
198+
'width' => 100,
199+
'template' => "templates/mail_mailinglist_membership.htm",
200+
'fields' => array (
201+
//#################################
202+
// Begin Datatable fields
203+
//#################################
204+
// 'membership' => array (
205+
// 'datatype' => 'TEXT',
206+
// 'formtype' => 'TEXTAREA',
207+
// 'cols' => '30',
208+
// 'rows' => '5'
209+
// ),
210+
)
211+
);
212+
213+
214+
$form["tabs"]['privacy'] = array (
215+
'title' => "Privacy",
216+
'width' => 100,
217+
'template' => "templates/mail_mailinglist_privacy.htm",
218+
'fields' => array (
219+
//#################################
220+
// Begin Datatable fields
221+
//#################################
222+
'list_type' => array (
223+
'datatype' => 'VARCHAR',
224+
'formtype' => 'RADIO',
225+
'regex' => '',
226+
'errmsg' => '',
227+
'default' => 'user',
228+
'value' => array ('open' => 'Open', 'closed' => 'Closed'),
229+
'separator' => '',
230+
'width' => '30',
231+
'maxlength' => '255',
232+
'rows' => '',
233+
'cols' => ''
234+
),
235+
'subscribe_policy' => array (
236+
'datatype' => 'VARCHAR',
237+
'formtype' => 'SELECT',
238+
'default' => 'confirm',
239+
'value' => array(
240+
'disabled' => 'sub_disabled_txt',
241+
'confirm' => 'sub_confirm_txt',
242+
'approval' => 'sub_approval_txt',
243+
'both' => 'sub_both_txt',
244+
'none' => 'sub_none_txt'),
245+
),
246+
'posting_policy' => array (
247+
'datatype' => 'VARCHAR',
248+
'formtype' => 'SELECT',
249+
'default' => 'confirm',
250+
'value' => array(
251+
'closed' => 'post_closed_txt',
252+
'moderated' => 'post_moderated_txt',
253+
'free' => 'post_free_txt'),
254+
),
255+
)
256+
);
257+
258+
$form["tabs"]['digest'] = array (
259+
'title' => "Digest",
260+
'width' => 100,
261+
'template' => "templates/mail_mailinglist_digest.htm",
262+
'fields' => array (
263+
//#################################
264+
// Begin Datatable fields
265+
//#################################
266+
'digesttext' => array (
267+
'datatype' => 'VARCHAR',
268+
'formtype' => 'CHECKBOX',
269+
'default' => 'n',
270+
'value' => array(0 => 'n', 1 => 'y')
271+
),
272+
'digestsub' => array (
273+
'datatype' => 'VARCHAR',
274+
'formtype' => 'CHECKBOX',
275+
'default' => 'n',
276+
'value' => array(0 => 'n', 1 => 'y')
277+
),
278+
'digestinterval' => array (
279+
'datatype' => 'VARCHAR',
280+
'formtype' => 'TEXT',
281+
'default' => '7',
282+
'validators' => array(0 => array('type' => 'ISINT'),
283+
array('type'=>'RANGE', 'range'=>'1:60')
284+
),
285+
'value' => '',
286+
'width' => '15'
287+
),
288+
'digestmaxmails' => array (
289+
'datatype' => 'VARCHAR',
290+
'formtype' => 'TEXT',
291+
'default' => '50',
292+
'validators' => array(0 => array('type' => 'ISINT'),
293+
array('type'=>'RANGE', 'range'=>'10:100')
294+
),
295+
'value' => '',
296+
'width' => '15'
297+
),
298+
)
299+
);
300+
301+
}
154302
?>

interface/web/mail/lib/lang/en_mail_mailinglist.lng

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,74 @@
11
<?php
2+
$wb['heading_general_txt'] = 'General';
3+
4+
/** MLMMJ **/
5+
$wb['heading_subscription_txt'] = 'Subscription';
6+
$wb['heading_removal_txt'] = 'Removal';
7+
$wb['admins_txt'] = 'Admin\'s email';
8+
$wb['admins_desc_txt'] = 'The additional email addresses that get mails to list name+admin@listdomain.ltd';
9+
10+
$wb['subscribers_txt'] = 'Membership';
11+
$wb['subscribers_desc_txt'] = 'The email addresses subscribed to the list';
12+
13+
$wb['prefix_txt'] = 'Subject prefix';
14+
$wb['prefix_desc_txt'] = 'This will alter the Subject: line, and add a prefix if it\'s not present elsewhere';
15+
16+
$wb['mail_footer_txt'] = 'Footer text';
17+
$wb['mail_footer_desc_txt'] = 'This content is appended to mail sent to the list';
18+
19+
$wb['subscribe_policy_txt'] = 'Subscribe policy';
20+
$wb['sub_disabled_txt'] = 'Disabled';
21+
$wb['sub_confirm_txt'] = 'Confirm';
22+
$wb['sub_approval_txt'] = 'Require approval';
23+
$wb['sub_both_txt'] = 'Confirm and approve';
24+
$wb['sub_none_txt'] = 'Limitless';
25+
26+
$wb['posting_policy_txt'] = 'posting policy';
27+
$wb['post_free_txt'] = 'Free';
28+
$wb['post_closed_txt'] = 'Closed';
29+
$wb['post_moderated_txt'] = 'Moderated';
30+
31+
$wb['list_type_txt'] = 'List type';
32+
$wb['type_open_txt'] = 'Open';
33+
$wb['type_closed_txt'] = 'Closed';
34+
35+
$wb['digestinterval_txt'] = 'Interval';
36+
$wb['digestinterval_desc_txt'] = 'Specifies how many days will pass before the next digest is sent. Defaults is 7 days';
37+
$wb['digestmaxmails_txt'] = 'Max mails';
38+
$wb['digestmaxmails_desc_txt'] = 'Specifies how many mails can accumulate before digest sending is triggered. Defaults to 50 mails, meaning that if 50 mails arrive to the list before digestinterval have passed, the digest is delivered';
39+
$wb['_txt'] = '';
40+
41+
$wb['closedlist_txt'] = 'Closed list';
42+
$wb['closedlistsub_txt'] = 'Closed for subscription';
43+
$wb['moderated_txt'] = 'Moderated list';
44+
$wb['tocc_txt'] = 'To/Cc optional';
45+
$wb['subonlypost_txt'] = 'Closed posting';
46+
$wb['subonlypost_desc_txt'] = 'Only people who are subscribed to the list, are allowed to post to it';
47+
48+
$wb['modonlypost_txt'] = 'modonlypost';
49+
$wb['modnonsubposts_txt'] = 'modnonsubposts';
50+
$wb['addtohdr_txt'] = 'addtohdr';
51+
$wb['notifysub_txt'] = 'notifysub';
52+
$wb['notifymod_txt'] = 'notifymod';
53+
$wb['archive_txt'] = 'Archive';
54+
$wb['archive_desc_txt'] = 'If checked, the mail will be saved in the archive and not simply deleted';
55+
56+
57+
$wb['nosubconfirm_txt'] = 'nosubconfirm';
58+
$wb['noget_txt'] = 'noget';
59+
$wb['notoccdenymails_txt'] = 'notoccdenymails';
60+
$wb['noaccessdenymails_txt'] = 'noaccessdenymails';
61+
$wb['nosubonlydenymails_txt'] = 'nosubonlydenymails';
62+
$wb['nomodonlydenymails_txt'] = 'nomodonlydenymails';
63+
$wb['nosubmodmails_txt'] = 'nosubmodmails';
64+
$wb['digestsub_txt'] = 'Enable';
65+
$wb['digesttext_txt'] = 'Thread summary';
66+
$wb['nonomailsub_txt'] = 'nonomailsub';
67+
$wb['nomaxmailsizedenymails_txt'] = 'nomaxmailsizedenymails';
68+
$wb['nolistsubsemail_txt'] = 'nolistsubsemail';
69+
$wb['ifmodsendonlymodmoderate_txt'] = 'ifmodsendonlymodmoderate';
70+
$wb['notmetoo_txt'] = 'notmetoo';
71+
272
$wb["mailinglist_txt"] = 'Mailing list';
373
$wb["limit_mailmailinglist_txt"] = 'Limit reached';
474
$wb["domain_error_empty"] = 'Domain is empty.';
@@ -17,6 +87,6 @@ $wb['generate_password_txt'] = 'Generate Password';
1787
$wb['repeat_password_txt'] = 'Repeat Password';
1888
$wb['password_mismatch_txt'] = 'The passwords do not match.';
1989
$wb['password_match_txt'] = 'The passwords do match.';
20-
$wb["listname_error_unique"] = 'There is already a mailinlist with name on the server. Please choose a different listname.';
90+
$wb["listname_error_unique"] = 'There is already a mailinglist with name on the server. Please choose a different listname.';
2191
$wb["email_error_isemail"] = 'Email address is invalid.';
2292
?>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<div class='page-header'>
2+
<h1><tmpl_var name="list_head_txt"></h1>
3+
</div>
4+
<p><tmpl_var name="list_desc_txt"></p>
5+
<legend>Digest</legend>
6+
7+
<div class="form-group" title="{tmpl_var name='digestsub_desc_txt'}">
8+
<label for="digestsub" class="col-sm-3 control-label">{tmpl_var name='digestsub_txt'}</label>
9+
<div class="col-sm-9">
10+
{tmpl_var name='digestsub'}
11+
</div>
12+
</div>
13+
<div class="form-group digestCapability" title="{tmpl_var name='digestinterval_desc_txt'}">
14+
<label class="col-sm-3 control-label">{tmpl_var name='digestinterval_txt'}</label>
15+
<div class="col-sm-9">
16+
<input type="number" type="text" name="digestinterval" id="digestinterval" value="{tmpl_var name='digestinterval'}" class="form-control" />
17+
</div>
18+
</div>
19+
<div class="form-group digestCapability" title="{tmpl_var name='digestmaxmails_desc_txt'}">
20+
<label class="col-sm-3 control-label">{tmpl_var name='digestmaxmails_txt'}</label>
21+
<div class="col-sm-9">
22+
<input type="number" type="text" name="digestmaxmails" id="digestmaxmails" value="{tmpl_var name='digestmaxmails'}" class="form-control" />
23+
</div>
24+
</div>
25+
<div class="form-group digestCapability" title="{tmpl_var name='digesttext_desc_txt'}">
26+
<label for="digesttext" class="col-sm-3 control-label">{tmpl_var name='digesttext_txt'}</label>
27+
<div class="col-sm-9">
28+
{tmpl_var name='digesttext'}
29+
</div>
30+
</div>
31+
32+
<input type="hidden" name="id" value="{tmpl_var name='id'}">
33+
34+
<div class="clear"><div class="right">
35+
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="mail/mail_mailinglist_edit.php">{tmpl_var name='btn_save_txt'}</button>
36+
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="mail/mail_mailinglist_list.php">{tmpl_var name='btn_cancel_txt'}</button>
37+
</div>
38+
39+
<script language="JavaScript" type="text/javascript">
40+
$('#digestsub').change(digestStatus);
41+
digestStatus();
42+
43+
function digestStatus() {
44+
if($('#digestsub').is(':checked'))
45+
$('.digestCapability:hidden').show();
46+
else $('.digestCapability:visible').hide();
47+
}
48+
</script>

interface/web/mail/templates/mail_mailinglist_edit.htm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ <h1><tmpl_var name="list_head_txt"></h1>
5454
<label for="email" class="col-sm-3 control-label">{tmpl_var name='email_txt'}</label>
5555
<div class="col-sm-9"><input type="text" name="email" id="email" value="{tmpl_var name='email'}" class="form-control" /></div></div>
5656
</tmpl_if>
57+
<tmpl_if name="ml_manager" value="mailman">
5758
<div class="form-group">
5859
<label for="password" class="col-sm-3 control-label">{tmpl_var name='password_txt'}</label>
5960
<div class="col-sm-9">
@@ -81,7 +82,7 @@ <h1><tmpl_var name="list_head_txt"></h1>
8182
<div id="confirmpasswordOK" style="display:none;" class="confirmpasswordok">{tmpl_var name='password_match_txt'}</div>
8283
</div>
8384
</div>
84-
85+
</tmpl_if>
8586

8687
<input type="hidden" name="id" value="{tmpl_var name='id'}">
8788

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<div class='page-header'>
2+
<h1><tmpl_var name="list_head_txt"></h1>
3+
</div>
4+
<p><tmpl_var name="list_desc_txt"></p>
5+
6+
<legend>Membership management</legend>
7+
8+
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
9+
<div class="panel panel-default">
10+
<div class="panel-heading" role="tab" id="headingSubscription">
11+
<h4 class="panel-title">
12+
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSubscription" aria-expanded="true" aria-controls="collapseSubscription">
13+
{tmpl_var name='heading_subscription_txt'}
14+
</a>
15+
</h4>
16+
</div>
17+
<div id="collapseSubscription" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingSubscription">
18+
<div class="panel-body">
19+
<div class="form-group" title="{tmpl_var name='subscribers_desc_txt'}">
20+
<label class="col-sm-3 control-label">{tmpl_var name='subscribers_txt'}</label>
21+
<div class="col-sm-9">
22+
<textarea class="form-control" name="subscribers" id="subscribers" rows='5' cols='30'>{tmpl_var name='subscribers'}</textarea>
23+
</div>
24+
</div>
25+
<div class="form-group">
26+
<label class="col-sm-3 control-label">Welcome message</label>
27+
<div class="col-sm-9">
28+
<input name="welcome_msg" id="welcome_msg" value="1" checked="" type="checkbox">
29+
</div>
30+
</div>
31+
</div>
32+
</div>
33+
</div>
34+
<div class="panel panel-default">
35+
<div class="panel-heading" role="tab" id="headingRemoval">
36+
<h4 class="panel-title">
37+
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseRemoval" aria-expanded="false" aria-controls="collapseRemoval">
38+
{tmpl_var name='heading_removal_txt'}
39+
</a>
40+
</h4>
41+
</div>
42+
<div id="collapseRemoval" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingRemoval">
43+
<div class="panel-body">
44+
<div class="form-group" title="{tmpl_var name='subscribers_desc_txt'}">
45+
<label class="col-sm-3 control-label">{tmpl_var name='subscribers_txt'}</label>
46+
<div class="col-sm-9">
47+
<textarea class="form-control" name="subscribers" id="subscribers" rows='5' cols='30'>{tmpl_var name='subscribers'}</textarea>
48+
</div>
49+
</div>
50+
<div class="form-group">
51+
<label class="col-sm-3 control-label">Goodbye message</label>
52+
<div class="col-sm-9">
53+
<input name="welcome_msg" id="welcome_msg" value="1" checked="" type="checkbox">
54+
</div>
55+
</div>
56+
</div>
57+
</div>
58+
</div>
59+
60+
<input type="hidden" name="id" value="{tmpl_var name='id'}">
61+
62+
<div class="clear"><div class="right">
63+
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="mail/mail_mailinglist_edit.php">{tmpl_var name='btn_save_txt'}</button>
64+
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="mail/mail_mailinglist_list.php">{tmpl_var name='btn_cancel_txt'}</button>
65+
</div></div>

0 commit comments

Comments
 (0)