Files
mautic-marketing-program-bu…/Resources/views/Stakeholder/list.html.twig
T
Alexandre Gain ea88b7a772 refactor(plugin): rebrand as MT3SMarketingProgram, release 0.17.0
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_*
2026-11-15 17:48:01 +01:00

170 lines
11 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 %}mt3sMpProgramStakeholder{% endblock %}
{% block headerTitle %}{{ 'mt3s.marketing_program.stakeholder.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:stakeholders:create'],
},
'langVar': 'program.stakeholder',
},
'bulk_actions': {
'langVar': 'program.stakeholder',
'templateButtons': {
'delete': permissions['mt3smarketingprogram:stakeholders:deleteown'] or permissions['mt3smarketingprogram:stakeholders:deleteother'],
},
},
}) -}}
<div class="page-list">
{% if items is defined and items is not empty %}
<div class="table-responsive">
<table class="table table-hover" id="mt3sMpProgramStakeholderTable">
<thead>
<tr>
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'checkall': 'true',
'target': '#mt3sMpProgramStakeholderTable',
}) }}
{# Columns: ID, Pictogram, Type, Name, Role, Email, Phone, Active, Assigned programs. #}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.stakeholder',
'orderBy': 's.id',
'text': 'mautic.core.id',
'class': 'col-program-stakeholder-id',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.stakeholder',
'text': 'mt3s.marketing_program.stakeholder.field.pictogram',
'class': 'col-program-stakeholder-pictogram',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.stakeholder',
'orderBy': 's.type',
'text': 'mt3s.marketing_program.stakeholder.field.type',
'class': 'col-program-stakeholder-type',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.stakeholder',
'orderBy': 's.name',
'text': 'mt3s.marketing_program.stakeholder.field.name',
'class': 'col-program-stakeholder-name',
'default': true,
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.stakeholder',
'orderBy': 's.role',
'text': 'mt3s.marketing_program.stakeholder.field.role',
'class': 'visible-md visible-lg col-program-stakeholder-role',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.stakeholder',
'orderBy': 's.email',
'text': 'mt3s.marketing_program.stakeholder.field.email',
'class': 'col-program-stakeholder-email',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.stakeholder',
'text': 'mt3s.marketing_program.stakeholder.field.phone',
'class': 'col-program-stakeholder-phone',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.stakeholder',
'orderBy': 's.isPublished',
'text': 'mt3s.marketing_program.stakeholder.field.active',
'class': 'col-program-stakeholder-active',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.stakeholder',
'text': 'mt3s.marketing_program.stakeholder.field.plans',
'class': 'visible-md visible-lg col-program-stakeholder-programs',
}) }}
</tr>
</thead>
<tbody>
{% for item in items %}
{% set canEdit = securityHasEntityAccess(permissions['mt3smarketingprogram:stakeholders:editown'], permissions['mt3smarketingprogram:stakeholders:editother'], item.createdBy) %}
<tr>
<td>
{{- include('@MauticCore/Helper/list_actions.html.twig', {
'item': item,
'templateButtons': {
'edit': canEdit,
'delete': securityHasEntityAccess(permissions['mt3smarketingprogram:stakeholders:deleteown'], permissions['mt3smarketingprogram:stakeholders:deleteother'], item.createdBy),
},
'langVar': 'program.stakeholder',
}) -}}
</td>
<td>{{ item.id }}</td>
<td class="text-center">
{% set typeIcon = mt3s_marketing_program_item_type_icon('stakeholder', 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('stakeholder', item.type) %} title="{{ mt3s_marketing_program_item_type_description('stakeholder', item.type) }}"{% endif %}>
{{ mt3s_marketing_program_item_type_name('stakeholder', item.type) ?? 'mt3s.marketing_program.description_item.type.unknown'|trans({'%key%': item.type}) }}
</td>
<td>
{% if canEdit %}
<a href="{{ path('mt3s_marketing_program_stakeholder_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">{{ item.role }}</td>
<td>
{% if item.email %}<a href="mailto:{{ item.email }}">{{ item.email }}</a>{% endif %}
</td>
<td class="text-nowrap">
{% if item.phone %}<a href="tel:{{ item.phone|replace({' ': ''}) }}">{{ item.phone }}</a>{% endif %}
</td>
<td>
<span class="label {{ item.isPublished ? 'label-success' : 'label-gray' }}">
{{ (item.isPublished ? 'mt3s.marketing_program.stakeholder.active' : 'mt3s.marketing_program.stakeholder.inactive')|trans }}
</span>
</td>
<td class="visible-md visible-lg">
{# The programs this stakeholder is assigned to, through their Stakeholders tab. #}
{% set programs = item.programLinks|default([]) %}
{% for link in programs %}
<a href="{{ path('mt3s_marketing_program_action', {'objectAction': 'view', 'objectId': link.program.id}) }}" data-toggle="ajax">{{ link.program.name }}</a>{% if link.roleInProgram %} <span class="text-muted small">({{ link.roleInProgram }})</span>{% endif %}{% if not loop.last %}, {% endif %}
{% else %}
<span class="text-muted">{{ 'mt3s.marketing_program.stakeholder.no_plans'|trans }}</span>
{% endfor %}
</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_stakeholder_index'),
'sessionVar': 'program.stakeholder',
}) -}}
</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.stakeholder.onboarding.heading',
'subheading': 'mt3s.marketing_program.stakeholder.onboarding.subheading',
'copy': 'mt3s.marketing_program.stakeholder.onboarding.copy',
}) }}
</div>
{% endif %}
</div>
</div>
{% endblock %}