Files
mautic-marketing-program-bu…/Resources/views/Program/list.html.twig
T
Alexandre Gain debce4ba4a fix(program): endless spinner on client-side buttons; program pages never ran their JS
Two defects kept the task form's dependency/RACI rows appearing stuck, and left the program pages uninitialized:

- Add btn-nospin to the 14 client-side Add/Remove buttons (task dependency
  and RACI add/remove, program form collections, item type rows, read-more
  toggle): core binds startIconSpinOnEvent to .btn:not(.btn-nospin) and only
  the ajax handlers restore the icon, so these non-ajax buttons spun forever
- Add ProgramController::getJsLoadMethodPrefix() returning 'mt3sMpProgram':
  core dispatches Mautic[getJsLoadMethodPrefix() + 'OnLoad'](), and without
  the override it fell back to the model alias 'mt3smp.program', which
  nothing listens to, so collections/tabs/sortables were never initialized
- Set the Program list/form/details mauticContent blocks to mt3sMpProgram
  so Mautic.mt3sMpProgramOnLoad() is dispatched on those pages
- TaskController: pass mauticContent=mt3sMpProgram in the post-save
  redirect back to the program view so the program page's JS re-fires
  after saving a task from program context
2026-11-15 17:48:40 +01:00

152 lines
8.6 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 %}mt3sMpProgram{% endblock %}
{% block headerTitle %}{{ 'mt3s.marketing_program.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:programs:create'],
},
'routeBase': 'program',
'langVar': 'program',
},
'bulk_actions': {
'langVar': 'program',
'routeBase': 'program',
'templateButtons': {
'delete': permissions['mt3smarketingprogram:programs:deleteown'] or permissions['mt3smarketingprogram:programs:deleteother'],
},
},
}) -}}
<div class="page-list">
{% if items is defined and items is not empty %}
<div class="table-responsive">
<table class="table table-hover" id="programTable">
<thead>
<tr>
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'checkall': 'true',
'target': '#programTable',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program',
'orderBy': 'p.name',
'text': 'mt3s.marketing_program.field.name',
'class': 'col-program-name',
'default': true,
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program',
'orderBy': 'p.status',
'text': 'mt3s.marketing_program.field.status',
'class': 'col-program-status',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program',
'text': 'mt3s.marketing_program.field.owner',
'class': 'visible-md visible-lg col-program-owner',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program',
'orderBy': 'p.startDate',
'text': 'mt3s.marketing_program.field.start_date',
'class': 'visible-md visible-lg col-program-start',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program',
'orderBy': 'p.endDate',
'text': 'mt3s.marketing_program.field.end_date',
'class': 'visible-md visible-lg col-program-end',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program',
'orderBy': 'p.budgetPlanned',
'text': 'mt3s.marketing_program.field.budget_planned',
'class': 'visible-md visible-lg col-program-budget text-right',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program',
'orderBy': 'p.id',
'text': 'mautic.core.id',
'class': 'visible-md visible-lg col-program-id',
}) }}
</tr>
</thead>
<tbody>
{% for item in items %}
{% set canEdit = securityHasEntityAccess(permissions['mt3smarketingprogram:programs:editown'], permissions['mt3smarketingprogram:programs:editother'], item.createdBy) %}
<tr>
<td>
{{- include('@MauticCore/Helper/list_actions.html.twig', {
'item': item,
'templateButtons': {
'edit': canEdit,
'delete': securityHasEntityAccess(permissions['mt3smarketingprogram:programs:deleteown'], permissions['mt3smarketingprogram:programs:deleteother'], item.createdBy),
},
'routeBase': 'program',
'langVar': 'program',
}) -}}
</td>
<td>
<div>
{{- include('@MauticCore/Helper/publishstatus_icon.html.twig', {
'item': item,
'model': 'program',
}) -}}
<a href="{{ path('mt3s_marketing_program_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 : 'mt3s.marketing_program.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 %}
{{ mt3s_marketing_program_money(item.budgetPlanned) }} {{ mt3s_marketing_program_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('mt3s_marketing_program_index'),
'sessionVar': 'program',
}) -}}
</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.onboarding.heading',
'subheading': 'mt3s.marketing_program.onboarding.subheading',
'copy': 'mt3s.marketing_program.onboarding.copy',
}) }}
</div>
{% endif %}
</div>
</div>
{% endblock %}