Commit bdfd8967 authored by sikeda's avatar sikeda
Browse files

[-dev] End of tweaks for new skin.

- Bulk suspending/unsubscribing feature was withdrawn for the present.
- Added items to suspend/resume subscription to suboptions form.
ToDo: Owner would be able to view suspension status in editsubscriber page.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@11861 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 0e070d02
<!-- $Id$ -->
<div class="block">
<h2>[%|loc%]Subscriber information[%END%]</h2>
<form action="[% path_cgi %]" method="post">
<fieldset>
<h3 class="block">[%|loc%]Subscriber information[%END%]</h3>
<input type="hidden" name="previous_action" value="[% previous_action %]" />
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="email" value="[% current_subscriber.escaped_email %]" />
<label for="new_email">[%|loc%]Email:[%END%] </label>
<input type="text" name="new_email" id="new_email" value="[% current_subscriber.escaped_email %]" size="25" /><br />
<label for="gecos">[%|loc%]Name:[%END%] </label>
<input type="text" name="gecos" id="gecos" value="[% current_subscriber.gecos %]" size="25" /><br />
[% IF current_subscriber.custom_attribute %]
[% SET subscriber = current_subscriber ;
PROCESS edit_attributes.tt2 ;
END %]
[%|loc%]Subscribed since:[%END%] [% current_subscriber.date %]<br />
[%|loc%]Last update:[%END%] [% current_subscriber.update_date %]<br />
<label for="reception">[%|loc%]Receiving:[%END%] </label><select name="reception" id="reception">
[% FOREACH r = reception %]
<option value="[% r.key %]" [% r.value.selected %]>[% r.value.description %]</option>
[% END %]
</select>
<br />
<label for="visibility">[%|loc%]Visibility:[%END%] </label>
<input type="hidden" name="previous_action" value="[% previous_action %]" />
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="email" value="[% current_subscriber.escaped_email %]" />
<div class="form_row">
<label for="new_email">[%|loc%]Email:[%END%] </label>
<input type="text" name="new_email" id="new_email" value="[% current_subscriber.escaped_email %]" size="25" />
</div>
<div class="form_row">
<label for="gecos">[%|loc%]Name:[%END%] </label>
<input type="text" name="gecos" id="gecos" value="[% current_subscriber.gecos %]" size="25" />
</div>
[% IF current_subscriber.custom_attribute %]
[% SET subscriber = current_subscriber ;
PROCESS edit_attributes.tt2 %]
[% END %]
<div class="form_row">
<label>[%|loc%]Subscribed since:[%END%] </label>
[% current_subscriber.date %]
</div>
<div class="form_row">
<label>[%|loc%]Last update:[%END%] </label>
[% current_subscriber.update_date %]
</div>
<div class="form_row">
<label for="reception">[%|loc%]Receiving:[%END%] </label>
<select name="reception" id="reception">
[% FOREACH r = reception %]
<option value="[% r.key %]" [% r.value.selected %]>[% r.value.description %]</option>
[% END %]
</select>
</div>
<div class="form_row">
<label for="visibility">[%|loc%]Visibility:[%END%] </label>
<select id="visibility" name="visibility">
[% FOREACH r = visibility %]
<option value="[% r.key %]" [% r.value.selected %]>[% r.value.description %]</option>
[% END %]
</select><br />
<label>[%|loc%]Language:[%END%] </label>[% current_subscriber.lang %]<br />
[% IF pictures_display %]
<label for="picture">[%|loc%]Picture:[%END%] </label>
<a id="picture" href="[% current_subscriber.pictures_url %]" title="[% current_subscriber.pictures_url %],[%|loc%]Open in a new window[%END%]" target="pictures">
<img id="large_picture" src="[% current_subscriber.pictures_url %]" alt="[% current_subscriber.escaped_email %]'s picture"/>
</a><br />
[% FOREACH r = visibility %]
<option value="[% r.key %]" [% r.value.selected %]>[% r.value.description %]</option>
[% END %]
</select>
</div>
<div class="form_row">
<label>[%|loc%]Language:[%END%] </label>[% current_subscriber.lang %]
</div>
[% IF pictures_display %]
<div class="form_row">
<label for="picture">[%|loc%]Picture:[%END%] </label>
<a id="picture" href="[% current_subscriber.pictures_url %]" title="[% current_subscriber.pictures_url %],[%|loc%]Open in a new window[%END%]" target="pictures">
<img id="large_picture" src="[% current_subscriber.pictures_url %]" alt="[% current_subscriber.escaped_email %]'s picture"/>
</a>
[% IF current_subscriber.escaped_email == user.email %]
<a href="[% path_cgi %]/suboptions/[% list %]" title="">[%|loc%]Changing your picture for this list[%END%]</a><br />
<p><a href="[% path_cgi %]/suboptions/[% list %]" title="">[%|loc%]Changing your picture for this list[%END%]</a></p>
[% END %]
[% END %]
[% IF additional_fields %]
[% FOREACH field = additional_fields %]
[% IF field.value.type == 'enum' %]
<label for="additional_field_[% field.key %]">[% field.key %][%|loc%]:[%END%] </label>
<select name="additional_field_[% field.key %]" id="additional_field_[% field.key %]">
<option value=""> </option>
[% FOREACH e = field.value.enum %]
<option value="[% e.key %]" [% e.value %]>[% e.key %]</option>
</div>
[% END %]
[% IF additional_fields %]
[% FOREACH field = additional_fields %]
[% IF field.value.type == 'enum' %]
<div class="form_row">
<label for="additional_field_[% field.key %]">[% field.key %][%|loc%]:[%END%] </label>
<select name="additional_field_[% field.key %]" id="additional_field_[% field.key %]">
<option value=""> </option>
[% FOREACH e = field.value.enum %]
<option value="[% e.key %]" [% e.value %]>[% e.key %]</option>
[% END %]
</select><br />
[% ELSE %]
<label for="additional_field_[% field.key %]">[% field.key %][%|loc%]:[%END%]</label><input type="text" name="additional_field_[% field.key %]" id="additional_field_[% field.key %]" value="[% field.value.value %]" size="25" /><br />
[% END %]
[% END %]
[% END %]
<input class="MainMenuLinks" type="submit" name="action_set" value="[%|loc%]Update[%END%]" />
<input class="MainMenuLinks" type="submit" name="action_del" value="[%|loc%]Unsubscribe the User[%END%]" />
<input id="quiet" type="checkbox" name="quiet" /><label for="quiet"> [%|loc%]quiet[%END%]</label>
<br />
[% IF current_subscriber.bounce %]
<br />
<span class="bg_color_error">[%|loc%]Bouncing address[%END%]</span>
<br />
[% IF current_subscriber.escaped_bounce_address %]
<label>[%|loc%]Address detected via VERP technology[%END%] </label>[% current_subscriber.escaped_bounce_address %]<br />
[% END %]
[%|loc%]Status:[%END%] [% current_subscriber.bounce_status %] ([% current_subscriber.bounce_code %])<br />
[%|loc%]Bounce count:[%END%] [% current_subscriber.bounce_count %]<br />
[%|loc%]Period:[%END%] [%|loc(current_subscriber.first_bounce,current_subscriber.last_bounce)%]from %1 to %2[%END%]<br />
<a href="[% path_cgi %]/viewbounce/[% list %]/[% current_subscriber.escaped_email %]">[%|loc%]View last bounce[%END%]</a><br />
<input class="MainMenuLinks" type="submit" name="action_resetbounce" value="[%|loc%]Reset errors[%END%]" /><br />
[% END %]
</select>
</div>
[% ELSE %]
<div class="form_row">
<label for="additional_field_[% field.key %]">[% field.key %][%|loc%]:[%END%]</label>
<input type="text" name="additional_field_[% field.key %]" id="additional_field_[% field.key %]" value="[% field.value.value %]" size="25" />
</div>
[% END %]
[% END %]
[% END %]
<div class="form_row">
<input class="MainMenuLinks" type="submit" name="action_set" value="[%|loc%]Update[%END%]" />
</div>
<div class="form_row">
<input class="MainMenuLinks" type="submit" name="action_del" value="[%|loc%]Unsubscribe the User[%END%]" />
<p><input id="quiet" type="checkbox" name="quiet" /> [%|loc%]Quiet (don't send deletion email)[%END%]</p>
</div>
[% IF current_subscriber.bounce %]
<h3 class="bg_color_error">[%|loc%]Bouncing address[%END%]</h3>
[% IF current_subscriber.escaped_bounce_address %]
<div class="form_row">
<label>[%|loc%]Address detected via VERP technology[%END%] </label>
[% current_subscriber.escaped_bounce_address %]
</div>
[% END %]
<div class="form_row">
<label>[%|loc%]Status:[%END%] </label>
[% current_subscriber.bounce_status %] ([% current_subscriber.bounce_code %])
</div>
<div class="form_row">
<label>[%|loc%]Bounce count:[%END%] </label>
[% current_subscriber.bounce_count %]
</div>
<div class="form_row">
<label>[%|loc%]Period:[%END%] </label>
[%|loc(current_subscriber.first_bounce,current_subscriber.last_bounce)%]from %1 to %2[%END%]
</div>
<p><a href="[% path_cgi %]/viewbounce/[% list %]/[% current_subscriber.escaped_email %]">[%|loc%]View last bounce[%END%]</a></p>
<div class="form_row">
<input class="MainMenuLinks" type="submit" name="action_resetbounce" value="[%|loc%]Reset errors[%END%]" />
</div>
[% END %]
</fieldset>
</form>
</div>
<!-- end editsubscriber.tt2 -->
<!-- $Id$ -->
<div class="block">
[% IF user.email %]
<h2>[%|loc%]Manage your subscriptions[%END%] <a class="input" href="[%path_cgi %]/help/suspend">[%|loc%]Help[%END%]</a></h2>
<h2>[%|loc%]My lists[%END%]</h2>
<p>[%|loc%]You are subscribed to the following lists[%END%]</p>
<p>[%|loc%]You are subscribed to or managing the following lists.[%END%]</p>
<form class="noborder" action="[% path_cgi %]" method="post" name="suspend_request">
[% IF which.size %]
<div class="item_list">
[% FOREACH l = which %]
[% suspended = 0 %]
[% suspendable = 0 %]
[% additional_class = '' %]
[% IF l.value.is_subscriber %]
[% suspendable = 1 %]
[% END %]
[% IF l.value.listsuspend %]
[% suspended = 1 %]
[% additional_class = ' suspended' %]
[% END %]
<div class="item[% additional_class %]">
......@@ -37,26 +30,16 @@
)</span>
[% END %]
</a>
[% IF suspendable %]
[% IF suspended %]
[%|loc(l.value.liststartdate)%]Suspended from %1 to[% END %]
[% IF l.value.listenddate %]
[% l.value.listenddate %]
[% ELSE %]
[%|loc%]indefinite end date[%END%]
[% END %]<br/>
<input id="listname.[% l.key %]" type="checkbox" checked="checked" name="listname" value="[% l.key %]" />
<label for="listname.[% l.key %]">[%|loc(l.key)%]Check to restore reception from list %1[% END %]</label>
<p class="list_subject">[% l.value.subject %]</p>
[% IF l.value.listsuspend %]
[% IF l.value.listenddate %]
<p>[%|loc(l.value.liststartdate,l.value.listenddate)%]Suspended from %1 to %2[% END %]</p>
[% ELSE %]
<input id="listname.[% l.key %]" type="checkbox" checked="checked" name="listname" value="[% l.key %]" />
<label for="listname.[% l.key %]">[%|loc(l.key)%]Check to suspend or unsubscribe from list %1[% END %]</label>
<p>[%|loc(l.value.liststartdate)%]Suspended from %1 to indefinite end date[%END%]</p>
[% END %]
[% ELSE %]
<p class="note">[%|loc%]You are not allowed to suspend your subscription / unsusbscribe from this list.[% END %]
[% END %]
<p class="list_subject">[% l.value.subject %]</p>
<ul>
[% IF l.value.is_owner %]
<li><a href="[% path_cgi %]/review/[% l.key %]">[%|loc%]Review members[%END%]</a></li>
......@@ -70,35 +53,16 @@
</div>
[% END %]
</div>
[% ELSE %]
<p>[%|loc%]No subscription.[%END%]</p>
[% END %]
<p>[%|loc%]You can bulk suspend or revoke your memberships by selecting relevant lists and using the buttons below. The suspend option prevents delivery of emails, this can be useful if you are out of the office for some time.[%END%]</p>
<input class="MainMenuLinks" type="button" value="[%|loc%]Toggle selection[%END%]" onclick="toggle_selection(document.suspend_request.listname)" />
<br />
<input type="hidden" name="action" value="suspend_request_action"/>
<input class="MainMenuLinks" type="submit" name="sub_action_suspendsave" value="[%|loc%]Suspend my subscriptions[%END%]"/>
[%|loc%]From:[%END%] <noscript>(dd-mm-yyyy)</noscript><input type="text" id="date_deb" name="date_deb" maxlength="10" size="10" value="[% d_day %]" onfocus="visuCal(this,param_ddeb);" onblur="masqueCal(this);" />
[%|loc%]To:[%END%] <noscript>(dd-mm-yyyy)</noscript><input type="text" id="date_fin" name="date_fin" maxlength="10" size="10" onfocus="visuCal(this,param_dfin)" onblur="masqueCal(this)" />
<input type="checkbox" name="indefinite" />[%|loc%]Suspend my membership indefinitely[%END%]
<br />
[% IF suspended %]
<input class="MainMenuLinks" type="submit" name="sub_action_suspendstop" value="[%|loc%]Resume my subscriptions[%END%]"/>
<br />
[% END %]
<input class="MainMenuLinks" type="submit" name="sub_action_signoff" value="[%|loc%]Unsubscribe[%END%]"/>
</form>
[% ELSE %]
[%|loc%]You need to be logged in to access this page.[%END%]
[% END %]
</div>
<!-- end suspend_request.tt2 -->
<!-- end my.tt2 -->
......@@ -14,9 +14,8 @@
</div>
<div class="form_row">
<input type="hidden" name="list" value="[% list %]" />
<label> [%|loc%]Receiving mode:[%END%] </label>
<select name="reception">
<label for="reception"> [%|loc%]Receiving mode:[%END%] </label>
<select name="reception" id="reception">
[% FOREACH r = reception %]
<option value="[% r.key %]" [% r.value.selected %]>[% r.value.description %]</option>
[% END %]
......@@ -58,19 +57,79 @@
[%END%]
<div class="form_row">
<label> [%|loc%]Visibility:[%END%] </label>
<select name="visibility">
<label for="visibility"> [%|loc%]Visibility:[%END%] </label>
<select id="visibility" name="visibility">
[% FOREACH r = visibility %]
<option value="[% r.key %]" [% r.value.selected %]>[% r.value.description %]</option>
[% END %]
</select>
</div>
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="previous_action" value="[% action %]" />
<div class="form_row">
<input class="MainMenuLinks" type="submit" name="action_set" value="[%|loc%]Update[%END%]" />
</div>
</form><br /><br />
<form action="[%path_cgi%]" method="POST">
[% IF subscriber.suspend %]
<h3>[%|loc%]Restore subscription[%END%]
<a class="actionMenuLinks" href="[%path_cgi %]/help/suspend">[%|loc%]Help[%END%]</a>
</h3>
<p>[%|loc%]Your subscription is suspended.[%END%]</p>
<div class="form_row">
<label>[%|loc%]From:[%END%] </label>
[% subscriber.startdate %]
</div>
<div class="form_row">
<label>[%|loc%]To:[%END%] </label>
[% IF subscriber.enddate %]
[% subscriber.enddate %]
[% ELSE %]
[%|loc%]Indefinite end date[% END %]
[% END %]
</div>
<input type="hidden" name="listname" value="[% list %]" />
<input type="hidden" name="action" value="suspend_request_action" />
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="previous_action" value="[% action %]" />
<div class="form_row">
<input class="MainMenuLinks" type="submit" name="sub_action_suspendstop" value="[%|loc%]Resume my subscription[%END%]" />
</div>
[% ELSE %]
<h3>[%|loc%]Suspend subscription[%END%]
<a class="actionMenuLinks" href="[%path_cgi %]/help/suspend">[%|loc%]Help[%END%]</a>
</h3>
<p>[%|loc%]You can suspend your membership by using the button below. The suspend option prevents delivery of emails, this can be useful if you are out of the office for some time.[%END%]</p>
<div class="form_row">
<label for="date_deb">[%|loc%]From:[%END%] </label>
<input type="text" id="date_deb" name="date_deb" maxlength="10" size="10" value="[% d_day %]" onfocus="visuCal(this,param_ddeb);" onblur="masqueCal(this);" />
<noscript>(dd-mm-yyyy)</noscript>
</div>
<div class="form_row">
<label for="date_fin">[%|loc%]To:[%END%] </label>
<input type="text" id="date_fin" name="date_fin" maxlength="10" size="10" onfocus="visuCal(this,param_dfin)" onblur="masqueCal(this)" />
<noscript>(dd-mm-yyyy)</noscript>
<input type="checkbox" name="indefinite" />[%|loc%]Suspend my membership indefinitely[%END%]
</div>
<input type="hidden" name="listname" value="[% list %]" />
<input type="hidden" name="action" value="suspend_request_action"/>
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="previous_action" value="[% action %]" />
<div class="form_row">
<input class="MainMenuLinks" type="submit" name="sub_action_suspendsave" value="[%|loc%]Suspend my subscriptions[%END%]" />
</div>
[% END %]
</form>
[% PROCESS picture_upload.tt2 %]
<!-- end suboptions.tt2 -->
......@@ -39,10 +39,10 @@
[%|loc%]indefinite end date[%END%]
[% END %]<br/>
<input id="listname.[% sub.listname %]" type="checkbox" checked="checked" name="listname" value="[% l.key %]" />
<label for="listname">[%|loc(l.key)%]Check to restore reception from list %1[% END %]</label>
<label for="listname.[% sub.listname %]">[%|loc(l.key)%]Check to restore reception from list %1[% END %]</label>
[% ELSE %]
<input id="listname.[% sub.listname %]" type="checkbox" checked="checked" name="listname" value="[% l.key %]" />
<label for="listname">[%|loc(l.key)%]Check to suspend or unsubscribe from list %1[% END %]</label>
<label for="listname.[% sub.listname %]">[%|loc(l.key)%]Check to suspend or unsubscribe from list %1[% END %]</label>
[% END %]
[% ELSE %]
<p class="note">[%|loc%]You are not allowed to suspend your subscription / unsusbscribe from this list.[% END %]
......
......@@ -313,6 +313,7 @@ our %comm = (
'ticket' => 'do_ticket',
'manage_template' => 'do_manage_template',
#XXX'send_newsletter' => 'do_send_newsletter',
'suspend' => 'do_suspend',
'suspend_request' => 'do_suspend_request',
'suspend_request_action' => 'do_suspend_request_action',
'show_exclude' => 'do_show_exclude',
......@@ -456,6 +457,7 @@ our %action_args = (
'manage_template' => ['subaction', 'list', 'message_template'],
'send_newsletter' => [],
'compose_mail' => ['list', 'subaction'],
'suspend' => ['list'],
'suspend_request' => ['subaction'],
'show_exclude' => ['list'],
'ca' => ['custom_action', '@cap'],
......@@ -593,6 +595,7 @@ our %required_args = (
'subrequest' => ['param.list'],
'subscribe' => ['param.list'],
'subscriber_count' => ['param.list'],
'suspend' => ['param.list', 'param.user.email'],
'suspend_request' => [],
'suspend_request_action' => [],
'show_exclude' => ['param.list'],
......@@ -21409,6 +21412,10 @@ sub do_change_email {
 
}
 
sub do_suspend {
goto &do_suspend_request_action; # "&" is required.
}
####################################################
# do_suspend_request
####################################################
......@@ -21578,6 +21585,8 @@ sub do_suspend_request_action {
my @lists;
my $data;
 
my $previous_action = $in{'previous_action'} || 'suspend_request';
if ($in{'sub_action'} eq 'suspendsave') {
 
# to retrieve the selected list
......@@ -21601,7 +21610,7 @@ sub do_suspend_request_action {
wwslog('info',
'suspend_request: must picked one or more list(s) you are subscribed'
);
return 'suspend_request';
return $previous_action;
}
 
if ($in{'date_deb'}) {
......@@ -21623,14 +21632,14 @@ sub do_suspend_request_action {
{'argument' => 'Start Date doesn\'t exist.'},
$param->{'action'});
wwslog('info', 'Date doesn\'t exist');
return 'suspend_request';
return $previous_action;
}
} else {
Sympa::Report::reject_report_web('user', 'missing_arg',
{'argument' => 'Start Date doesn\'t exist.'},
$param->{'action'});
wwslog('info', 'Date doesn\'t exist');
return 'suspend_request';
return $previous_action;
}
## Case 1 : Start date & End date (without indefinite)
if (($in{'date_fin'}) && (!$in{'indefinite'})) {
......@@ -21653,14 +21662,14 @@ sub do_suspend_request_action {
{'argument' => 'End Date doesn\'t exist.'},
$param->{'action'});
wwslog('info', 'Date doesn\'t exist');
return 'suspend_request';
return $previous_action;
}
} else {
Sympa::Report::reject_report_web('user', 'missing_arg',
{'argument' => 'End Date doesn\'t exist.'},
$param->{'action'});
wwslog('info', 'Date doesn\'t exist');
return 'suspend_request';
return $previous_action;
}
 
unless ($data->{'startdate'} <= $data->{'enddate'}) {
......@@ -21675,7 +21684,7 @@ sub do_suspend_request_action {
wwslog('info',
'suspend_request: The start date must be less than the end date.'
);
return 'suspend_request';
return $previous_action;
}
## Case 2 : Start date & without indefinite (without end date)
} elsif ((!$in{'date_fin'}) && ($in{'indefinite'})) {
......@@ -21692,7 +21701,7 @@ sub do_suspend_request_action {
wwslog('info',
'suspend_request: missing argument for the end date or syntax error : dd/mm/yyyy or must choose a end date or indefinite end date'
);
return 'suspend_request';
return $previous_action;
}
} else {
Sympa::Report::reject_report_web('user', 'missing_arg',
......@@ -21701,7 +21710,7 @@ sub do_suspend_request_action {
wwslog('info',
'suspend_request: missing argument for the start date or syntax error : dd/mm/yyyy'
);
return 'suspend_request';
return $previous_action;
}
 
## Suspend subscription
......@@ -21713,7 +21722,7 @@ sub do_suspend_request_action {
)
) {
wwslog('info', 'Can\'t do List suspend_subscription');
return 'suspend_request';
return $previous_action;
}
}
 
......@@ -21735,7 +21744,7 @@ sub do_suspend_request_action {
{'argument' => 'must picked one or more list(s)'},
$param->{'action'});
wwslog('info', 'Must picked one or more list(s)');
return 'suspend_request';
return $previous_action;
}
Sympa::Report::notice_report_web('performed', {},
"Resume the subscription for the list(s)");
......@@ -21787,7 +21796,7 @@ sub do_suspend_request_action {
{'argument' => 'must picked one or more list(s)'},
$param->{'action'});
wwslog('info', 'Must picked one or more list(s)');
return 'suspend_request';
return $previous_action;
}
 
Sympa::Report::notice_report_web($report, {}, '');
......@@ -21798,7 +21807,7 @@ sub do_suspend_request_action {
return undef;
}
 
return 'suspend_request';
return $previous_action;
}
 
####################################################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment