Commit 0c334bda authored by salaun's avatar salaun
Browse files

[Florent Guilleux] New feature: Task manager

wwsympa/wws_templates/fr/edit_list_request.fr.tpl
Various task automatic processing. List master may use predefined
task models to automate recurrent processings such as regurlaly
reminding subscribers their belonging to a list or updating certificate
revocation lists. It is also possible to write one's own task models to
meet particular needs. Unique actions may also be scheduled by this way.


git-svn-id: https://subversion.renater.fr/sympa/trunk@709 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent f5de9824
......@@ -275,7 +275,8 @@ installdir:
fi
@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
echo "First installation : installing conf directories..."; \
for dir in etc/create_list_templates etc/templates etc/wws_templates etc/scenari ; do \
for dir in etc/create_list_templates etc/templates etc/wws_templates etc/scenari \
etc/task_models etc/general_task_models; do \
if [ ! -d $(DESTDIR)$(DIR)/$$dir ] ; then \
echo "Creating $(DESTDIR)$(DIR)/$$dir"; \
mkdir -p $(DESTDIR)$(DIR)/$$dir; \
......@@ -287,7 +288,8 @@ installdir:
@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
echo "First installation : installing spool directories..."; \
for dir in $(SPOOLDIR) $(SPOOLDIR)/msg $(SPOOLDIR)/digest $(SPOOLDIR)/moderation \
$(SPOOLDIR)/expire $(SPOOLDIR)/auth $(SPOOLDIR)/outgoing $(SPOOLDIR)/tmp ; do \
$(SPOOLDIR)/expire $(SPOOLDIR)/auth $(SPOOLDIR)/outgoing $(SPOOLDIR)/tmp \
$(SPOOLDIR)/task ; do \
if [ ! -d $(DESTDIR)$$dir ] ; then \
echo "Creating $(DESTDIR)$$dir"; \
mkdir -p $(DESTDIR)$$dir; \
......
......@@ -2139,6 +2139,11 @@ sub send_file {
$data->{'subscriber'} = $self->get_subscriber($who);
if ($data->{'subscriber'}) {
$data->{'subscriber'}{'date'} = &POSIX::strftime("%d %b %Y", localtime($data->{'subscriber'}{'date'}));
$data->{'subscriber'}{'update_date'} = &POSIX::strftime("%d %b %Y", localtime($data->{'subscriber'}{'update_date'}));
}
unless ($data->{'user'}{'password'}) {
$data->{'user'}{'password'} = &tools::tmp_passwd($who);
}
......@@ -2155,6 +2160,7 @@ sub send_file {
}
## Lang
&do_log('debug', 'LANG: %s', $data->{'user'}{'lang'});
my $lang = $data->{'user'}{'lang'} || $self->{'lang'} || $Conf{'lang'};
## What file
......
......@@ -154,6 +154,26 @@
[END]
[ENDIF]
[ELSIF p->type=task]
<!-- Task -->
[IF p->may_edit=write]
<SELECT NAME="single_param.[p->name].name">
[FOREACH task IN p->value]
<OPTION VALUE="[task->name]"
[IF task->selected=1]
SELECTED
[ENDIF]
>[task->title] ([task->name])
[END]
</SELECT>
[ELSIF p->may_edit=read]
[FOREACH task IN p->value]
[IF task->selected=1]
[task->title] ([task->name])
[ENDIF]
[END]
[ENDIF]
[ELSIF p->type=paragraph]
<!-- Paragraph -->
[FOREACH key IN p->value]
......@@ -184,6 +204,26 @@
[END]
[ENDIF]
[ELSIF key->type=task]
<!-- Task -->
[IF key->may_edit=write]
<SELECT NAME="single_param.[p->name].[key->name].name">
[FOREACH task IN key->value]
<OPTION VALUE="[task->name]"
[IF task->selected=1]
SELECTED
[ENDIF]
>[task->title] ([task->name])
[END]
</SELECT>
[ELSIF key->may_edit=read]
[FOREACH task IN key->value]
[IF task->selected=1]
[task->title] ([task->name])
[ENDIF]
[END]
[ENDIF]
[ELSIF key->type=enum]
<!-- Enum -->
[IF key->may_edit=write]
......
......@@ -154,6 +154,26 @@
[END]
[ENDIF]
[ELSIF p->type=task]
<!-- Task -->
[IF p->may_edit=write]
<SELECT NAME="single_param.[p->name].name">
[FOREACH task IN p->value]
<OPTION VALUE="[task->name]"
[IF task->selected=1]
SELECTED
[ENDIF]
>[task->title] ([task->name])
[END]
</SELECT>
[ELSIF p->may_edit=read]
[FOREACH task IN p->value]
[IF task->selected=1]
[task->title] ([task->name])
[ENDIF]
[END]
[ENDIF]
[ELSIF p->type=paragraph]
<!-- Paragraph -->
[FOREACH key IN p->value]
......@@ -184,6 +204,26 @@
[END]
[ENDIF]
[ELSIF key->type=task]
<!-- Task -->
[IF key->may_edit=write]
<SELECT NAME="single_param.[p->name].[key->name].name">
[FOREACH task IN key->value]
<OPTION VALUE="[task->name]"
[IF task->selected=1]
SELECTED
[ENDIF]
>[task->title] ([task->name])
[END]
</SELECT>
[ELSIF key->may_edit=read]
[FOREACH task IN key->value]
[IF task->selected=1]
[task->title] ([task->name])
[ENDIF]
[END]
[ENDIF]
[ELSIF key->type=enum]
<!-- Enum -->
[IF key->may_edit=write]
......
......@@ -118,6 +118,7 @@ sub load_config {
icons_url => '/icons',
mhonarc => '/usr/bin/mhonarc',
review_page_size => 25,
task_manager_pidfile => 'task_manager.pid',
title => 'Mailing Lists Service',
use_fast_cgi => 1,
wws_path => '--BINDIR--',
......
......@@ -4362,7 +4362,7 @@ sub do_edit_list {
foreach my $i (0..$#{$p}) {
## Scenario
if ($pinfo->{$pname}{'scenario'}) {
if ($pinfo->{$pname}{'scenario'} || $pinfo->{$pname}{'task'}) {
if ($p->[$i]{'name'} ne $new_p->[$i]{'name'}) {
$changed{$pname} = 1; next;
}
......@@ -4374,7 +4374,7 @@ sub do_edit_list {
next unless ($list->may_edit("$pname.$key",$param->{'user'}{'email'}) eq 'write');
if ($pinfo->{$pname}{'format'}{$key}{'scenario'}) {
if ($pinfo->{$pname}{'format'}{$key}{'scenario'} || $pinfo->{$pname}{'format'}{$key}{'task'}) {
if ($p->[$i]{$key}{'name'} ne $new_p->[$i]{$key}{'name'}) {
$changed{$pname} = 1; next;
}
......@@ -4692,7 +4692,7 @@ sub _prepare_data {
## Type of data
if ($struct->{'scenario'}) {
$p_glob->{'type'} = 'scenario';
my $list_of_scenario = $list->load_scenario_list($struct->{'scenario'});
my $list_of_scenario = $list->load_scenario_list($struct->{'scenario'},$robot);
$list_of_scenario->{$d->{'name'}}{'selected'} = 1;
......@@ -4702,6 +4702,18 @@ sub _prepare_data {
$p->{'value'} = $list_of_scenario;
}elsif ($struct->{'task'}) {
$p_glob->{'type'} = 'task';
my $list_of_task = $list->load_task_list($struct->{'task'}, $robot);
$list_of_task->{$d}{'selected'} = 1;
foreach my $key (keys %{$list_of_task}) {
$list_of_task->{$key}{'title'} = $list_of_task->{$key}{'title'}{$param->{'lang'}} || $key;
}
$p->{'value'} = $list_of_task;
}elsif (ref ($struct->{'format'}) eq 'HASH') {
$p_glob->{'type'} = 'paragraph';
unless (ref($d) eq 'HASH') {
......
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