Rename the Plan bundle to Program across config, routes, menus, and controllers (Plan -> Initiative), bump version to 0.16.0, and introduce new audience and UTM taxonomy routes and permissions to support the expanded Programs feature set.
170 lines
11 KiB
Twig
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 %}programStakeholder{% endblock %}
|
|
|
|
{% block headerTitle %}{{ 'mautic.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['program:stakeholders:create'],
|
|
},
|
|
'langVar': 'initiative.stakeholder',
|
|
},
|
|
'bulk_actions': {
|
|
'langVar': 'initiative.stakeholder',
|
|
'templateButtons': {
|
|
'delete': permissions['program:stakeholders:deleteown'] or permissions['program: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="programStakeholderTable">
|
|
<thead>
|
|
<tr>
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'checkall': 'true',
|
|
'target': '#programStakeholderTable',
|
|
}) }}
|
|
{# Columns: ID, Pictogram, Type, Name, Role, Email, Phone, Active, Assigned initiatives. #}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'initiative.stakeholder',
|
|
'orderBy': 's.id',
|
|
'text': 'mautic.core.id',
|
|
'class': 'col-initiative-stakeholder-id',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'initiative.stakeholder',
|
|
'text': 'mautic.program.stakeholder.field.pictogram',
|
|
'class': 'col-initiative-stakeholder-pictogram',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'initiative.stakeholder',
|
|
'orderBy': 's.type',
|
|
'text': 'mautic.program.stakeholder.field.type',
|
|
'class': 'col-initiative-stakeholder-type',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'initiative.stakeholder',
|
|
'orderBy': 's.name',
|
|
'text': 'mautic.program.stakeholder.field.name',
|
|
'class': 'col-initiative-stakeholder-name',
|
|
'default': true,
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'initiative.stakeholder',
|
|
'orderBy': 's.role',
|
|
'text': 'mautic.program.stakeholder.field.role',
|
|
'class': 'visible-md visible-lg col-initiative-stakeholder-role',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'initiative.stakeholder',
|
|
'orderBy': 's.email',
|
|
'text': 'mautic.program.stakeholder.field.email',
|
|
'class': 'col-initiative-stakeholder-email',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'initiative.stakeholder',
|
|
'text': 'mautic.program.stakeholder.field.phone',
|
|
'class': 'col-initiative-stakeholder-phone',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'initiative.stakeholder',
|
|
'orderBy': 's.isPublished',
|
|
'text': 'mautic.program.stakeholder.field.active',
|
|
'class': 'col-initiative-stakeholder-active',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'initiative.stakeholder',
|
|
'text': 'mautic.program.stakeholder.field.plans',
|
|
'class': 'visible-md visible-lg col-initiative-stakeholder-initiatives',
|
|
}) }}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in items %}
|
|
{% set canEdit = securityHasEntityAccess(permissions['program:stakeholders:editown'], permissions['program:stakeholders:editother'], item.createdBy) %}
|
|
<tr>
|
|
<td>
|
|
{{- include('@MauticCore/Helper/list_actions.html.twig', {
|
|
'item': item,
|
|
'templateButtons': {
|
|
'edit': canEdit,
|
|
'delete': securityHasEntityAccess(permissions['program:stakeholders:deleteown'], permissions['program:stakeholders:deleteother'], item.createdBy),
|
|
},
|
|
'langVar': 'initiative.stakeholder',
|
|
}) -}}
|
|
</td>
|
|
<td>{{ item.id }}</td>
|
|
<td class="text-center">
|
|
{% set typeIcon = program_item_type_icon('stakeholder', item.type) %}
|
|
{% if typeIcon %}<i class="{{ typeIcon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
|
</td>
|
|
<td{% if program_item_type_description('stakeholder', item.type) %} title="{{ program_item_type_description('stakeholder', item.type) }}"{% endif %}>
|
|
{{ program_item_type_name('stakeholder', item.type) ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': item.type}) }}
|
|
</td>
|
|
<td>
|
|
{% if canEdit %}
|
|
<a href="{{ path('initiative_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 ? 'mautic.program.stakeholder.active' : 'mautic.program.stakeholder.inactive')|trans }}
|
|
</span>
|
|
</td>
|
|
<td class="visible-md visible-lg">
|
|
{# The initiatives this stakeholder is assigned to, through their Stakeholders tab. #}
|
|
{% set initiatives = item.initiativeLinks|default([]) %}
|
|
{% for link in initiatives %}
|
|
<a href="{{ path('initiative_action', {'objectAction': 'view', 'objectId': link.initiative.id}) }}" data-toggle="ajax">{{ link.initiative.name }}</a>{% if link.roleInInitiative %} <span class="text-muted small">({{ link.roleInInitiative }})</span>{% endif %}{% if not loop.last %}, {% endif %}
|
|
{% else %}
|
|
<span class="text-muted">{{ 'mautic.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('initiative_stakeholder_index'),
|
|
'sessionVar': 'initiative.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': 'mautic.program.stakeholder.onboarding.heading',
|
|
'subheading': 'mautic.program.stakeholder.onboarding.subheading',
|
|
'copy': 'mautic.program.stakeholder.onboarding.copy',
|
|
}) }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|