feat(call-script): add the Call Script component (0.19.0)
A new Mautic component, listed under Components > Call Scripts (/s/call-scripts),
built like the other domains on AbstractStandardFormController/FormModel.
- CallScript (mt3s_call_scripts): name, description, category, owner, status,
the publish window shown as start/end date and time, the HTML script with
dynamic tokens kept as typed (html cleaning mask), the calling window
(weekdays, hours, sentinel in the contact's or a fixed timezone) and the retry
policy (max attempts, delay, backoff: none/linear/exponential)
- CallScriptOutcome (mt3s_call_script_outcomes, ON DELETE CASCADE): label,
data type (checkbox/radio/free text/dropdown), options JSON ({value,label})
and position; nested collections reuse the program-collection JS
- validators: ValidCallingWindow, ValidCallScriptOutcomeOptions, and an atPath
option on EndDateAfterStartDate so its violation lands on publishDown
- config: routes, the Components menu item (parent mautic.core.components),
call_script category type, model alias, call_scripts permissions, version 0.19.0
- migration Version_0_19_0 creates both tables and their FKs immediately
(users/categories SET NULL, outcomes CASCADE), idempotent
- translations en_US/fr_FR, unit tests, readme/AGENTS documentation
This commit is contained in:
1 parent
88256ca345
commit
4fb36eebfc
33 files changed
+2537
-6
No files matched your search
@@ -0,0 +1,133 @@
|
||||
{% set isIndex = 'index' == tmpl|default('index') ? true : false %}
|
||||
{% set tmpl = 'list' %}
|
||||
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
|
||||
|
||||
{% block mauticContent %}mt3sMpCallScript{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ 'mt3s.call_script.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">
|
||||
{# The toolbar belongs to the full page only: ajax reloads (sort, filter, pagination)
|
||||
replace the contents of .page-list, so including it here again would duplicate it. #}
|
||||
{% if isIndex %}
|
||||
{{- include('@MauticCore/Helper/list_toolbar.html.twig', {
|
||||
'searchValue': searchValue,
|
||||
'action': currentRoute,
|
||||
'page_actions': {
|
||||
'templateButtons': {
|
||||
'new': permissions[permissionBase ~ ':create'],
|
||||
},
|
||||
'langVar': 'mt3smarketingprogram.call_scripts',
|
||||
'routeBase': 'call_scripts',
|
||||
},
|
||||
'bulk_actions': {
|
||||
'langVar': 'mt3smarketingprogram.call_scripts',
|
||||
'templateButtons': {
|
||||
'delete': permissions[permissionBase ~ ':deleteown'] or permissions[permissionBase ~ ':deleteother'],
|
||||
},
|
||||
},
|
||||
}) -}}
|
||||
{% endif %}
|
||||
<div class="page-list">
|
||||
{% if items is defined and items is not empty %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover" id="callScriptTable">
|
||||
<thead>
|
||||
<tr>
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'checkall': 'true',
|
||||
'target': '#callScriptTable',
|
||||
}) }}
|
||||
{# Columns: Name, Category, Status, Owner, Modified. #}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'orderBy': tablePrefix ~ '.name',
|
||||
'text': 'mt3s.call_script.field.name',
|
||||
'class': 'col-call-script-name',
|
||||
'default': true,
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'text': 'mt3s.call_script.list.category',
|
||||
'class': 'visible-md visible-lg col-call-script-category',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'orderBy': tablePrefix ~ '.isPublished',
|
||||
'text': 'mt3s.call_script.list.status',
|
||||
'class': 'col-call-script-status',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'text': 'mt3s.call_script.list.owner',
|
||||
'class': 'visible-md visible-lg col-call-script-owner',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'orderBy': tablePrefix ~ '.dateModified',
|
||||
'text': 'mt3s.call_script.list.modified',
|
||||
'class': 'visible-md visible-lg col-call-script-date',
|
||||
}) }}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
{% set canEdit = securityHasEntityAccess(permissions[permissionBase ~ ':editown'], permissions[permissionBase ~ ':editother'], item.createdBy) %}
|
||||
<tr>
|
||||
<td>
|
||||
{{- include('@MauticCore/Helper/list_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'edit': canEdit,
|
||||
'delete': securityHasEntityAccess(permissions[permissionBase ~ ':deleteown'], permissions[permissionBase ~ ':deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'mt3smarketingprogram.call_scripts',
|
||||
'routeBase': 'call_scripts',
|
||||
}) -}}
|
||||
</td>
|
||||
<td>
|
||||
{% if canEdit %}
|
||||
<a href="{{ path(actionRoute, {'objectAction': 'edit', 'objectId': item.id}) }}" data-toggle="ajax">{{ item.name }}</a>
|
||||
{% else %}
|
||||
{{ item.name }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="visible-md visible-lg">{{ item.category.name|default('—') }}</td>
|
||||
<td>
|
||||
{% if item.isPublished %}
|
||||
<span class="label label-success"{% if item.publishUp or item.publishDown %} title="{{ item.publishUp ? item.publishUp|date('Y-m-d H:i') : '' }} → {{ item.publishDown ? item.publishDown|date('Y-m-d H:i') : '' }}"{% endif %}>{{ 'mt3s.call_script.list.published'|trans }}</span>
|
||||
{% else %}
|
||||
<span class="label label-default">{{ 'mt3s.call_script.list.unpublished'|trans }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="visible-md visible-lg">{{ item.owner.name|default('—') }}</td>
|
||||
<td class="visible-md visible-lg">{{ item.dateModified ? dateToFull(item.dateModified) : '—' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="panel-footer">
|
||||
{{- include('@MauticCore/Helper/pagination.html.twig', {
|
||||
'totalItems': totalItems,
|
||||
'page': page,
|
||||
'limit': limit,
|
||||
'baseUrl': path(indexRoute),
|
||||
'sessionVar': sessionVar,
|
||||
}) -}}
|
||||
</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.call_script.onboarding.heading',
|
||||
'subheading': 'mt3s.call_script.onboarding.subheading',
|
||||
'copy': 'mt3s.call_script.onboarding.copy',
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user