7 Commits

Author SHA1 Message Date
flovntp
8b29a92aab Update CHANGELOG.md 2020-06-03 14:57:13 +02:00
flovntp
c824c0ecbb Update ContentWriter.php (#31) 2020-06-03 14:18:12 +02:00
Nicolas Lœuillet
760aea3948 Fixed 🇫🇷 translation (#30) 2019-12-20 10:39:04 +01:00
jbcr
e1213d4a74 add v2.0.1 changelog (#29) 2019-12-05 16:24:18 +01:00
jbcr
5f3775cb6b enclosure js code into anonymous function (#28)
* encosure js code into annonymous function
2019-12-05 15:24:17 +01:00
jbcr
ec42d6f765 add right informations (#27)
* add right informations

* Update README.md

Co-Authored-By: jeremycr <32451794+jeremycr@users.noreply.github.com>
2019-12-05 15:11:10 +01:00
jeremycr
deab8e8073 Remove redundant code (#23) 2019-11-28 14:17:26 +01:00
10 changed files with 339 additions and 300 deletions

View File

@@ -1,3 +1,10 @@
# version 2.1.0
* contentWriter return created content
# version 2.0.1
* Enclosure js code into anonymous function
# version 2.0.0
* Update to use Dataflow v2.0+

View File

@@ -302,6 +302,10 @@ Go to the eZ Dataflow admin UI and click on the "Oneshot" tab. Click on the "+"
Finally, click on the "Create" button.
# Rights
If a non-administrator user needs read-only access to the dataflow interface, add the `Setup / Administrate` and `eZ Dataflow / View` policies in one of their roles.
# Issues and feature requests
Please report issues and request features at https://github.com/code-rhapsodie/ezdataflow-bundle/issues.
@@ -315,4 +319,3 @@ already.
# License
This package is licensed under the [MIT license](LICENSE).

View File

@@ -13,9 +13,6 @@ class DefaultFieldValueCreator implements FieldValueCreatorInterface
/** @var FieldTypeService */
private $fieldTypeService;
/** @var FieldType[] */
private $fieldTypes = [];
public function __construct(FieldTypeService $fieldTypeService)
{
$this->fieldTypeService = $fieldTypeService;
@@ -28,22 +25,6 @@ class DefaultFieldValueCreator implements FieldValueCreatorInterface
public function createValue(string $fieldTypeIdentifier, $hash): Value
{
return $this->getFieldType($fieldTypeIdentifier)->fromHash($hash);
}
/**
* @param string $fieldTypeIdentifier
*
* @return FieldType
*
* @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException
*/
private function getFieldType(string $fieldTypeIdentifier): FieldType
{
if (!isset($this->fieldTypes[$fieldTypeIdentifier])) {
$this->fieldTypes[$fieldTypeIdentifier] = $this->fieldTypeService->getFieldType($fieldTypeIdentifier);
}
return $this->fieldTypes[$fieldTypeIdentifier];
return $this->fieldTypeService->getFieldType($fieldTypeIdentifier)->fromHash($hash);
}
}

View File

@@ -49,15 +49,15 @@ coderhapsodie.ezdataflow.workflow.history.title: 'Historique des exécutions'
coderhapsodie.ezdataflow.workflow.list.delete: Supprimer
coderhapsodie.ezdataflow.workflow.delete: 'Êtes-vous sûr de vouloir supprimer ce dataflow ?'
coderhapsodie.ezdataflow.workflow.create.success: 'La programmation du dataflow a bien été ajoutée.'
coderhapsodie.ezdataflow.workflow.create.error: 'Une erreur est survenue lors de l''ajout de la programamtion du dataflow : "%message%".'
coderhapsodie.ezdataflow.workflow.delete.success: 'La programmation du dataflow a bien été supprimé.'
coderhapsodie.ezdataflow.workflow.create.error: 'Une erreur est survenue lors de l''ajout de la programmation du dataflow : "%message%".'
coderhapsodie.ezdataflow.workflow.delete.success: 'La programmation du dataflow a bien été supprimée.'
coderhapsodie.ezdataflow.workflow.delete.error: 'Une erreur est survenue lors de la suppression de la programmation du dataflow : "%message%".'
coderhapsodie.ezdataflow.workflow.oneshot.new.title: 'Nouvelle exécution ponctuelle'
coderhapsodie.ezdataflow.job.create.success: 'Votre exécution a bien été ajoutée.'
coderhapsodie.ezdataflow.job.create.error: 'Une erreur est survenue lors de l''ajout de l''exécution : "%message%".'
coderhapsodie.dataflow.label: 'Nom de la programamtion du dataflow'
coderhapsodie.dataflow.label: 'Nom de la programmation du dataflow'
coderhapsodie.dataflow.oneshot.label: 'Nom de l''exécution ponctuelle du dataflow'
coderhapsodie.dataflow.dataflowType: 'Dataflow a exécuter'
coderhapsodie.dataflow.dataflowType: 'Dataflow à exécuter'
coderhapsodie.dataflow.options: 'Options passées au dataflow (YAML)'
coderhapsodie.dataflow.options.title: 'Entrez les options comme un tableau clé/valeur YAML'
coderhapsodie.dataflow.options.placeholder: "option1: valeur1\noption2: valeur2\n"
@@ -70,6 +70,6 @@ coderhapsodie.dataflow.create.enabled: 'Activé ?'
coderhapsodie.ezdataflow.workflow.repeating.edit.title: "Édition de la programmation d'un dataflow"
coderhapsodie.ezdataflow.workflow.edit.submit: Sauvegarder
coderhapsodie.dataflow.update.next: 'Prochaine exécution'
coderhapsodie.ezdataflow.workflow.edit.success: 'La programmation du dataflow a été mis à jour avec succès.'
coderhapsodie.ezdataflow.workflow.edit.success: 'La programmation du dataflow a été mise à jour avec succès.'
coderhapsodie.ezdataflow.workflow.edit.error: 'Une erreur est survenue lors de la modification de la programmation du dataflow : "%message%".'
coderhapsodie.ezdataflow.notfound: 'Les données demandées sont introuvables'

View File

@@ -24,7 +24,8 @@
<h3 class="modal-title">{{ 'coderhapsodie.ezdataflow.workflow.history.title'|trans }}</h3>
<button type="button" class="close" aria-label="Close">
<svg class="ez-icon ez-icon--medium" aria-hidden="true">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#discard"></use>
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#discard"></use>
</svg>
</button>
</div>
@@ -34,35 +35,40 @@
</div>
<script>
$('#ez-modal--history-details').modal({keyboard: false, show: false});
$('.history-details-aware').delegate('.modal-history-details', 'click', function(e) {
e.preventDefault();
$('#modal_content-details').html('');
$('#ez-modal--history-details').modal('show');
$.ajax(this.href, {
success: function(result) {
$('#modal_content-details').html(result);
}
(function ($) {
$(document).ready(function ($) {
$('#ez-modal--history-details').modal({keyboard: false, show: false});
$('.history-details-aware').delegate('.modal-history-details', 'click', function (e) {
e.preventDefault();
$('#modal_content-details').html('');
$('#ez-modal--history-details').modal('show');
$.ajax(this.href, {
success: function (result) {
$('#modal_content-details').html(result);
}
});
});
$('#ez-modal--history-details .close').click(function () {
$('#ez-modal--history-details').modal('hide');
});
$(document).ready(function () {
if (window.location.hash && window.location.hash === '#oneshot') {
$('#ez-tab-list-coderhapsodie-ezdataflow li a').removeClass('active');
$('#ez-tab-list-content-coderhapsodie-ezdataflow .tab-pane').removeClass('active');
$('#ez-tab-list-coderhapsodie-ezdataflow li a:eq(1)').addClass('active');
$('#ez-tab-list-content-coderhapsodie-ezdataflow .tab-pane:eq(1)').addClass('active');
}
if (window.location.hash && window.location.hash === '#history') {
$('#ez-tab-list-coderhapsodie-ezdataflow li a').removeClass('active');
$('#ez-tab-list-content-coderhapsodie-ezdataflow .tab-pane').removeClass('active');
$('#ez-tab-list-coderhapsodie-ezdataflow li a:eq(2)').addClass('active');
$('#ez-tab-list-content-coderhapsodie-ezdataflow .tab-pane:eq(2)').addClass('active');
}
});
});
});
$('#ez-modal--history-details .close').click(function () {
$('#ez-modal--history-details').modal('hide');
});
$(document).ready(function () {
if (window.location.hash && window.location.hash === '#oneshot') {
$('#ez-tab-list-coderhapsodie-ezdataflow li a').removeClass('active');
$('#ez-tab-list-content-coderhapsodie-ezdataflow .tab-pane').removeClass('active');
$('#ez-tab-list-coderhapsodie-ezdataflow li a:eq(1)').addClass('active');
$('#ez-tab-list-content-coderhapsodie-ezdataflow .tab-pane:eq(1)').addClass('active');
}
if (window.location.hash && window.location.hash === '#history') {
$('#ez-tab-list-coderhapsodie-ezdataflow li a').removeClass('active');
$('#ez-tab-list-content-coderhapsodie-ezdataflow .tab-pane').removeClass('active');
$('#ez-tab-list-coderhapsodie-ezdataflow li a:eq(2)').addClass('active');
$('#ez-tab-list-content-coderhapsodie-ezdataflow .tab-pane:eq(2)').addClass('active');
}
});
})(jQuery);
</script>
{% endblock %}

View File

@@ -3,9 +3,11 @@
<div class="ez-table-header">
<div class="ez-table-header__headline">{{ 'coderhapsodie.ezdataflow.oneshot.list.title'|trans }}</div>
<div>
<button type="button" class="btn btn-primary btn-modal-launcher" data-toggle="modal" data-target="#ez-modal--new-oneshot">
<button type="button" class="btn btn-primary btn-modal-launcher" data-toggle="modal"
data-target="#ez-modal--new-oneshot">
<svg class="ez-icon ez-icon--medium ez-icon--light ez-icon-create">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#create"></use>
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#create"></use>
</svg>
</button>
</div>
@@ -22,30 +24,35 @@
</div>
<script>
$('#ez-modal--new-oneshot').on('submit', 'form', function (e) {
e.preventDefault();
url = $(this).attr('action');
data = new FormData(this);
$.ajax({
'type': 'POST',
'url': url,
'data': data,
processData: false,
contentType: false,
success: function (result) {
if (result.redirect) {
if (window.location.href === result.redirect) {
document.location.reload();
}
window.location = result.redirect;
return;
}
let obj = $(result.form).find('.modal-body');
$('#ez-modal--new-oneshot .modal-body').html($(obj).html());
}
(function ($) {
$(document).ready(function ($) {
$('#ez-modal--new-oneshot').on('submit', 'form', function (e) {
e.preventDefault();
url = $(this).attr('action');
data = new FormData(this);
$.ajax({
'type': 'POST',
'url': url,
'data': data,
processData: false,
contentType: false,
success: function (result) {
if (result.redirect) {
if (window.location.href === result.redirect) {
document.location.reload();
}
window.location = result.redirect;
return;
}
let obj = $(result.form).find('.modal-body');
$('#ez-modal--new-oneshot .modal-body').html($(obj).html());
}
});
});
});
});
})(jQuery);
</script>

View File

@@ -17,164 +17,168 @@
{% if form is defined %}
{% form_theme form 'bootstrap_3_layout.html.twig' %}
<div class="modal fade ez-modal show" id="ez-modal--new-scheduled" tabindex="-1" role="dialog" aria-modal="true">
<div class="modal-dialog" role="document">
{{ include('@ezdesign/ezdataflow/parts/schedule_form.html.twig') }}
<div class="modal fade ez-modal show" id="ez-modal--new-scheduled" tabindex="-1" role="dialog" aria-modal="true">
<div class="modal-dialog" role="document">
{{ include('@ezdesign/ezdataflow/parts/schedule_form.html.twig') }}
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade ez-modal ez-modal--delete-workflow show" id="ez-modal--delete-workflow" tabindex="-1"
role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<svg class="ez-icon ez-icon--medium" aria-hidden="true">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../../ez-icons.svg#discard"></use>
</svg>
</button>
</div>
<div class="modal-body">
<p class="font-weight-bold" id="delete-modal--workflow-name"></p>
<p class="ez-modal-body__main">{{ 'coderhapsodie.ezdataflow.workflow.delete'|trans }}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-dark"
data-dismiss="modal">{{ 'coderhapsodie.ezdataflow.workflow.new.cancel'|trans }}</button>
<button type="button" class="btn btn-danger font-weight-bold"
id="ez-modal--delete-workflow-confirm">{{ 'coderhapsodie.ezdataflow.workflow.list.delete'|trans }}</button>
<!-- Modal -->
<div class="modal fade ez-modal ez-modal--delete-workflow show" id="ez-modal--delete-workflow" tabindex="-1"
role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<svg class="ez-icon ez-icon--medium" aria-hidden="true">
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="../../ez-icons.svg#discard"></use>
</svg>
</button>
</div>
<div class="modal-body">
<p class="font-weight-bold" id="delete-modal--workflow-name"></p>
<p class="ez-modal-body__main">{{ 'coderhapsodie.ezdataflow.workflow.delete'|trans }}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-dark"
data-dismiss="modal">{{ 'coderhapsodie.ezdataflow.workflow.new.cancel'|trans }}</button>
<button type="button" class="btn btn-danger font-weight-bold"
id="ez-modal--delete-workflow-confirm">{{ 'coderhapsodie.ezdataflow.workflow.list.delete'|trans }}</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade ez-modal show" id="ez-modal--history" tabindex="-1" role="dialog" aria-modal="true">
<div class="modal-dialog" role="document" style="max-width: 80%">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">{{ 'coderhapsodie.ezdataflow.workflow.history.title'|trans }}</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<svg class="ez-icon ez-icon--medium" aria-hidden="true">
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#discard"></use>
</svg>
</button>
<div class="modal fade ez-modal show" id="ez-modal--history" tabindex="-1" role="dialog" aria-modal="true">
<div class="modal-dialog" role="document" style="max-width: 80%">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">{{ 'coderhapsodie.ezdataflow.workflow.history.title'|trans }}</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<svg class="ez-icon ez-icon--medium" aria-hidden="true">
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#discard"></use>
</svg>
</button>
</div>
<div class="modal-body history-details-aware" id="modal_content"></div>
</div>
<div class="modal-body history-details-aware" id="modal_content"></div>
</div>
</div>
</div>
<div class="modal fade ez-modal show" id="ez-modal--edit-scheduled" tabindex="-1" role="dialog" aria-modal="true">
<div class="modal-dialog" role="document">
<div id="schedule_edit"></div>
<div class="modal fade ez-modal show" id="ez-modal--edit-scheduled" tabindex="-1" role="dialog" aria-modal="true">
<div class="modal-dialog" role="document">
<div id="schedule_edit"></div>
</div>
</div>
</div>
<script>
$('#ez-modal--history').modal({keyboard: false, show: false});
$('.modal-history').each(function (index, elem) {
$(elem).click(function (e) {
e.preventDefault();
$('#modal_content').html('');
$('#ez-modal--history').modal('show');
$.ajax(elem.href, {
success: function (result) {
$('#modal_content').html(result);
}
});
});
});
$('#ez-modal--history .close').click(function () {
$('#ez-modal--history').modal('hide');
});
<script>
(function ($) {
$(document).ready(function ($) {
$('#ez-modal--history').modal({keyboard: false, show: false});
$('.modal-history').each(function (index, elem) {
$(elem).click(function (e) {
e.preventDefault();
$('#modal_content').html('');
$('#ez-modal--history').modal('show');
$.ajax(elem.href, {
success: function (result) {
$('#modal_content').html(result);
}
});
});
});
$('#ez-modal--history .close').click(function () {
$('#ez-modal--history').modal('hide');
});
$('#ez-modal--delete-workflow').modal({keyboard: true, show: false});
$('.modal-delete').each(function (index, elem) {
$(elem).click(function (e) {
e.preventDefault();
$('#delete-modal--workflow-name').html($(elem).data('name'));
$('#ez-modal--delete-workflow').modal('show');
$('#ez-modal--delete-workflow-confirm').data('target', $(elem).data('path'));
});
});
$('#ez-modal--delete-workflow-confirm').click(function () {
let target = $(this).data('target');
if (target && target !== '') {
$.ajax(target, {
method: 'POST',
complete: function () {
$('#ez-modal--delete-workflow').modal('hide');
window.location.reload();
}
});
}
});
$('#ez-modal--edit-scheduled').modal({keyboard: true, show: false});
$('.modal-edit').each(function (index, elem) {
$(elem).click(function (e) {
e.preventDefault();
$('#schedule_edit').html('');
$('#ez-modal--edit-scheduled').modal('show');
$.ajax(elem.href, {
success: function (result) {
if (result.redirect) {
if (window.location.href === result.redirect) {
document.location.reload();
}
window.location = result.redirect;
return;
$('#ez-modal--delete-workflow').modal({keyboard: true, show: false});
$('.modal-delete').each(function (index, elem) {
$(elem).click(function (e) {
e.preventDefault();
$('#delete-modal--workflow-name').html($(elem).data('name'));
$('#ez-modal--delete-workflow').modal('show');
$('#ez-modal--delete-workflow-confirm').data('target', $(elem).data('path'));
});
});
$('#ez-modal--delete-workflow-confirm').click(function () {
let target = $(this).data('target');
if (target && target !== '') {
$.ajax(target, {
method: 'POST',
complete: function () {
$('#ez-modal--delete-workflow').modal('hide');
window.location.reload();
}
});
}
});
$('#schedule_edit').html(result.form);
}
$('#ez-modal--edit-scheduled').modal({keyboard: true, show: false});
$('.modal-edit').each(function (index, elem) {
$(elem).click(function (e) {
e.preventDefault();
$('#schedule_edit').html('');
$('#ez-modal--edit-scheduled').modal('show');
$.ajax(elem.href, {
success: function (result) {
if (result.redirect) {
if (window.location.href === result.redirect) {
document.location.reload();
}
window.location = result.redirect;
return;
}
$('#schedule_edit').html(result.form);
}
});
});
});
$('#ez-modal--edit-scheduled').on('submit', 'form', function (e) {
e.preventDefault();
url = $(this).attr('action');
data = new FormData(this);
$.ajax({
'type': 'POST',
'url': url,
'data': data,
processData: false,
contentType: false,
success: function (result) {
if (result.redirect) {
window.location = result.redirect;
return;
}
$('#schedule_edit').html(result.form);
}
});
});
$('#ez-modal--new-scheduled form').on('submit', function (e) {
e.preventDefault();
url = $(this).attr('action');
data = new FormData(this);
$.ajax({
'type': 'POST',
'url': url,
'data': data,
processData: false,
contentType: false,
success: function (result) {
if (result.redirect) {
window.location = result.redirect;
return;
}
let obj = $(result.form).find('.modal-body');
$('#ez-modal--new-scheduled .modal-body').html($(obj).html());
}
});
});
});
});
});
$('#ez-modal--edit-scheduled').on('submit', 'form', function (e) {
e.preventDefault();
url = $(this).attr('action');
data = new FormData(this);
$.ajax({
'type': 'POST',
'url': url,
'data': data,
processData: false,
contentType: false,
success: function (result) {
if (result.redirect) {
window.location = result.redirect;
return;
}
$('#schedule_edit').html(result.form);
}
});
});
$('#ez-modal--new-scheduled form').on('submit', function (e) {
e.preventDefault();
url = $(this).attr('action');
data = new FormData(this);
$.ajax({
'type': 'POST',
'url': url,
'data': data,
processData: false,
contentType: false,
success: function (result) {
if (result.redirect) {
window.location = result.redirect;
return;
}
let obj = $(result.form).find('.modal-body');
$('#ez-modal--new-scheduled .modal-body').html($(obj).html());
}
});
});
</script>
})(jQuery);
</script>
{% endif %}

View File

@@ -4,7 +4,8 @@
<div id="loading_{{ id }}" class="text-center d-none">
<svg class="ez-icon ez-icon--extra-large">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#spinner"></use>
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#spinner"></use>
</svg>
</div>
@@ -32,9 +33,12 @@
<td>{{ job.end_time ? job.end_time|date('d/m/Y H:i:s') : '-' }}</td>
<td>{{ macros.translateStatus(job.status) }}</td>
<td class="ez-table__cell ez-table__cell--has-action-btns text-right">
<a href="{{ path('coderhapsodie.ezdataflow.job.details', {id: job.id}) }}" class="btn btn-icon mx-2 modal-history-details" title="{{ 'coderhapsodie.ezdataflow.history.list.view'|trans }}">
<a href="{{ path('coderhapsodie.ezdataflow.job.details', {id: job.id}) }}"
class="btn btn-icon mx-2 modal-history-details"
title="{{ 'coderhapsodie.ezdataflow.history.list.view'|trans }}">
<svg class="ez-icon ez-icon--small-medium">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#about-info"></use>
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#about-info"></use>
</svg>
</a>
</td>
@@ -54,14 +58,19 @@
</div>
<script>
// Manage ajax pagination
$('#{{ id }}').delegate('.ez-pagination a', 'click', function (e) {
e.preventDefault();
$('#loading_{{ id }}').removeClass('d-none');
$('#{{ id }}')
.html('')
.load(this.href + ' #{{ id }}>*', null, function () {
$('#loading_{{ id }}').addClass('d-none');
(function ($) {
$(document).ready(function ($) {
// Manage ajax pagination
$('#{{ id }}').delegate('.ez-pagination a', 'click', function (e) {
e.preventDefault();
$('#loading_{{ id }}').removeClass('d-none');
$('#{{ id }}')
.html('')
.load(this.href + ' #{{ id }}>*', null, function () {
$('#loading_{{ id }}').addClass('d-none');
});
});
});
});
})(jQuery);
</script>

View File

@@ -2,66 +2,83 @@
<div id="loading_{{ id }}" class="text-center d-none">
<svg class="ez-icon ez-icon--extra-large">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#spinner"></use>
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#spinner"></use>
</svg>
</div>
<div id="{{ id }}" class="history-details-aware">
{% if pager.currentPageResults|length %}
<table class="table">
<thead>
<tr>
<th>{{ 'coderhapsodie.ezdataflow.workflow.list.name'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.workflow.list.frequency'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.workflow.list.next_execution'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.workflow.list.enabled'|trans }}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for item in pager.currentPageResults %}
<table class="table">
<thead>
<tr>
<td>{{ item.label }}</td>
<td>{{ item.frequency }}</td>
<td>{{ item.next|date('d/m/Y H:i:s') }}</td>
<td>{{ ('coderhapsodie.ezdataflow.' ~ (item.enabled ? 'yes' : 'no'))|trans }}</td>
<td class="ez-table__cell ez-table__cell--has-action-btns text-right">
<a href="{{ path('coderhapsodie.ezdataflow.history.workflow', {id: item.id}) }}" class="btn btn-icon mx-2 modal-history" title="{{ 'coderhapsodie.ezdataflow.workflow.list.history'|trans }}">
<svg class="ez-icon ez-icon--small-medium">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#history"></use>
</svg>
</a>
<a href="{{ path('coderhapsodie.ezdataflow.workflow.edit', {id: item.id}) }}" type="button" class="btn btn-icon mx-2 modal-edit" title="{{ 'coderhapsodie.ezdataflow.workflow.list.edit'|trans }}">
<svg class="ez-icon ez-icon--small-medium ez-icon-edit">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#edit"></use>
</svg>
</a>
{% if item.enabled %}
<a href="{{ path('coderhapsodie.ezdataflow.workflow.disable', {id: item.id}) }}" class="btn btn-icon mx-2" title="{{ 'coderhapsodie.ezdataflow.workflow.list.disable'|trans }}">
<svg class="ez-icon ez-icon--small-medium" style="fill: #f7d000;">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#logout"></use>
</svg>
</a>
{% else %}
<a href="{{ path('coderhapsodie.ezdataflow.workflow.enable', {id: item.id}) }}" class="btn btn-icon mx-2" title="{{ 'coderhapsodie.ezdataflow.workflow.list.enable'|trans }}">
<svg class="ez-icon ez-icon--small-medium" style="fill: #00825c;">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#approved"></use>
</svg>
</a>
{% endif %}
<button type="button" class="btn btn-icon mx-2 ez-btn--content-trash modal-delete" data-name="{{ item.label }}" data-path="{{ path('coderhapsodie.ezdataflow.workflow.delete', {id: item.id}) }}" title="{{ 'coderhapsodie.ezdataflow.workflow.list.delete'|trans }}">
<svg class="ez-icon ez-icon--small-medium ez-icon-trash">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#trash"></use>
</svg>
</button>
</td>
<th>{{ 'coderhapsodie.ezdataflow.workflow.list.name'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.workflow.list.frequency'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.workflow.list.next_execution'|trans }}</th>
<th>{{ 'coderhapsodie.ezdataflow.workflow.list.enabled'|trans }}</th>
<th></th>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="ez-table-no-content">{{ 'coderhapsodie.ezdataflow.workflow.list.empty'|trans }}</p>
{% endif %}
</thead>
<tbody>
{% for item in pager.currentPageResults %}
<tr>
<td>{{ item.label }}</td>
<td>{{ item.frequency }}</td>
<td>{{ item.next|date('d/m/Y H:i:s') }}</td>
<td>{{ ('coderhapsodie.ezdataflow.' ~ (item.enabled ? 'yes' : 'no'))|trans }}</td>
<td class="ez-table__cell ez-table__cell--has-action-btns text-right">
<a href="{{ path('coderhapsodie.ezdataflow.history.workflow', {id: item.id}) }}"
class="btn btn-icon mx-2 modal-history"
title="{{ 'coderhapsodie.ezdataflow.workflow.list.history'|trans }}">
<svg class="ez-icon ez-icon--small-medium">
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#history"></use>
</svg>
</a>
<a href="{{ path('coderhapsodie.ezdataflow.workflow.edit', {id: item.id}) }}" type="button"
class="btn btn-icon mx-2 modal-edit"
title="{{ 'coderhapsodie.ezdataflow.workflow.list.edit'|trans }}">
<svg class="ez-icon ez-icon--small-medium ez-icon-edit">
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#edit"></use>
</svg>
</a>
{% if item.enabled %}
<a href="{{ path('coderhapsodie.ezdataflow.workflow.disable', {id: item.id}) }}"
class="btn btn-icon mx-2"
title="{{ 'coderhapsodie.ezdataflow.workflow.list.disable'|trans }}">
<svg class="ez-icon ez-icon--small-medium" style="fill: #f7d000;">
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#logout"></use>
</svg>
</a>
{% else %}
<a href="{{ path('coderhapsodie.ezdataflow.workflow.enable', {id: item.id}) }}"
class="btn btn-icon mx-2"
title="{{ 'coderhapsodie.ezdataflow.workflow.list.enable'|trans }}">
<svg class="ez-icon ez-icon--small-medium" style="fill: #00825c;">
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#approved"></use>
</svg>
</a>
{% endif %}
<button type="button" class="btn btn-icon mx-2 ez-btn--content-trash modal-delete"
data-name="{{ item.label }}"
data-path="{{ path('coderhapsodie.ezdataflow.workflow.delete', {id: item.id}) }}"
title="{{ 'coderhapsodie.ezdataflow.workflow.list.delete'|trans }}">
<svg class="ez-icon ez-icon--small-medium ez-icon-trash">
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#trash"></use>
</svg>
</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="ez-table-no-content">{{ 'coderhapsodie.ezdataflow.workflow.list.empty'|trans }}</p>
{% endif %}
{% if pager.haveToPaginate %}
<div class="ez-pagination justify-content-center align-items-center ez-pagination__spacing">
@@ -71,14 +88,19 @@
</div>
<script>
// Manage ajax pagination
$('#{{ id }}').delegate('.ez-pagination a', 'click', function (e) {
e.preventDefault();
$('#loading_{{ id }}').removeClass('d-none');
$('#{{ id }}')
.html('')
.load(this.href + ' #{{ id }}>*', null, function () {
$('#loading_{{ id }}').addClass('d-none');
(function ($) {
$(document).ready(function ($) {
// Manage ajax pagination
$('#{{ id }}').delegate('.ez-pagination a', 'click', function (e) {
e.preventDefault();
$('#loading_{{ id }}').removeClass('d-none');
$('#{{ id }}')
.html('')
.load(this.href + ' #{{ id }}>*', null, function () {
$('#loading_{{ id }}').addClass('d-none');
});
});
});
});
})(jQuery);
</script>

View File

@@ -35,11 +35,11 @@ class ContentWriter extends RepositoryWriter implements WriterInterface
}
if ($item instanceof ContentCreateStructure) {
$this->creator->createFromStructure($item);
return $this->creator->createFromStructure($item);
}
if ($item instanceof ContentUpdateStructure) {
$this->updater->updateFromStructure($item);
return $this->updater->updateFromStructure($item);
}
}
}