forked from CGM_Public/pretix_original
Scheduled exports (#3033)
This commit is contained in:
@@ -7,6 +7,86 @@
|
||||
<h1>
|
||||
{% trans "Data export" %}
|
||||
</h1>
|
||||
{% if scheduled %}
|
||||
<h2>{% trans "Scheduled exports" %}</h2>
|
||||
<ul class="list-group">
|
||||
{% for s in scheduled %}
|
||||
<li class="list-group-item logentry">
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-4 col-xs-12">
|
||||
<span class="fa fa-fw fa-folder"></span>
|
||||
{{ s.export_verbose_name }}
|
||||
<br>
|
||||
<span class="text-muted">
|
||||
<span class="fa fa-fw fa-user"></span>
|
||||
{{ s.owner.fullname|default:s.owner.email }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-lg-5 col-md-6 col-xs-12">
|
||||
{% if s.schedule_next_run %}
|
||||
<span class="fa fa-clock-o fa-fw"></span>
|
||||
{% trans "Next run:" %}
|
||||
{{ s.schedule_next_run|date:"SHORT_DATETIME_FORMAT" }}
|
||||
{% else %}
|
||||
<span class="fa fa-clock-o fa-fw"></span>
|
||||
{% trans "No next run scheduled" %}
|
||||
{% endif %}
|
||||
{% if s.export_verbose_name == "?" %}
|
||||
<strong class="text-danger">
|
||||
<span class="fa fa-warning fa-fw"></span>
|
||||
{% trans "Exporter not found" %}
|
||||
</strong>
|
||||
{% elif s.error_counter >= 5 %}
|
||||
<strong class="text-danger">
|
||||
<span class="fa fa-warning fa-fw"></span>
|
||||
{% trans "Disabled due to multiple failures" %}
|
||||
</strong>
|
||||
{% elif s.error_counter > 0 %}
|
||||
<strong class="text-danger">
|
||||
<span class="fa fa-warning fa-fw"></span>
|
||||
{% trans "Failed recently" %}
|
||||
</strong>
|
||||
{% endif %}
|
||||
<span class="text-muted">
|
||||
<br>
|
||||
<span class="fa fa-fw fa-envelope-o"></span>
|
||||
{{ s.mail_subject }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-xs-12 text-right">
|
||||
<form action="{% url "control:event.orders.export.do" event=request.event.slug organizer=request.organizer.slug %}"
|
||||
method="post" class="form-horizontal" data-asynctask data-asynctask-download
|
||||
data-asynctask-long>
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="exporter" value="{{ s.export_identifier }}"/>
|
||||
<input type="hidden" name="scheduled" value="{{ s.pk }}"/>
|
||||
{% if s.export_verbose_name != "?" %}
|
||||
<button type="submit" class="btn btn-default" title="{% trans "Run export now" %}" data-toggle="tooltip">
|
||||
<span class="fa fa-download"></span>
|
||||
</button>
|
||||
<button formaction="{% url "control:event.orders.export.scheduled.run" organizer=request.organizer.slug event=request.event.slug pk=s.pk %}"
|
||||
type="submit"
|
||||
title="{% trans "Run export and send via email now. This will not change the next scheduled execution." %}"
|
||||
data-toggle="tooltip" class="btn btn-default" data-no-asynctask>
|
||||
<span class="fa fa-play" aria-hidden="true"></span>
|
||||
</button>
|
||||
<a href="?identifier={{ s.export_identifier }}&scheduled={{ s.pk }}" class="btn btn-default" title="{% trans "Edit" %}" data-toggle="tooltip">
|
||||
<span class="fa fa-edit"></span>
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="{% url "control:event.orders.export.scheduled.delete" event=request.event.slug organizer=request.event.organizer.slug pk=s.pk %}" class="btn btn-danger" title="{% trans "Delete" %}" data-toggle="tooltip">
|
||||
<span class="fa fa-trash"></span>
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if is_paginated %}
|
||||
{% include "pretixcontrol/pagination.html" %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% regroup exporters by category as category_list %}
|
||||
{% for c, c_ex in category_list %}
|
||||
{% if c %}
|
||||
@@ -20,7 +100,8 @@
|
||||
<h4>
|
||||
{{ e.verbose_name }}
|
||||
{% if e.featured %}
|
||||
<span class="fa fa-star text-success" data-toggle="tooltip" title="{% trans "Recommended for new users" %}" aria-hidden="true"></span>
|
||||
<span class="fa fa-star text-success" data-toggle="tooltip"
|
||||
title="{% trans "Recommended for new users" %}" aria-hidden="true"></span>
|
||||
{% endif %}
|
||||
</h4>
|
||||
{% if e.description %}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{% extends "pretixcontrol/event/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Delete scheduled export" %}{% endblock %}
|
||||
{% block content %}
|
||||
<h1>{% trans "Delete scheduled export" %}</h1>
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
{% csrf_token %}
|
||||
<p>{% blocktrans %}Are you sure you want to delete the scheduled export <strong>{{ export }}</strong>?{% endblocktrans %}</p>
|
||||
<div class="form-group submit-group">
|
||||
<a href="{% url "control:event.orders.export" organizer=request.event.organizer.slug event=request.event.slug %}" class="btn btn-default btn-cancel">
|
||||
{% trans "Cancel" %}
|
||||
</a>
|
||||
<button type="submit" class="btn btn-danger btn-save">
|
||||
{% trans "Delete" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -1,7 +1,6 @@
|
||||
{% extends "pretixcontrol/event/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% load order_overview %}
|
||||
{% block title %}{% trans "Data export" %}{% endblock %}
|
||||
{% block content %}
|
||||
<h1>
|
||||
@@ -15,16 +14,38 @@
|
||||
{% if exporter.description %}
|
||||
<p class="help-block">{{ exporter.description }}</p>
|
||||
{% endif %}
|
||||
{% if schedule_form %}
|
||||
{% bootstrap_form_errors schedule_form layout='control' %}
|
||||
{% endif %}
|
||||
<form action="{% url "control:event.orders.export.do" event=request.event.slug organizer=request.organizer.slug %}"
|
||||
method="post" class="form-horizontal" data-asynctask data-asynctask-download
|
||||
data-asynctask-long>
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="exporter" value="{{ exporter.identifier }}"/>
|
||||
{% bootstrap_form exporter.form layout='control' %}
|
||||
<div class="form-group submit-group">
|
||||
<button type="submit" class="btn btn-primary btn-save">
|
||||
{% trans "Start export" %}
|
||||
</button>
|
||||
</div>
|
||||
<fieldset>
|
||||
<legend>{% trans "Export options" %}</legend>
|
||||
{% bootstrap_form exporter.form layout='control' %}
|
||||
</fieldset>
|
||||
{% if schedule_form %}
|
||||
{% include "pretixcontrol/orders/fragment_export_schedule_form.html" %}
|
||||
<div class="form-group submit-group">
|
||||
<button formaction="{{ request.get_full_path }}" name="schedule" value="save" type="submit"
|
||||
class="btn btn-primary btn-save" data-no-asynctask>
|
||||
{% trans "Save" %}
|
||||
</button>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="form-group submit-group">
|
||||
<button type="submit" class="btn btn-primary btn-save">
|
||||
<span class="fa fa-download" aria-hidden="true"></span>
|
||||
{% trans "Start export" %}
|
||||
</button>
|
||||
<button formaction="{{ request.get_full_path }}" name="schedule" value="start" type="submit"
|
||||
class="btn btn-default btn-alternative" data-no-asynctask>
|
||||
<span class="fa fa-clock-o" aria-hidden="true"></span>
|
||||
{% trans "Schedule export" %}
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% load captureas %}
|
||||
|
||||
<fieldset>
|
||||
<legend>{% trans "Schedule" %}</legend>
|
||||
{% bootstrap_field schedule_form.schedule_rrule_time layout='control' %}
|
||||
{% if schedule_form.timezone %}
|
||||
{% bootstrap_field schedule_form.timezone layout='control' %}
|
||||
{% endif %}
|
||||
{% bootstrap_form_errors rrule_form layout='control' %}
|
||||
|
||||
{% bootstrap_field rrule_form.dtstart layout="control" %}
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">{% trans "Repetition schedule" %}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="form-inline rrule-form">
|
||||
{% captureas ffield_freq %}
|
||||
{% bootstrap_field rrule_form.freq layout="inline" %}
|
||||
{% endcaptureas %}
|
||||
{% captureas ffield_interval %}
|
||||
{% bootstrap_field rrule_form.interval layout="inline" %}
|
||||
{% endcaptureas %}
|
||||
{% captureas ffield_yearly_bysetpos %}
|
||||
{% bootstrap_field rrule_form.yearly_bysetpos layout="inline" %}
|
||||
{% endcaptureas %}
|
||||
{% captureas ffield_yearly_byweekday %}
|
||||
{% bootstrap_field rrule_form.yearly_byweekday layout="inline" %}
|
||||
{% endcaptureas %}
|
||||
{% captureas ffield_yearly_bymonth %}
|
||||
{% bootstrap_field rrule_form.yearly_bymonth layout="inline" %}
|
||||
{% endcaptureas %}
|
||||
{% captureas ffield_monthly_bysetpos %}
|
||||
{% bootstrap_field rrule_form.monthly_bysetpos layout="inline" %}
|
||||
{% endcaptureas %}
|
||||
{% captureas ffield_monthly_byweekday %}
|
||||
{% bootstrap_field rrule_form.monthly_byweekday layout="inline" %}
|
||||
{% endcaptureas %}
|
||||
{% captureas ffield_count %}
|
||||
{% bootstrap_field rrule_form.count layout="inline" %}
|
||||
{% endcaptureas %}
|
||||
{% captureas ffield_until %}
|
||||
{% bootstrap_field rrule_form.until layout="inline" %}
|
||||
{% endcaptureas %}
|
||||
|
||||
{% blocktrans trimmed with freq=ffield_freq interval=ffield_interval start=ffield_dtstart %}
|
||||
Repeat every {{ interval }} {{ freq }}
|
||||
{% endblocktrans %}<br>
|
||||
|
||||
<div class="repeat-yearly">
|
||||
<div class="radio">
|
||||
<label>
|
||||
{{ rrule_form.yearly_same.0 }}
|
||||
{% trans "At the same date every year" %}
|
||||
</label><br>
|
||||
<label>
|
||||
{{ rrule_form.yearly_same.1 }}
|
||||
{% blocktrans trimmed with setpos=ffield_yearly_bysetpos weekday=ffield_yearly_byweekday month=ffield_yearly_bymonth %}
|
||||
On the {{ setpos }} {{ weekday }} of {{ month }}
|
||||
{% endblocktrans %}<br>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="repeat-monthly">
|
||||
<div class="radio">
|
||||
<label>
|
||||
{{ rrule_form.monthly_same.0 }}
|
||||
{% trans "At the same date every month" %}
|
||||
</label><br>
|
||||
<label>
|
||||
{{ rrule_form.monthly_same.1 }}
|
||||
{% blocktrans trimmed with setpos=ffield_monthly_bysetpos weekday=ffield_monthly_byweekday %}
|
||||
On the {{ setpos }} {{ weekday }}
|
||||
{% endblocktrans %}<br>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="repeat-weekly">
|
||||
{% bootstrap_field rrule_form.weekly_byweekday layout="inline" %}
|
||||
</div>
|
||||
<div class="repeat-until">
|
||||
<div class="radio">
|
||||
<label>
|
||||
{{ rrule_form.end.0 }}
|
||||
{% blocktrans trimmed with count=ffield_count %}
|
||||
Repeat for {{ count }} times
|
||||
{% endblocktrans %}
|
||||
</label><br>
|
||||
<label>
|
||||
{{ rrule_form.end.1 }}
|
||||
{% blocktrans trimmed with until=ffield_until %}
|
||||
Repeat until {{ until }}
|
||||
{% endblocktrans %}<br>
|
||||
</label><br>
|
||||
<label>
|
||||
{{ rrule_form.end.2 }}
|
||||
{% blocktrans trimmed %}
|
||||
Forever
|
||||
{% endblocktrans %}<br>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{% trans "Email" %}</legend>
|
||||
<div class="alert alert-info">
|
||||
{% trans "Every time your schedule is executed, the report will be sent via email." %}
|
||||
{% trans "Please note the following limitations:" %}
|
||||
<ul>
|
||||
<li>
|
||||
{% trans "Email is not a strongly encrypted medium. We only recommend using this for exports that output e.g. statistical data, not for reports that include sensitive personal data." %}
|
||||
</li>
|
||||
<li>
|
||||
{% trans "Email is not made for large files. If your export ends up to be larger than 20 megabytes, it will not be sent." %}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label" for="id_schedule-owner">{% trans "Owner" %}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" name="schedule-owner" value="{{ schedule_form.instance.owner.email }}" disabled
|
||||
class="form-control" title=""
|
||||
id="id_schedule-owner">
|
||||
<div class="help-block">
|
||||
{% trans "The export will be performed using the owner's permission level, i.e. if the owner loses access to the data, the report will stop." %}
|
||||
{% trans "The owner will receive the result as well as any error messages." %}
|
||||
{% trans "The additional recipients you add below will only receive an email if the report was successful." %}
|
||||
{% trans "All recipients of the export will be able to see who the owner of the report is." %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% bootstrap_field schedule_form.mail_additional_recipients layout='control' %}
|
||||
{% bootstrap_field schedule_form.mail_additional_recipients_cc layout='control' %}
|
||||
{% bootstrap_field schedule_form.mail_additional_recipients_bcc layout='control' %}
|
||||
{% bootstrap_field schedule_form.locale layout='control' %}
|
||||
{% bootstrap_field schedule_form.mail_subject layout='control' %}
|
||||
{% bootstrap_field schedule_form.mail_template layout='control' %}
|
||||
</fieldset>
|
||||
Reference in New Issue
Block a user