152 lines
8.2 KiB
Twig
152 lines
8.2 KiB
Twig
{% set isIndex = 'index' == tmpl ? true : false %}
|
|
{% set tmpl = 'list' %}
|
|
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
|
|
|
|
{% block mauticContent %}plan{% endblock %}
|
|
|
|
{% block headerTitle %}{{ 'mautic.plan.header.index'|trans }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div id="page-list-wrapper" class="{% if items|length > 0 or searchValue is not empty %}panel {% endif %}panel-default">
|
|
{{- include('@MauticCore/Helper/list_toolbar.html.twig', {
|
|
'searchValue': searchValue,
|
|
'action': currentRoute,
|
|
'page_actions': {
|
|
'templateButtons': {
|
|
'new': permissions['plan:plans:create'],
|
|
},
|
|
'routeBase': 'plan',
|
|
'langVar': 'plan',
|
|
},
|
|
'bulk_actions': {
|
|
'langVar': 'plan',
|
|
'routeBase': 'plan',
|
|
'templateButtons': {
|
|
'delete': permissions['plan:plans:deleteown'] or permissions['plan:plans:deleteother'],
|
|
},
|
|
},
|
|
}) -}}
|
|
<div class="page-list">
|
|
{% if items is defined and items is not empty %}
|
|
<div class="table-responsive">
|
|
<table class="table table-hover" id="planTable">
|
|
<thead>
|
|
<tr>
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'checkall': 'true',
|
|
'target': '#planTable',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan',
|
|
'orderBy': 'p.name',
|
|
'text': 'mautic.plan.field.name',
|
|
'class': 'col-plan-name',
|
|
'default': true,
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan',
|
|
'orderBy': 'p.status',
|
|
'text': 'mautic.plan.field.status',
|
|
'class': 'col-plan-status',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan',
|
|
'text': 'mautic.plan.field.owner',
|
|
'class': 'visible-md visible-lg col-plan-owner',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan',
|
|
'orderBy': 'p.startDate',
|
|
'text': 'mautic.plan.field.start_date',
|
|
'class': 'visible-md visible-lg col-plan-start',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan',
|
|
'orderBy': 'p.endDate',
|
|
'text': 'mautic.plan.field.end_date',
|
|
'class': 'visible-md visible-lg col-plan-end',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan',
|
|
'orderBy': 'p.budgetPlanned',
|
|
'text': 'mautic.plan.field.budget_planned',
|
|
'class': 'visible-md visible-lg col-plan-budget text-right',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan',
|
|
'orderBy': 'p.id',
|
|
'text': 'mautic.core.id',
|
|
'class': 'visible-md visible-lg col-plan-id',
|
|
}) }}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in items %}
|
|
{% set canEdit = securityHasEntityAccess(permissions['plan:plans:editown'], permissions['plan:plans:editother'], item.createdBy) %}
|
|
<tr>
|
|
<td>
|
|
{{- include('@MauticCore/Helper/list_actions.html.twig', {
|
|
'item': item,
|
|
'templateButtons': {
|
|
'edit': canEdit,
|
|
'delete': securityHasEntityAccess(permissions['plan:plans:deleteown'], permissions['plan:plans:deleteother'], item.createdBy),
|
|
},
|
|
'routeBase': 'plan',
|
|
'langVar': 'plan',
|
|
}) -}}
|
|
</td>
|
|
<td>
|
|
<div>
|
|
{{- include('@MauticCore/Helper/publishstatus_icon.html.twig', {
|
|
'item': item,
|
|
'model': 'plan',
|
|
}) -}}
|
|
<a href="{{ path('plan_action', {'objectAction': 'view', 'objectId': item.id}) }}" data-toggle="ajax">
|
|
{{ item.name }}
|
|
</a>
|
|
{% if item.category %}
|
|
<span class="label label-default">{{ item.category.title }}</span>
|
|
{% endif %}
|
|
</div>
|
|
</td>
|
|
<td>{{ item.status.labelKey|trans }}</td>
|
|
<td class="visible-md visible-lg">
|
|
{{ item.owner ? item.owner.name : 'mautic.plan.owner.none'|trans }}
|
|
</td>
|
|
<td class="visible-md visible-lg">{{ item.startDate ? dateToDate(item.startDate) : '' }}</td>
|
|
<td class="visible-md visible-lg">{{ item.endDate ? dateToDate(item.endDate) : '' }}</td>
|
|
<td class="visible-md visible-lg text-right">
|
|
{% if item.budgetPlanned is not null %}
|
|
{{ plan_money(item.budgetPlanned) }} {{ plan_currency() }}
|
|
{% endif %}
|
|
</td>
|
|
<td class="visible-md visible-lg">{{ item.id }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<div class="panel-footer">
|
|
{{- include('@MauticCore/Helper/pagination.html.twig', {
|
|
'totalItems': totalItems,
|
|
'page': page,
|
|
'limit': limit,
|
|
'baseUrl': path('plan_index'),
|
|
'sessionVar': 'plan',
|
|
}) -}}
|
|
</div>
|
|
</div>
|
|
{% elseif searchValue is not empty %}
|
|
{{ include('@MauticCore/Helper/noresults.html.twig') }}
|
|
{% else %}
|
|
<div class="mt-80 col-md-offset-2 col-lg-offset-3 col-md-8 col-lg-5 height-auto">
|
|
{{ include('@MauticCore/Components/content-block.html.twig', {
|
|
'heading': 'mautic.plan.onboarding.heading',
|
|
'subheading': 'mautic.plan.onboarding.subheading',
|
|
'copy': 'mautic.plan.onboarding.copy',
|
|
}) }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|