Rename the plugin's vendor/namespace from experiential/Program to mt3s/MT3SMarketingProgram (composer: mt3s/mautic-marketing-program-bundle): - ProgramBundle -> MT3SMarketingProgramBundle; extension, integration, config support, permissions, events and twig extension renamed likewise - Initiative* -> Program*: controller (InitiativeController -> ProgramController), model, entities, repositories, form types and views (new _tabs/_task_table/_tab_table_filter partials, details page) - Settings config form theme -> _config_mt3smarketingprogramconfig_widget; routes and translations re-prefixed (mt3s_marketing_program_*) - Assets: icon.svg -> mt3s-mp-icon.svg; program.js -> mt3s-mp-program.js (OnLoad hooks renamed mt3sMpProgram*) - Add Command/RefreshStatsCommand; Migrations/Version_0_17_0.php renames the tables to mt3s_mp_program_*
158 lines
9.5 KiB
Twig
158 lines
9.5 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 %}mt3sMpProgramTask{% endblock %}
|
|
|
|
{% block headerTitle %}{{ 'mt3s.marketing_program.task.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['mt3smarketingprogram:tasks:create'],
|
|
},
|
|
'langVar': 'program.task',
|
|
},
|
|
'bulk_actions': {
|
|
'langVar': 'program.task',
|
|
'templateButtons': {
|
|
'delete': permissions['mt3smarketingprogram:tasks:deleteown'] or permissions['mt3smarketingprogram:tasks:deleteother'],
|
|
},
|
|
},
|
|
}) -}}
|
|
<div class="page-list">
|
|
{% if items is defined and items is not empty %}
|
|
<div class="table-responsive">
|
|
<table class="table table-hover" id="mt3sMpProgramTaskTable">
|
|
<thead>
|
|
<tr>
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'checkall': 'true',
|
|
'target': '#mt3sMpProgramTaskTable',
|
|
}) }}
|
|
{# Columns: ID, Pictogram, Type, Name, Description, Start date, End date, Status. #}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'program.task',
|
|
'orderBy': 't.id',
|
|
'text': 'mautic.core.id',
|
|
'class': 'col-program-task-id',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'program.task',
|
|
'text': 'mt3s.marketing_program.task.field.pictogram',
|
|
'class': 'col-program-task-pictogram',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'program.task',
|
|
'orderBy': 't.type',
|
|
'text': 'mt3s.marketing_program.task.field.type',
|
|
'class': 'col-program-task-type',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'program.task',
|
|
'orderBy': 't.name',
|
|
'text': 'mt3s.marketing_program.task.field.name',
|
|
'class': 'col-program-task-name',
|
|
'default': true,
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'program.task',
|
|
'text': 'mt3s.marketing_program.task.field.description',
|
|
'class': 'visible-md visible-lg col-program-task-description',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'program.task',
|
|
'orderBy': 't.startDate',
|
|
'text': 'mt3s.marketing_program.task.field.start_date',
|
|
'class': 'col-program-task-start',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'program.task',
|
|
'orderBy': 't.endDate',
|
|
'text': 'mt3s.marketing_program.task.field.end_date',
|
|
'class': 'col-program-task-end',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'program.task',
|
|
'orderBy': 't.status',
|
|
'text': 'mt3s.marketing_program.task.field.status',
|
|
'class': 'col-program-task-status',
|
|
}) }}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in items %}
|
|
{% set canEdit = securityHasEntityAccess(permissions['mt3smarketingprogram:tasks:editown'], permissions['mt3smarketingprogram:tasks:editother'], item.createdBy) %}
|
|
<tr>
|
|
<td>
|
|
{{- include('@MauticCore/Helper/list_actions.html.twig', {
|
|
'item': item,
|
|
'templateButtons': {
|
|
'edit': canEdit,
|
|
'delete': securityHasEntityAccess(permissions['mt3smarketingprogram:tasks:deleteown'], permissions['mt3smarketingprogram:tasks:deleteother'], item.createdBy),
|
|
},
|
|
'langVar': 'program.task',
|
|
}) -}}
|
|
</td>
|
|
<td>{{ item.id }}</td>
|
|
<td class="text-center">
|
|
{% set typeIcon = mt3s_marketing_program_item_type_icon('task', item.type) %}
|
|
{% if typeIcon %}<i class="{{ typeIcon }} program-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
|
</td>
|
|
<td{% if mt3s_marketing_program_item_type_description('task', item.type) %} title="{{ mt3s_marketing_program_item_type_description('task', item.type) }}"{% endif %}>
|
|
{{ mt3s_marketing_program_item_type_name('task', item.type) ?? 'mt3s.marketing_program.description_item.type.unknown'|trans({'%key%': item.type}) }}
|
|
</td>
|
|
<td>
|
|
{% if canEdit %}
|
|
<a href="{{ path('mt3s_marketing_program_task_action', {'objectAction': 'edit', 'objectId': item.id}) }}" data-toggle="ajax">{{ item.name }}</a>
|
|
{% else %}
|
|
{{ item.name }}
|
|
{% endif %}
|
|
</td>
|
|
<td class="visible-md visible-lg text-muted">
|
|
{% set description = item.description|default('')|striptags|trim %}
|
|
{{ (description|length > 120 ? description|slice(0, 120) ~ '…' : description)|mt3s_marketing_program_linkify }}
|
|
</td>
|
|
<td>{{ item.startDate ? item.startDate|date('Y-m-d') : '' }}</td>
|
|
<td>{{ item.endDate ? item.endDate|date('Y-m-d') : '' }}</td>
|
|
<td>
|
|
{# A phase has no status of its own: its state comes from its tasks. #}
|
|
{% if item.taskKind != constant('MauticPlugin\\MT3SMarketingProgramBundle\\Entity\\TaskKind::Phase') %}
|
|
<span class="label {{ item.status.labelClass }}">{{ item.status.labelKey|trans }}</span>
|
|
{% else %}
|
|
<span class="label label-primary">{{ 'mt3s.marketing_program.task.kind.phase_short'|trans }}</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<div class="panel-footer">
|
|
{{- include('@MauticCore/Helper/pagination.html.twig', {
|
|
'totalItems': totalItems,
|
|
'page': page,
|
|
'limit': limit,
|
|
'baseUrl': path('mt3s_marketing_program_task_index'),
|
|
'sessionVar': 'program.task',
|
|
}) -}}
|
|
</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': 'mt3s.marketing_program.task.onboarding.heading',
|
|
'subheading': 'mt3s.marketing_program.task.onboarding.subheading',
|
|
'copy': 'mt3s.marketing_program.task.onboarding.copy',
|
|
}) }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|