docs(public): plain public readme, GPL LICENSE, internal docs to git-ignored AGENTS.md

This commit is contained in:
Alexandre Gain committed 2026-11-21 13:25:30 +01:00
1 parent b138056e43
commit d6b3488cad
5 files changed
+738 -445

No files matched your search

+2
View File
@@ -6,3 +6,5 @@
.claude/
.phpunit.result.cache
.phpunit.result/
.php-cs-fixer.cache
/AGENTS.md
-1
View File
@@ -1 +0,0 @@
{"php":"8.3.36","version":"3.95.32:v3.95.32#c12acc751f4039935429057f1fadf0e5f62601c1","indent":" ","lineEnding":"\n","rules":{"align_multiline_comment":true,"backtick_to_shell_exec":true,"binary_operator_spaces":{"operators":{"=>":"align","=":"align"}},"blank_line_before_statement":{"statements":["return"]},"braces_position":{"allow_single_line_anonymous_functions":true,"allow_single_line_empty_anonymous_classes":true},"class_attributes_separation":{"elements":{"method":"one"}},"class_definition":{"single_line":true},"class_reference_name_casing":true,"clean_namespace":true,"concat_space":true,"declare_parentheses":true,"echo_tag_syntax":true,"empty_loop_body":{"style":"braces"},"empty_loop_condition":true,"fully_qualified_strict_types":true,"function_declaration":{"closure_fn_spacing":"one"},"general_phpdoc_tag_rename":{"replacements":{"inheritDocs":"inheritDoc"}},"global_namespace_import":{"import_classes":false,"import_constants":false,"import_functions":false},"include":true,"increment_style":true,"integer_literal_case":true,"lambda_not_used_import":true,"linebreak_after_opening_tag":true,"magic_constant_casing":true,"magic_method_casing":true,"method_argument_space":{"after_heredoc":true,"on_multiline":"ignore"},"native_function_casing":true,"native_type_declaration_casing":true,"no_alias_language_construct_call":true,"no_binary_string":true,"no_blank_lines_after_phpdoc":true,"no_empty_comment":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_extra_blank_lines":{"tokens":["attribute","case","continue","curly_brace_block","default","extra","parenthesis_brace_block","square_brace_block","switch","throw","use"]},"no_leading_namespace_whitespace":true,"no_mixed_echo_print":true,"no_multiline_whitespace_around_double_arrow":true,"no_null_property_initialization":true,"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_around_offset":true,"no_superfluous_phpdoc_tags":{"allow_mixed":true},"no_trailing_comma_in_singleline":true,"no_unneeded_braces":{"namespaces":true},"no_unneeded_control_parentheses":{"statements":["break","clone","continue","echo_print","negative_instanceof","others","return","switch_case","yield","yield_from"]},"no_unneeded_import_alias":true,"no_unset_cast":true,"no_unused_imports":true,"no_useless_concat_operator":true,"no_useless_else":true,"no_useless_nullsafe_operator":true,"no_useless_return":true,"no_whitespace_before_comma_in_array":{"after_heredoc":true},"normalize_index_brace":true,"object_operator_without_whitespace":true,"operator_linebreak":{"only_booleans":true},"ordered_imports":true,"php_unit_fqcn_annotation":true,"php_unit_method_casing":true,"phpdoc_align":true,"phpdoc_annotation_without_dot":true,"phpdoc_indent":true,"phpdoc_inline_tag_normalizer":true,"phpdoc_no_access":true,"phpdoc_no_alias_tag":{"replacements":{"const":"var","link":"see","property-read":"property","property-write":"property","type":"var"}},"phpdoc_no_package":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_order":{"order":["param","return","throws"]},"phpdoc_return_self_reference":true,"phpdoc_scalar":{"types":["boolean","callback","double","integer","never-return","never-returns","no-return","real","str"]},"phpdoc_separation":{"groups":[["Annotation","NamedArgumentConstructor","Target"],["author","copyright","license"],["category","package","subpackage"],["property","property-read","property-write"],["deprecated","link","see","since"]],"skip_unlisted_annotations":false},"phpdoc_single_line_var_spacing":true,"phpdoc_summary":true,"phpdoc_tag_type":{"tags":{"inheritDoc":"inline"}},"phpdoc_trim":true,"phpdoc_trim_consecutive_blank_line_separation":true,"phpdoc_types":true,"phpdoc_types_order":{"null_adjustment":"always_last","sort_algorithm":"none"},"phpdoc_var_annotation_correct_order":true,"phpdoc_var_without_name":true,"protected_to_private":true,"semicolon_after_instruction":true,"simple_to_complex_string_variable":true,"single_import_per_statement":true,"single_line_comment_spacing":true,"single_line_comment_style":{"comment_types":["hash"]},"single_line_throw":true,"single_quote":true,"single_space_around_construct":true,"space_after_semicolon":{"remove_in_empty_for_expressions":true},"standardize_increment":true,"standardize_not_equals":true,"statement_indentation":{"stick_comment_to_next_continuous_control_statement":true},"switch_continue_to_break":true,"trailing_comma_in_multiline":{"after_heredoc":true,"elements":["array_destructuring","arrays","match","parameters"]},"trim_array_spaces":true,"type_declaration_spaces":{"elements":["function","property"]},"unary_operator_spaces":true,"whitespace_after_comma_in_array":true,"yoda_style":true,"nullable_type_declaration":true,"ordered_types":{"null_adjustment":"always_last","sort_algorithm":"none"},"single_class_element_per_statement":true,"types_spaces":true,"array_indentation":true,"array_syntax":{"syntax":"short"},"attribute_block_no_spaces":true,"cast_spaces":true,"new_with_parentheses":{"anonymouLine truncated
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
-200
View File
@@ -1,200 +0,0 @@
# Merge Smartlinks into MT3S Marketing Program
Instructions for merging the `SmartlinksBundle` plugin (`mautic-plugin-smartlinks`) into
`MT3SMarketingProgramBundle` (this repo) as one unique bundle.
- **Reversibility**: both repos are tagged `pre-merge-v1` (pushed to origin).
Roll back with `git reset --hard pre-merge-v1`.
- **Principles**:
1. One unique bundle: `MT3SMarketingProgramBundle` hosts everything.
2. Domains stay separate: the *Marketing Program* domain and the *Smart Links* domain keep
their own menu groups, routes, permission categories, configuration sections and
translation prefixes. They only share the bundle, the plugin row and the codebase.
3. Every entity is left intact: no table, column or JSON shape changes. Only the PHP
namespace of the Smart Links classes changes.
4. Mautic naming best practices, vendor **MT3 Solutions** (acronym **MT3S**): the host
bundle already follows them (`MauticPlugin\MT3SMarketingProgramBundle`,
`mt3s/mautic-marketing-program-bundle`, service ids `mt3s.*`, params
`mt3s_marketing_program_*`, tables `mt3s_mp_program_*`, permission base
`mt3smarketingprogram`).
## Inventory
### Coming in from `mautic-plugin-smartlinks` (Smart Links domain, version 0.6.0)
| Layer | Contents |
|---|---|
| Entities | `SmartLink` (`smart_links`), `SmartLinkHit` (`smart_link_hits`), `UtmTaxonomy` (`utm_taxonomies`) + repositories |
| Models | `SmartLinkModel` (`smartlinks.smart_link`), `UtmTaxonomyModel` (`smartlinks.utm_taxonomy`) |
| Controllers | `SmartLinkController`, `UtmTaxonomyController`, `PublicController` (public `/l/{slug}`) |
| Forms / validators | `SmartLinkType`, `UtmTaxonomyType`, `SmartLinkValidator`, `UtmTaxonomyValidator`, `UtmSettingsValidator`, `SmartlinksSettingsType`, `SmartLinksConfigType`, `ConfigType`-era classes, `UtmTagsTypeExtension`, `UtmFieldsApplicator`, `UtmSettingsTransformer`, catalog (`UtmParameterCatalog` …) |
| Services | `UtmConfigurationProvider`, `UtmConfigurationNormalizer`, `SmartLinkShortUrlBuilder` |
| Views | `Resources/views/SmartLink/*`, `Resources/views/UtmTaxonomy/*`, `Resources/views/FormTheme/Config/*` |
| Config tab | "Smart Links Settings" (`SmartlinksConfigSubscriber` + theme): section "UTM Settings" (enforce lowercase, separator, short link domain) + section "Parameters" |
| Menu | Group "Smart Links": children "UTM Taxonomies" (above) and "Smart Links" |
| Permissions | categories `smart_links`, `taxonomies` (base `smartlinks:`) |
| Params | `smartlinks_utm_config`, `smartlinks_config` (+ legacy keys `utm_manager_config`, `utm_manager_smart_links`) |
| Translations | `mautic.smartlinks.*` keys (en_US + fr_FR) |
| Migrations | `Version_0_2_0` … `Version_0_6_0` (all idempotent by schema checks) |
| Other | `Assets/js/smartlinks.js`, `Tests/Unit/*` (90 tests), `phpunit.xml.dist`, icon |
| Public | route `/l/{slug}` — short links keep working, no URL change |
### Already in the host (Marketing Program domain, version 0.17.0)
`mt3s_mp_program*` tables (programs, tasks, stakeholders, audiences, item types), menu group
"Programs" with 5 children, permission base `mt3smarketingprogram:` (categories `programs`,
`tasks`, `stakeholders`, `audiences`, `itemtypes`), config tab "Program Settings",
params `mt3s_marketing_program_*`, translations `mt3s.marketing_program.*`,
`Assets/js/mt3s-mp-program.js`, migrations `Version_0_2_0` … `Version_0_17_0`.
## Impact analysis
1. **Namespace** — every `MauticPlugin\SmartlinksBundle\` reference becomes
`MauticPlugin\MT3SMarketingProgramBundle\`. Pure textual remap; classes keep their names
(domains stay identifiable by their class-name prefixes: `SmartLink*`, `UtmTaxonomy*` vs
`Program*`, `Task*`, `Stakeholder*`, `Audience*` — flat Mautic directory convention).
2. **Database — zero schema/data impact**: `smart_links`, `smart_link_hits`, `utm_taxonomies`
keep their names and columns. No migration of data is required; existing rows keep working
(proven idempotent migrations).
3. **Migration class-name collision (critical)**: both repos define `Version_0_2_0.php` …
overlapping names. One `Migrations/` directory cannot contain both sets (the engine builds
`MauticPlugin\<Bundle>\Migrations\<Class>` per file; duplicate class names are fatal).
→ The incoming Smart Links migrations are renamed with a suffix, e.g.
`Version_0_2_0.php` → `Version_0_2_0_SmartLinks.php` (class renamed accordingly).
Their `shouldExecute()` schema checks are unchanged, so nothing re-runs.
4. **Plugin row**: the two rows (`SmartlinksBundle` 0.6.0, `MT3SMarketingProgramBundle` 0.17.0)
become ONE: keep this repo's row (version bumped to `0.18.0`), delete the `SmartlinksBundle`
row. The engine replays every migration through its schema checks on reload — all no-op.
5. **Permissions (role re-grant)**: the categories `smart_links` and `taxonomies` move under
the host permission class, so their base becomes `mt3smarketingprogram:smart_links:*` /
`mt3smarketingprogram:taxonomies:*`. Stored role grants referencing the old
`smartlinks:*` base must be re-granted once (dev DB: admin only, zero impact; production:
one-time re-grant, same as the 0.5.0 rename).
6. **Routes keep their names** (`mautic_smartlinks_*`) and paths (`/smart-links`, `/utm-taxonomies`,
`/l/{slug}`): no session, bookmark or saved-list breakage. (Optional later cosmetic pass to
`mt3s_smart_links_*` is noted but not required.)
7. **Menu**: the "Smart Links" group is added as a second top-level entry next to "Programs" —
domains remain separately visible, no icon/id collisions.
8. **Config**: the "Smart Links Settings" tab (`smartlinksconfig` alias) is added alongside
"Program Settings"; its params (`smartlinks_utm_config`, `smartlinks_config` + legacy keys)
move into `Config/config.php` verbatim — saved local.php values keep working, including the
legacy-key fallbacks.
9. **Translations**: the `mautic.smartlinks.*` keys are appended to this repo's
`Translations/{en_US,fr_FR}/messages.ini|validators.ini` (key prefixes are globally unique —
parse-check every file after each edit; a stray quote kills the whole catalog).
10. **Assets**: `smartlinks.js` becomes `Assets/js/mt3s-mp-smartlinks.js` (host file-naming
convention; the mauticContent/OnLoad prefixes it registers are unchanged).
11. **Integrations**: the host keeps `MT3SMarketingProgramIntegration`; the Smart Links
`SmartlinksIntegration` (+ its `ConfigSupport`) move in as additional
`mautic.integration` services — one plugin may register several.
12. **Dev environment**: `docker-compose.yml` drops the `PLUGIN_SMARTLINKS_PATH` mount; this
repo remains the single `MT3SMarketingProgramBundle` mount. `.env` updated accordingly.
13. **The `mautic-plugin-smartlinks` repo** becomes obsolete after the merge: archive it, don't
delete (it carries `pre-merge-v1` and the full history).
## Procedure (step by step)
All work happens on a branch `merge-smartlinks` of THIS repo. The `mautic-plugin-smartlinks`
repo is read-only source material (already tagged).
### Phase 1 — import the Smart Links code
1. From `mautic-plugin-smartlinks`, copy into this repo (paths unchanged):
`Catalog/`, `Controller/` (the 3 Smart Links controllers), `Entity/` (3 entities + 3
repositories), `EventListener/` (`SmartLinksConfigSubscriber`, `PluginInstallSubscriber`),
`Form/` (types, validators, transformer, applicator, extension), `Integration/`
(Smartlinks integration + ConfigSupport), `Model/` (2 models), `Resources/views/SmartLink/`,
`Resources/views/UtmTaxonomy/`, `Resources/views/FormTheme/Config/`, `Service/` (3 services),
`Assets/img/` (icon), `Tests/Unit/…` (the smartlinks tests).
2. Textual namespace remap in every copied file:
`MauticPlugin\SmartlinksBundle\` → `MauticPlugin\MT3SMarketingProgramBundle\`.
3. `Assets/js/smartlinks.js` → `Assets/js/mt3s-mp-smartlinks.js` (contents unchanged).
4. Migrations: copy `Version_0_2_0.php` … `Version_0_6_0.php` renamed to
`Version_0_2_0_SmartLinks.php` … `Version_0_6_0_SmartLinks.php` (class names likewise);
namespace remap; the `TABLE_NAME` constants they reference are unchanged.
5. Gate: `grep -rn "SmartlinksBundle" .` must return zero hits afterwards.
### Phase 2 — merge Config/config.php
Add to this repo's `Config/config.php` (keep every existing entry untouched):
- `routes.main`: the 4 Smart Links routes (`mautic_smartlinks_index`, `mautic_smartlinks_action`,
`mautic_smartlinks_taxonomies`, `mautic_smartlinks_taxonomy_action`), controllers re-pointed
at the new namespace; keep `routes.public` `mautic_smartlinks_go` (`/l/{slug}`).
- `menu.main`: the whole `mautic.smartlinks.menu.root` group (UTM Taxonomies above Smart Links),
access arrays re-based to `mt3smarketingprogram:smart_links:*` / `mt3smarketingprogram:taxonomies:*`.
- `services.integrations`: `mt3s.smart_links.integration` + `…integration.configuration`
(host `mt3s.*` id convention; class namespaces remapped).
- `parameters`: `smartlinks_utm_config`, `smartlinks_config`, legacy `utm_manager_config`,
`utm_manager_smart_links` — verbatim.
- Bump `'version'` to `'0.18.0'`; extend `'description'` to mention smart links.
### Phase 3 — fold permissions, services, config tab
- `Security/Permissions/MT3SMarketingProgramPermissions.php`: add
`$this->addExtendedPermissions('smart_links'); $this->addExtendedPermissions('taxonomies');`
and the matching `addExtendedFormFields('mt3smarketingprogram', 'smart_links'|'taxonomies', …)`
lines; do NOT copy `SmartlinksPermissions.php` into the bundle.
- `Config/services.php`: add the model aliases
`mautic.smartlinks.model.smart_link` / `mautic.smartlinks.model.utm_taxonomy`
(plus `mt3s.smart_links.model.*` aliases if wanted); nothing else — autoconfiguration
picks up the new classes.
- `SmartLinksConfigSubscriber`: verify the `'bundle' => 'MT3SMarketingProgramBundle'` entry and
the `@Smartlinks/FormTheme/Config/…` twig paths (the twig namespace follows the bundle name).
### Phase 4 — translations
Append the `mautic.smartlinks.*` keys from the source repo's 4 ini files into this repo's
4 ini files (same keys, no renames; the `SmartlinksConfigSubscriber` tab key
`mautic.config.tab.smartlinksconfig` comes along). **Parse-check all 4 files after every
edit** — `parse_ini_file()` must not return `false` (a single stray quote kills the whole
catalog, as happened in 0.6.0).
### Phase 5 — dev environment + database registration
1. `mautic-dev-env/docker-compose.yml`: remove the `PLUGIN_SMARTLINKS_PATH` mount line;
`.env` + `.env.example`: remove the variable.
2. `docker compose up -d` (recreates the containers with the single mount).
3. Database: `DELETE FROM plugins WHERE bundle='SmartlinksBundle';` and
`UPDATE plugins SET version='0.18.0' WHERE bundle='MT3SMarketingProgramBundle';`
4. Stop the background containers, then:
`./dev.sh cc && ./dev.sh console mautic:plugins:reload`
then restart them (they race the cache clear; the web container also needs a restart
afterwards when opcache validates timestamps off).
5. `./dev.sh console mautic:assets:generate`.
### Phase 6 — verification checklist
- [ ] `php -l` over every file; full ini parse-check (4 files)
- [ ] Plugin row: ONE `MT3SMarketingProgramBundle` 0.18.0; Plugins page shows "MT3S Marketing Program"
- [ ] Menu: "Programs" group (5 children) AND "Smart Links" group (UTM Taxonomies, Smart Links)
- [ ] Config: "Program Settings" tab AND "Smart Links Settings" tab (UTM Settings + Parameters)
- [ ] Smart Links: list/create/edit; taxonomy select + fieldsets; out-of-list value rejected
- [ ] UTM Taxonomies: list/create/edit (checkbox subsets + free-value lists)
- [ ] Public redirect: `curl -sI -H 'Host: <short_link_domain>' http://localhost:8080/l/<slug>`
→ 302 with UTM parameters on the Location; hits recorded in `smart_link_hits`
- [ ] Marketing Program pages: programs, tasks, stakeholders, audiences, item types all load
- [ ] Translations: no raw `mautic.*` keys anywhere (en + fr)
- [ ] Roles: re-grant `mt3smarketingprogram:smart_links:*` / `…:taxonomies:*` where needed
- [ ] Tests: `php /tmp/phpunit.phar --do-not-cache-result -c
docroot/plugins/MT3SMarketingProgramBundle/phpunit.xml.dist` (merged suites, both domains)
- [ ] Legacy data: `smart_links` / `utm_taxonomies` rows intact; `mt3s_mp_*` tables untouched
### Phase 7 — finalize
1. `readme.md`: add the Smart Links domain section (structure, short links, taxonomies,
public redirect, tests).
2. Commit `feat: merge Smartlinks into MT3S Marketing Program (smart links + UTM taxonomies)`;
push; tag `post-merge-v1`; archive `mautic-plugin-smartlinks`.
3. Rollback at any point: `git reset --hard pre-merge-v1` in this repo — the source repo is
untouched throughout the merge.
## Risk register
| Risk | Mitigation |
|---|---|
| Migration class-name collision → fatal reload | Phase 1.4 renames the incoming set; verify no duplicate class names in `Migrations/` |
| Broken translation catalog (stray quote) | Phase 4 parse-check after every edit |
| `cache:clear` races / opcache staleness | stop cron+worker, `dev.sh cc`, restart the web container |
| Permission base change breaks saved roles | Phase 6 re-grant checklist (documented, one-time) |
| Missed namespace reference | Phase 1.5 grep gate: zero `SmartlinksBundle` hits |
| Data loss | none by design: no schema/data migration; `pre-merge-v1` tags on both repos |
+62 -244
View File
@@ -1,12 +1,33 @@
# Mautic MT3S Marketing Program plugin
# MT3S Marketing Program for Mautic
A custom Mautic 7 plugin (`MT3SMarketingProgramBundle`) by MT3 Solutions with two separate domains: **Marketing Programs** — programs with a name, status, owner, dates, budget and category, with their mt3s_mp_programs — and **Smart Links** — short links (`/l/{slug}`) that tag the click with the UTM parameters of a UTM taxonomy before redirecting. The two domains share one bundle, one permission base (`mt3smarketingprogram:*`), one Plugins page entry and one config page, but keep separate menus, tables and code.
A free, open-source plugin for **Mautic 7** that adds two marketing tools to your instance:
This repository holds only the plugin source. The bundle files are at the repository root, and Mautic loads them from `docroot/plugins/MT3SMarketingProgramBundle`. The plugin was called `PlanBundle` before 0.16.0 and `ProgramBundle` (with programs) before 0.17.0, and the Smart Links used to be a separate `SmartlinksBundle` plugin before 0.18.0: see *Rename history* below.
- **Marketing Programs** — plan and track your marketing activities. Programs carry a status,
owner, dates, budget and category, and hold everything that makes them real: objectives,
insight notes, budget allocations, stakeholders and audiences, and a task list with
dependencies, milestones, phases and RACI assignments.
- **Smart Links** — short links (like `https://links.example.com/l/abc`) that redirect visitors
to any destination — an external URL or a Mautic landing page or form — while tagging the
click with the UTM parameters you choose and counting every hit for the statistics.
Both tools appear in the Mautic menu, are fully permission-aware, and keep their data in their
own database tables. They share one plugin, so you install and configure them once.
## Requirements
- Mautic 7
- PHP 8.2 or newer
## Installation
1. Copy or clone this repository into your Mautic installation as `docroot/plugins/MT3SMarketingProgramBundle`. The folder name must be `MT3SMarketingProgramBundle`.
The step-by-step guide lives in the project wiki:
> **[Installing the MT3S Marketing Program Bundle on Mautic](https://git.mt3.solutions/MT3S/mautic-marketing-program-bundle/wiki/Installing-the-MT3S-Marketing-Program-Bundle-on-Mautic)**
In short:
1. Copy or clone this repository into your Mautic installation as
`docroot/plugins/MT3SMarketingProgramBundle` (the folder name matters).
2. Clear the cache and register the plugin:
```bash
@@ -16,251 +37,48 @@ This repository holds only the plugin source. The bundle files are at the reposi
3. In Mautic, go to **Settings > Plugins**, open **MT3S Marketing Program** and publish it.
Programs are listed under **Marketing Programs** in the main menu (URL `/s/marketing-programs`), tasks under **Marketing Programs > Tasks** (URL `/s/marketing-program-tasks`), the stakeholder directory under **Marketing Programs > Stakeholders** (URL `/s/marketing-program-stakeholders`), and the audience directory under **Marketing Programs > Audiences** (URL `/s/marketing-program-audiences`). The item type lists are edited under **Marketing Programs > Item types** (URL `/s/marketing-program-item-types`). The Smart Links of the second domain are listed under **Smart Links > Smart Links** (URL `/s/smart-links`) and their UTM taxonomies under **Smart Links > UTM Taxonomies** (URL `/s/utm-taxonomies`). Users who aren't administrators need a role with the **Marketing Program Permissions** set in **Settings > Roles** (the Smart Links domain adds `mt3smarketingprogram:smart_links:*` and `mt3smarketingprogram:taxonomies:*`; the marketing program domain uses `mt3smarketingprogram:programs:*` and its other keys).
## What you get
### Marketing Programs
- A **Marketing Programs** menu with the program list, the task list, the stakeholder directory,
the audience directory and the **Item types** page where you define the types used by
programs (with their pictograms), tasks, stakeholders and audiences.
- A program page with seven tabs: **Details**, **Insights**, **Objectives**, **Allocations**,
**Audiences**, **Stakeholders** and **Tasks**.
- Tasks have types, statuses, planned dates and effort, and can depend on each other
(end-to-start and the other combinations). A milestone pins its end date to its start date;
a phase groups tasks. Stakeholders can be assigned to a task as Responsible, Accountable,
Consulted or Informed (RACI).
- A console command, `php bin/console mt3s:marketing-program:refresh-stats`, recomputes and
prints per-program statistics.
### Smart Links
- A **smart link** is a short link: a slug (like `https://m.shrl.be/l/y32b`), a destination URL, and an optional **UTM taxonomy**. When it is hit, the visitor is redirected to the destination with the taxonomy's UTM parameters appended, and the hit is recorded (`smart_link_hits`).
- The **UTM taxonomies** (`/s/utm-taxonomies`) define, per UTM parameter (`utm_source`, `utm_medium`, `utm_campaign`, `utm_content`, `utm_term`), whether and how the taxonomy's values apply: as a fixed value, as a pick list on the link, or as a free text field. The Smart Link form then shows exactly the fields the taxonomy allows, and rejects values outside a pick list.
- The **short link domain** is set under **Settings > Configuration > Smart Links Settings**, together with which UTM parameters to use and their modes. The public `/l/{slug}` route only answers on the configured domain (404 elsewhere), doesn't require authentication, and records one hit for the statistics; a statistics failure never blocks the redirect. The redirect status code (301, 302, …) is per link.
- A link redirects to its external **destination URL**, or — redirect type `mautic` — to its Mautic **landing page or standalone form**. The redirect never happens for an unknown slug, an unpublished link, or a link without destination: 404.
- The Smart Links domain was merged from the standalone `SmartlinksBundle` plugin (versions 0.1.0 to 0.6.0) in 0.18.0: routes, tables, URL format and translation keys are unchanged, so existing short links keep working. Roles must be re-granted (`smartlinks:smart_links:*` → `mt3smarketingprogram:smart_links:*`, `smartlinks:taxonomies:*` → `mt3smarketingprogram:taxonomies:*`).
- A **Smart Links** menu with your short links and their **UTM Taxonomies**.
- Each link is a short slug (up to 9 characters) plus a destination: an external URL, or a
Mautic landing page / standalone form. Choose the redirect status code per link
(301, 302, …).
- A **UTM taxonomy** defines, for each of the five standard UTM parameters, whether the link
sets a fixed value, offers a pick list, or accepts free text. The link form then shows exactly
the fields the taxonomy allows.
- The public route `/l/{slug}` needs no login, only answers on the short-link domain you
configure (it stays a normal Mautic page on any other domain), records a hit per click —
date, IP, referer, user agent — and never lets a statistics failure block the redirect.
Before using the items of a program's **Insights**, **Objectives**, **Allocations** and **Tasks** tabs, set up their types under **Marketing Programs > Item types** (`mt3smarketingprogram:itemtypes:view` to see the page, `mt3smarketingprogram:itemtypes:edit` to save it).
## Configuration
## Development
- **Settings > Configuration > Marketing Program Settings**: the general settings — the
currency, the stakeholder phone region and the audience attribute toggles.
- **Settings > Configuration > Smart Links Settings**: the short-link domain and, per UTM
parameter, whether it is used and how.
- **Settings > Roles**: the plugin's permissions live under **Marketing Program Permissions**
(programs, tasks, stakeholders, audiences, item types, categories, smart links and UTM
taxonomies). Users need them unless they are administrators.
Run the plugin in the shared Docker environment, [mautic-dev-env](https://git.mt3.solutions/MT3S/mautic-dev-env). Clone both repositories side by side:
## License
```
~/projects/
mautic-marketing-program-bundle/
```
This plugin is free software: you can use, study, modify and redistribute it under the terms of
the **GNU General Public License v3.0 or later**. See [LICENSE](LICENSE) for the full text.
In the dev environment's `.env`, point it at this plugin:
```
PLUGIN_PATH=../mautic-marketing-program-bundle
```
The dev environment mounts it as `docroot/plugins/MT3SMarketingProgramBundle`.
Run all commands from the `mautic-dev-env` folder:
```bash
cd ../mautic-dev-env
./dev.sh up # start the stack
./dev.sh install # first time only: install Mautic and register the plugin
./dev.sh reload # after changing Config/config.php, services or entities
```
For the complete list of commands, see the dev environment's README.
## Coding standards
The plugin runs the same code quality tools as Mautic core, configured in the repository root:
- **PHP-CS-Fixer** (`.php-cs-fixer.dist.php`): core's own ruleset — `@Symfony` plus its tweaks (aligned `=>`/`=` operators, ordered imports, short arrays, no unused imports, no header comments) minus the custom fixer of the `mautic/coding-standards` package, which a standalone plugin repository cannot require.
- **PHPStan** (`phpstan.neon`): level 6, with the same pragmatic ignores core keeps, and the plugin's `Tests/bootstrap.php` as the bootstrap so the analysis resolves the classes of the Mautic installation. The documented pre-existing debt (Doctrine-assigned entity ids, historical migrations referencing the pre-rename entity classes, core's generic `AbstractCommonModel::getRepository()` annotations) is recorded in `phpstan-baseline.neon`; new errors still fail the analysis. Regenerate after fixing entries: `vendor/bin/phpstan analyse --generate-baseline -c phpstan.neon`.
- **GitLab CI** (`.gitlab-ci.yml`): every push runs `composer cs-check` and `composer phpstan`. The PHPUnit suite is not run in CI: it needs a full Mautic installation (its bootstrap walks up to the nearest `vendor/autoload.php`).
The tools are `require-dev` dependencies (`composer install` in the plugin directory pulls `mautic/core-lib` and the tools, so the analysis sees the real Mautic signatures):
```bash
composer install # once, in the plugin directory
composer cs-check # dry run with the diff
composer cs-fix # fix in place
composer phpstan # PHPStan level 6
```
From the dev environment's running Mautic container instead (no local `composer install` needed):
```bash
docker compose exec mautic_web php vendor/bin/phpunit -c docroot/plugins/MT3SMarketingProgramBundle/phpunit.xml.dist
```
## Plugin structure
The plugin uses the IntegrationsBundle conventions:
- `MT3SMarketingProgramBundle.php`: the bundle class
- `Config/config.php`: metadata, routes, menu and integration service tags
- `Config/services.php`: autowires and autoconfigures every class in the bundle
- `DependencyInjection/MT3SMarketingProgramExtension.php`: loads `Config/services.php`
- `Event/MT3SMarketingProgramEvents.php` and `Event/ProgramEvent.php`: the plugin's `mt3s.marketing_program.*` event names and their payload, dispatched by `Model/ProgramModel.php` on save and delete
- `Command/RefreshStatsCommand.php`: `mt3s:marketing-program:refresh-stats`, recomputes and prints the per-program statistics
- `Integration/MT3SMarketingProgramIntegration.php`: the integration that is listed on the Plugins page
- `Integration/Support/MT3SMarketingProgramConfigSupport.php`: the configuration form for the integration
- `Translations/en_US/messages.ini` and `validators.ini`: UI strings and validation messages
### Pages and permissions
- `Controller/ProgramController.php`: list, detail page, create, edit and delete (single and batch), built on core's `AbstractStandardFormController`
- `Resources/views/Program/list.html.twig`: the list. A program's name opens its detail page.
- `Resources/views/Program/form.html.twig` and `details.html.twig`: the create/edit form and the detail page. Both have the same seven tabs, from `_tabs.html.twig`: **Details**, **Insights** (description items), **Objectives**, **Allocations** (planned budget, currency and allocation items), **Audiences**, **Stakeholders** and **Tasks**.
- `Resources/views/Program/_task_table.html.twig`: the program's tasks in the Tasks tab. It has the harmonized tab columns (pictogram, Type, Name with kind badge for milestones and phases, Description, Start date, End date, Status — no ID), one row per task, no tree: a phase's or milestone's badge marks it in the name column. On the detail page it has an **Add task** button, links to each task and the filter/sort of the other tabs. On the program form it is read-only (no links, no filter), so that following a link doesn't drop unsaved changes.
- `Controller/TaskController.php` and `Resources/views/Task/`: the task list, and the create/edit form (**Marketing Programs > Tasks**). `new?program=ID` preselects the program. After Save or Cancel, the user goes back to where the form was opened from. Opened from **Marketing Programs > Tasks**, that's the task list. Opened from a program's Tasks tab, whose links carry `returnTo=program`, that's the program (its new program, if the task was moved). The origin is stored in the session when the form is opened, because the form posts without the query string.
- `Controller/SmartLinkController.php` and `Resources/views/SmartLink/`: the Smart Links list and form (**Smart Links > Smart Links**, `/s/smart-links`), built on core's `AbstractStandardFormController`.
- `Controller/UtmTaxonomyController.php` and `Resources/views/UtmTaxonomy/`: the UTM taxonomies list and form (**Smart Links > UTM Taxonomies**, `/s/utm-taxonomies`). Replaced the placeholder page of 0.17.0 in 0.18.0. `Model/UtmTaxonomyModel.php`, `Model/SmartLinkModel.php`, `Entity/SmartLink.php`, `Entity/SmartLinkHit.php`, `Entity/UtmTaxonomy.php` (tables `smart_links`, `smart_link_hits`, `utm_taxonomies` — unchanged from the standalone plugin), `Catalog/` (redirect codes 301/302/307/308, redirect types `external`/`mautic`, the UTM parameter catalog and its modes), `Form/` (the link and taxonomy forms, the per-taxonomy UTM fields via `Form/UtmFieldsApplicator.php`, the validators) and `Controller/PublicController.php` (the public `/l/{slug}`) make up the Smart Links domain.
- `EventListener/SmartLinksConfigSubscriber.php`: adds the **Smart Links Settings** tab to Settings > Configuration (`Form/Type/SmartLinksConfigType.php`, `Form/Type/SmartlinksSettingsType.php`, `Integration/Support/ConfigSupport.php`), next to the plugin's **Program Settings** tab; `Service/UtmConfigurationProvider.php` and `Service/UtmConfigurationNormalizer.php` read those parameters, `Service/SmartLinkShortUrlBuilder.php` builds the redirect URLs.
- `Assets/js/mt3s-mp-smartlinks.js`: the Smart Links form script (started by `Mautic.mt3sMpSmartLinkOnLoad()` when a page's `mauticContent` is `mt3sMpSmartLink`).
- `Tests/Unit/` and `phpunit.xml.dist`: the plugin's unit test suite (mostly covering the Smart Links domain: the catalog, the entities, the form type, the fields applicator, the validators, the models and the configuration provider).
- `Controller/ItemTypesController.php` and `Resources/views/ItemTypes/form.html.twig`: the Item types page (**Marketing Programs > Item types**). The type lists that used to be sections of **Settings > Configuration > Marketing Program Settings** (insights, allocation, objective, task, stakeholder types and the audience decision roles and tones) are edited here. `Form/Type/ItemTypesType.php` builds the lists, `Service/ItemTypeInUseGuard.php` refuses to remove a type that items still use, and the page saves through core's `Configurator` exactly like the Settings pages do: merge into `config/local.php`, write, refresh the config cache. **Settings > Configuration > Marketing Program Settings** keeps only the plugin's general settings: the currency, the stakeholder phone region and the audience attribute toggles.
- `Assets/js/mt3s-mp-program.js`: on the form, the objectives editor (add, remove, drag-and-drop ordering), and after a failed save, marking the tabs that contain errors with an icon and opening the first one. Started by `Mautic.mt3sMpProgramOnLoad()`.
The program's tab panes deliberately have no Bootstrap `fade` class. Core reopens the last tab used on a page (`12.tabs.js`), and the plugin opens the tab with an error after a failed save. With `fade`, those two `tab('show')` calls overlapped within the 150 ms transition and left two panes visible at once, so the Tasks tab also showed the objectives.
Which tab opens on a program's detail page and form (`Mautic.mt3sMpProgramInitTabs`):
- The tab last used for a program is remembered for the browser session (`sessionStorage`, key `mt3s.marketing_program.tab.<program id>`). The detail page and the form both reopen it, so Edit and Save keep the current tab. Cancel goes to the mt3s_mp_programs list, as in core.
- After a failed save, the first tab with an error opens instead, and every tab with an error gets a warning icon.
- Core reopens its own remembered tab on page load and after every Ajax request (`Mautic.rememberActiveTabs`), in an order that varies. `mt3s-mp-program.js` wraps that function, so the program's choice is applied right after core's restore, and only during the page load.
- A tab counts as having an error only if it shows an error message (`.help-block .alert-danger`), not just because an element has the `has-error` class. Mautic's own `checkbox_row` theme adds `has-error` to every checkbox: it tests `errors|length is not empty`, and `0` isn't "empty" in Twig. Every objective's "Achieved" checkbox would otherwise put a warning icon on the Objectives tab, and opening that tab on load looked like a jump to Objectives.
- `Security/Permissions/MT3SMarketingProgramPermissions.php`: the permissions shown in **Settings > Roles**
The main menu has a top-level **Programs** entry, with **Programs**, **Tasks**, **Stakeholders**, **Audiences** and **Item types** as its items. Add future pages as more children of `mt3s.marketing_program.menu.root` in `Config/config.php`.
The **Audiences** tab lists the program's audiences, harmonized like the other tabs: pictogram (fixed per audience type), Type, Name (a link to the audience's page in the directory), Priority in this program, Stages, Estimated size, Value proposition, Preferred channels.
| Route | URL | Purpose |
| --- | --- | --- |
| `mt3s_marketing_program_index` | `/s/marketing-programs/{page}` | Program list, with search on name |
| `mt3s_marketing_program_action` | `/s/marketing-programs/{objectAction}/{objectId}` | `view`, `new`, `edit`, `delete`, `batchDelete` |
| `mt3s_marketing_program_task_index` | `/s/marketing-program-tasks/{page}` | Task list, with search on name and description |
| `mt3s_marketing_program_task_action` | `/s/marketing-program-tasks/{objectAction}/{objectId}` | `new` (optional `?program=ID`), `edit`, `delete`, `batchDelete` |
| `mt3s_marketing_program_stakeholder_index` | `/s/marketing-program-stakeholders/{page}` | Stakeholder directory, with search on name, email, role and type |
| `mt3s_marketing_program_stakeholder_action` | `/s/marketing-program-stakeholders/{objectAction}/{objectId}` | `new`, `edit`, `delete`, `batchDelete` |
| `mt3s_marketing_program_audience_index` | `/s/marketing-program-audiences/{page}` | Audience directory, with search on name |
| `mt3s_marketing_program_audience_action` | `/s/marketing-program-audiences/{objectAction}/{objectId}` | `new`, `edit`, `view`, `delete`, `batchDelete` |
| `mt3s_marketing_program_utm_taxonomy_index` | `/s/marketing-program-utm-taxonomies/{page}` | UTM Taxonomies (placeholder, off-menu) |
The program templates don't pass `routeBase` to core's button helpers (`page_actions`, `list_actions`) when a "close" button is involved: from `routeBase`, core builds `mautic_<routeBase>_*` route names, which don't exist in this plugin. The other buttons use the `actionRoute` (`mt3s_marketing_program_action`) that the controller passes to the template.
Permission keys:
- `mt3smarketingprogram:programs:*`, `mt3smarketingprogram:tasks:*`, `mt3smarketingprogram:stakeholders:*` and `mt3smarketingprogram:audiences:*`: `viewown`, `viewother`, `editown`, `editother`, `create`, `deleteown`, `deleteother`, `publishown`, `publishother`, `full`. "Own" means items the user created (`createdBy`), as in core objects.
- `mt3smarketingprogram:categories:*`: managing the `program` category type.
### The Program object
- `Entity/Program.php`: the entity (table `mt3s_mp_programs`), with its Doctrine mapping and validation rules
- `Entity/ProgramStatus.php`: the status enum (`draft`, `planned`, `active`, `paused`, `completed`, `archived`)
- `Entity/ProgramRepository.php`: the repository
- `Entity/ProgramObjective.php` and `ProgramObjectiveRepository.php`: a program's objectives (table `mt3s_mp_program_objectives`): type (with its pictogram), title, description, position and an "achieved" flag
- `Entity/Audience.php`, `AudienceType.php`, `AudiencePriority.php` and `AudienceRepository.php`: the audiences of the global directory (table `mt3s_mp_program_audiences`, `plan_targets` before 0.15.0): name, a fixed type (persona, ICP, broad audience, lifecycle cohort, partner/influencer — each with its own pictogram), a tagline, the Mautic segments that hold this audience's contacts (see below), and the persona attributes the admin switched on (**Settings > Configuration > Marketing Program Settings**, one toggle per attribute, so a b2b install and a b2c install define their personas differently): profile criteria, motivations, barriers, frustrations (formerly pain points), triggers, a decision-making role (a value of the admin-edited list `mt3s_marketing_program_audience_decision_roles`), a preferred tone (checkboxes of the admin-edited list `mt3s_marketing_program_audience_tones`), preferred channels (checkboxes: email, SMS, web, social organic, paid social, paid search, events/webinar, outbound sales, partners), any number of Mautic stages (join table `mt3s_mp_program_audiences_stages`) and an estimated size. `Service/AudienceAttributes.php` reads the toggles.
- **Segments**: each audience can have any number of Mautic segments (LeadBundle lists), purely informational — nothing requires one, and nothing in the program depends on them. They are stored in the join table `mt3s_mp_program_audiences_segments` (audience_id, leadlist_id), picked in the audience form (published segments only), shown in the directory's Segments column (each with its count of contacts, from `lead_lists_leads` where `manually_removed = 0`) and on the detail page. `AudienceRepository::getSegmentContactCountsForAudiences()` computes the counts for the whole page in one query.
- `Entity/ProgramAudience.php`: the link between a program and an audience (table `mt3s_mp_program_audiences_program`), with the audience's priority in that program (primary, secondary, exclusion), a program-specific value proposition and a position. Deleting the program or the audience deletes the link (ON DELETE CASCADE both sides).
- `Model/AudienceModel.php`: the model, available as `mautic.mt3smarketingprogram.model.audience` or with `getModel('mt3smarketingprogram.audience')`.
- `Controller/AudienceController.php` and `Resources/views/Audience/`: the directory (**Marketing Programs > Audiences**), with the columns ID, Pictogram, Type, Name (with its tagline), Segments (each with its contact count), Estimated size, Active, and **Assigned mt3s_mp_programs** — the mt3s_mp_programs the audience is linked to, each with its priority in that program. The detail page lists the segments, the persona attributes that are filled in, and those mt3s_mp_programs.
- `Model/ProgramModel.php`: the model, available as `mautic.mt3smarketingprogram.model.program` or with `getModel('mt3smarketingprogram.program')`. A new program from `getEntity()` has the current user as owner.
- `Entity/ProgramDescriptionItem.php` and `ProgramDescriptionItemRepository.php`: a program's description items (table `mt3s_mp_program_description_items`): type, description and position. They make up the **Insights** tab and replace the former `description` field.
- `Form/Type/ProgramType.php`, `ProgramObjectiveType.php` and `ProgramDescriptionItemType.php`: the create and edit form, with the objectives and the description items as collections
- `Validator/Constraints/EndDateAfterStartDate.php`: the end date must be on or after the start date, when both are set. Used by mt3s_mp_programs and tasks, through `Entity/DateRangeInterface.php`.
Behaviour to know about:
- Setting the status to `completed` from another status sets `completedAt` to the current time. Moving a completed program to any other status clears `completedAt`.
- `owner` is required by validation, but the column is nullable: if the user is deleted, the owner becomes `NULL` (`ON DELETE SET NULL`), and the program must be given a new owner before it can be saved again.
- Categories use the core CategoryBundle with the `program` type (**Settings > Categories**), shown as "MT3S Marketing Program" (label `mt3s.marketing_program.category.type`).
- There is one currency for every amount: program budgets, allocation costs and totals. It's a general setting, the **Currency** dropdown in **Settings > Configuration > Marketing Program Settings** (parameter `mt3s_marketing_program_currency`, `EUR` by default), offering 40 main world currencies (`Service/CurrencyProvider.php`). Users never choose a currency, and amount fields show it next to the input. Changing it doesn't convert existing amounts: they're simply shown with the new currency.
- `version` is a whole number from 1 to 99, and new mt3s_mp_programs start at 1. It is edited by hand and isn't related to Doctrine's optimistic locking.
- Objectives belong to their program: they are saved with it, deleted with it (`ON DELETE CASCADE` in the database too), and an objective removed from the form is deleted (`orphanRemoval`). They are always loaded ordered by `position`. On save, the model renumbers positions to 0, 1, 2… in their current order. Description items follow the same rules.
- `getObjectives()` and `getDescriptionItems()` return the rows sorted by position, as a new collection. The mapping's `orderBy` isn't enough: after a reorder, the page shown right after saving uses the collection already loaded, in its old order.
- Text typed in the program form, including in objectives and description items, is kept as typed: line breaks, `&` and quotes are preserved, and HTML tags are removed. This depends on `ProgramType` passing a mask array to `CleanFormSubscriber`. Without one, core HTML-encodes every value, again on each save.
### Typed items: description items, allocation items and tasks
- A **description item** (Insights tab, `Entity/ProgramDescriptionItem.php`) has a type and a description. More fields are planned.
- An **allocation item** (Allocations tab, `Entity/ProgramAllocationItem.php`, table `mt3s_mp_program_allocation_items`) is a cost line: type (with its pictogram), name (optional), description, planned cost and real cost. Costs are `DECIMAL(12,2)`, in the general currency.
- An **objective** (`Entity/ProgramObjective.php`) has a type too (with its pictogram), a title, a priority (a whole number from 1, the most important, to 99), a description and the achieved flag. The program's Objectives tab lists them by priority; ties keep the manual order. The priority is required.
- A **task** (`Entity/Task.php`) has a type too (with its pictogram): see *The Task object* below.
- Description items, allocation items and objectives are edited inside the program form, like objectives: add, remove, drag to reorder. They're saved and deleted with the program. Tasks are edited on their own form, where the type's pictogram and description appear around the type dropdown.
- Each kind's types are set up on the **Item types** page (**Marketing Programs > Item types**), in several sections. Each type has a name and a description for each language installed in Mautic, and the default language (the `locale` parameter) requires a name. Each type also has a pictogram (none for the audience decision roles and tones). Users see their own language, or the default language when theirs is empty. The order of the types is the order of the dropdown.
- The types are stored in `config/local.php`, in the `mt3s_marketing_program_description_item_types`, `mt3s_marketing_program_allocation_item_types`, `mt3s_marketing_program_objective_types`, `mt3s_marketing_program_task_types` and `mt3s_marketing_program_stakeholder_types` parameters. Read them with `Service/ItemTypeProvider.php`, passing the kind (`description`, `allocation`, `objective`, `task` or `stakeholder`). In templates, use the Twig functions `mt3s_marketing_program_item_type_name(kind, key)`, `mt3s_marketing_program_item_type_description(kind, key)` and `mt3s_marketing_program_item_type_icon(kind, key)`, plus `mt3s_marketing_program_currency()` and `mt3s_marketing_program_money(amount)` (`Twig/MT3SMarketingProgramExtension.php`).
- **Every item type has a pictogram**, chosen by the administrator from a list of Remix Icons that Mautic ships (`Service/Pictograms.php`, each checked against Mautic 7's icon stylesheet), with a live preview. It's stored as `icon` in the type. On the program form and the task form it appears next to the type dropdown when a type is chosen.
- **The four item tabs of a program's detail page are harmonized** (`Resources/views/Program/details.html.twig`, `_task_table.html.twig`, `_tab_table_filter.html.twig`): every column starts with the pictogram (its header stays empty — no "Pictogram" label), then Type, Name, Description, and the kind's other fields; objectives show their Priority after Description, and tasks end with Status. The program's Tasks tab doesn't show task IDs (`data-task-id` still carries them). Each tab has one filter box that matches every column, and every column header sorts the rows asc/desc on click (`Mautic.mt3sMpProgramInitTabTable` in `Assets/js/mt3s-mp-program.js`, client-side). The objective's achieved flag is the Status column of its table.
- A description item's long description is **clamped to 10 lines** in the Insights tab, with a *Read more* / *Show less* toggle (`_description_read_more.html.twig`, `Mautic.mt3sMpProgramInitReadMore`). The toggle appears only when the text really overflows: the pane is hidden on page load, so the measurement waits for the tab to be shown.
- Each type has a hidden key, generated when it's created and never changed. Items store that key, so renaming a type renames it everywhere.
- A type that items use can't be removed: the lists aren't saved, and the error lists the types and how many items use them (`Service/ItemTypeInUseGuard.php`, called by `ItemTypesController` before saving the page).
- On the program form, the selected type's description is shown under the type dropdown. When no types are set up, the tab says where to set them up.
- Files: `Form/Type/ItemTypesType.php`, `ItemTypeConfigType.php`, `ProgramDescriptionItemType.php`, `ProgramAllocationItemType.php`, `Controller/ItemTypesController.php` and `Resources/views/ItemTypes/form.html.twig` (the page), and `Form/Type/ConfigType.php` with `Resources/views/FormTheme/Config/_config_mt3smarketingprogramconfig_widget.html.twig` (the general settings that stayed in **Settings > Configuration**). Adding and removing types is handled in `Assets/js/mt3s-mp-program.js`.
### Cost totals
- `Program::getAllocationTotals()` adds up the allocation items' planned and real costs, in the general currency. The sums are done in cents, as integers.
- The program detail page shows them under the title, after the program status, as on an email's page (`publishStatus` block): a "Planned" tag and a "Real" tag. A real total above the planned total is red, otherwise green.
- The Allocations tab of the detail page lists the cost lines, followed by a total row.
- `isAchieved` is toggled by hand on the form for now.
### The Stakeholder object
- `Entity/Stakeholder.php` and `StakeholderRepository.php`: a stakeholder (table `mt3s_mp_program_stakeholders`), the global directory of the people, companies and teams involved in the mt3s_mp_programs: name, email (validated, indexed for duplicate detection), phone, role, type and the active flag (`isPublished`). Independent of mt3s_mp_programs.
- `Entity/ProgramStakeholder.php`: the link between a program and a stakeholder (table `mt3s_mp_program_stakeholders_program`), with the stakeholder's role in that program (free text, column `role_in_program`) and a position. Deleting the program or the stakeholder deletes the link (ON DELETE CASCADE both sides).
- `Model/StakeholderModel.php`: the model, available as `mautic.mt3smarketingprogram.model.stakeholder` or with `getModel('mt3smarketingprogram.stakeholder')`. On save, the phone number is normalized to E.164 using the default region from **Settings > Configuration > Marketing Program Settings** (parameter `mt3s_marketing_program_stakeholder_phone_region`, `FR` by default); a number that doesn't parse is kept exactly as typed, and the save is never blocked.
- `Controller/StakeholderController.php` and `Resources/views/Stakeholder/`: the directory (**Marketing Programs > Stakeholders**), with the columns ID, Pictogram, Type, Name, Role, Email (mailto link), Phone (tel link), Active, and **Assigned mt3s_mp_programs** — the mt3s_mp_programs the stakeholder is linked to, each with its role in that program. The detail page lists those mt3s_mp_programs too.
- The stakeholder's type is the key of a stakeholder type set up in **Settings > Configuration > Marketing Program Settings** (parameter `mt3s_marketing_program_stakeholder_types`), same pattern as the other item types, pictogram included.
- A program's **Stakeholders tab** links the directory to the program: each row picks an active stakeholder and gives its role in the program. The tab shows the harmonized table (pictogram, Type, Name, Role in the program, Role, Email, Phone, Active). Unpublished stakeholders are not offered in the picker, but keep their links.
### The Task object
- `Entity/Task.php` and `TaskRepository.php`: a task (table `mt3s_mp_program_tasks`): type (with its pictogram), name, description, program, kind (task, milestone or phase), optional start and end dates (plain dates, no time), definition of done, planned work in whole hours, status (not for phases), dependencies (table `mt3s_mp_program_task_dependencies`) and RACI assignments (table `mt3s_mp_program_task_raci` with its `mt3s_mp_program_task_raci_stakeholders` join table)
- `Entity/TaskStatus.php`: the status enum. The order of its cases is the order of the dropdown: `new` (New, the default), `todo` (To do), `in_progress` (In progress), `done` (Done). Stored as `VARCHAR(20)`, indexed.
- `Model/TaskModel.php`: the model, available as `mautic.mt3smarketingprogram.model.task` or with `getModel('mt3smarketingprogram.task')`. `getTaskTree($program)` returns a program's tasks as flat rows for the Tasks tab, ordered by name, with their dependencies and RACI rows fully loaded.
- `Form/Type/TaskType.php`: the create and edit form
- `Validator/Constraints/ValidTaskDependency.php`: a dependency must point at another task of the same program, and the dependency graph must not form a cycle (followed through the database, so a cycle crossing other tasks is caught too)
Behaviour to know about:
- A task must belong to a program. A program can have any number of tasks, including none.
- A task's end date must be on or after its start date, when both are set.
- The task list (**Marketing Programs > Tasks**) shows these columns, in this order: ID, Pictogram, Type, Name, Description (first 120 characters), Start date, End date, Status. Every column except Pictogram and Description can be sorted.
- A task's type is required. It's the key of a task type set up in **Settings > Configuration > Marketing Program Settings** (parameter `mt3s_marketing_program_task_types`); on the task form the type's pictogram appears next to the dropdown and its description under it. The program's Tasks tab shows the same Pictogram and Type columns as the task list, without the ID column.
- Deleting a program deletes its tasks (`program_id` `ON DELETE CASCADE`).
- Deleting a task removes its dependency edges and RACI rows too (`ON DELETE CASCADE`).
- Tasks are edited on their own pages, not inside the program form: a task can only be picked as a dependency once it exists.
- Kinds: a **milestone**'s end date is enslaved to its start date (same day — the entity's `setTaskKind` copies it, the `TaskDates` validator keeps it in step, the form shows it disabled); a **phase** has no status of its own, it comes from its tasks (the form shows no status field).
- RACI: one row per role (Responsible, Accountable, Consulted, Informed), each with several stakeholders picked from the program's stakeholders.
After you change `Assets/js/mt3s-mp-program.js`, run `php bin/console mautic:assets:generate` (in the dev environment, `./dev.sh console mautic:assets:generate`), because production mode bundles plugin scripts into `app.js`.
### Database schema
Mautic creates the `mt3s_mp_programs` table from the entity mapping when it installs the plugin. However, the installer drops foreign keys that point to core tables (`users`, `categories`). `Migrations/Version_0_2_0.php` adds them and only runs when they are missing. Core runs plugin migrations when the plugin version changes, and `EventListener/PluginInstallSubscriber.php` also runs them right after a fresh install.
`Migrations/Version_0_16_0.php` renames every table and column of the Plan era to the Program one: `plans` → `mt3s_mp_programs`, `plan_tasks` → `mt3s_mp_program_tasks`, `plan_stakeholders` → `mt3s_mp_program_stakeholders`, `plan_audiences` → `mt3s_mp_program_audiences`, `plan_stakeholders_plan` → `mt3s_mp_program_stakeholders_program`, `plan_audiences_plan` → `mt3s_mp_program_audiences_program`, `plan_audiences_segments` → `mt3s_mp_program_audiences_segments`, `plan_audiences_stages` → `mt3s_mp_program_audiences_stages`, `plan_objectives` → `mt3s_mp_program_objectives`, `plan_description_items` → `mt3s_mp_program_description_items`, `plan_allocation_items` → `mt3s_mp_program_allocation_items`, `plan_task_dependencies` → `mt3s_mp_program_task_dependencies`, `plan_task_raci` → `mt3s_mp_program_task_raci`, `plan_task_raci_stakeholders` → `mt3s_mp_program_task_raci_stakeholders`, and the `plan_id` foreign key columns become `program_id`; `role_in_plan` becomes `role_in_program`. The earlier migrations (`Version_0_2_0.php` … `Version_0_14_0.php`) keep their historical table names in their bodies but are disabled (`isApplicable()` returns `false`), since their changes are history now kept by the renames in 0.16.0.
When you change the schema, add a migration in `Migrations/` and increase `version` in `Config/config.php`, then run `./dev.sh reload`. The migration engine executes the `addSql()` statements after `up()` returns; a rename migration must instead run its statements immediately through `$connection->executeStatement()`, re-reading the schema between steps.
## Naming conventions
To avoid collisions with other plugins, such as UTM Manager, every identifier in this bundle is prefixed with the bundle's name (the `MT3S` in `MT3SMarketingProgramBundle`):
- Service IDs: `mt3s.marketing_program.*` (and the models resolve from `getModel('mt3smarketingprogram.program')` etc.)
- Form block prefixes: `mt3s_marketing_program_*` (`mt3s_marketing_program_task`, `mt3s_marketing_program_audience`, …)
- Route names: `mt3s_marketing_program_*` (e.g. `mt3s_marketing_program_index`, `mt3s_marketing_program_task_action`, with `mt3s_marketing_program_utm_taxonomy_index` for the placeholder)
- Translation keys: `mt3s.marketing_program.*`, plus `mautic.plugin.mt3smarketingprogram.name`
- Permission keys: `mt3smarketingprogram:*` (from the bundle name, lowercased)
- Config parameters: `mt3s_marketing_program_*` (`mt3s_marketing_program_currency`, `mt3s_marketing_program_*_types`, …)
- Menu keys: `mt3s.marketing_program.menu.*`
- URL paths: `/s/marketing-programs`, `/s/marketing-program-tasks`, `/s/marketing-program-stakeholders`, `/s/marketing-program-audiences`, `/s/marketing-program-utm-taxonomies`
The bundle class is `MT3SMarketingProgramBundle`, the integration name is `MT3SMarketingProgram`, the entity classes are `Program`, `Task`, `Stakeholder` and `Audience`, and their tables are `mt3s_mp_programs`, `mt3s_mp_program_tasks`, `mt3s_mp_program_stakeholders` and `mt3s_mp_program_audiences`. The DB index names are kept from before 0.17.0: `program_status` on `mt3s_mp_programs`, `program_task_status` on `mt3s_mp_program_tasks`, `program_stakeholder_email` on `mt3s_mp_program_stakeholders`. The plugin also dispatches `mt3s.marketing_program.*` events (`Event/MT3SMarketingProgramEvents.php`, payload `Event/ProgramEvent.php`) and ships `Command/RefreshStatsCommand.php` (`php bin/console mt3s:marketing-program:refresh-stats`).
## Rename history
The plugin was born as `PlanBundle` with a `Plan` entity (table `plans`) and menu root **Planning** > **Plans**:
- Before 0.15.0: "targets" were renamed to "audiences" (entity `Audience`, table `plan_targets` → `plan_audiences`), with Mautic segments attached to each audience.
- 0.16.0: the full rename to `ProgramBundle` / `Program` (and a "plan" became an "initiative"). The bundle namespace, class names, the `plugins` DB row (`ProgramBundle`), all tables (`plan_*` → `initiative_*`), all columns (`plan_id` → `initiative_id`, `role_in_plan` → `role_in_initiative`), all permission keys (`plan:*` → `program:*`), the config parameters and the menu (root **Programs**, entry **Initiatives**, plus the placeholder **UTM Taxonomies**) took the new names. The data was kept: the migration renames the tables, it doesn't rebuild them.
- 0.17.0: the rename to `MT3SMarketingProgramBundle` / "MT3S Marketing Program", and an initiative became a marketing program. The bundle namespace, class names, the `plugins` DB row (`MT3SMarketingProgramBundle`, name "MT3S Marketing Program"), all tables (`initiative_*` → `mt3s_mp_program_*`), all columns (`initiative_id` → `program_id`, `role_in_initiative` → `role_in_program`), all permission keys (`program:*` → `mt3smarketingprogram:*`), the routes, the service IDs, the config parameters, the URLs (`/s/marketing-programs`, …) and the menu (root **Marketing Programs**, entry **Marketing Programs**) took the new names, and the plugin's events (`mt3s.marketing_program.*`) and the `mt3s:marketing-program:refresh-stats` command were added. The data was kept again: `Version_0_17_0.php` renames the tables and carries over the rows the rename orphans — the plugins row, the roles' permission rows (which the 0.16.0 rename had missed), the categories (`plan`- and `initiative`-era rows) and the audit log.
- 0.18.0: the merge of the standalone **Smartlinks** plugin (`SmartlinksBundle`, versions 0.1.0–0.6.0) into this bundle. The Smart Links and UTM Taxonomies code, tables (`smart_links`, `smart_link_hits`, `utm_taxonomies`), routes (`/s/smart-links`, `/s/utm-taxonomies`, the public `/l/{slug}`), translation keys (`mautic.smartlinks.*`) and settings keys (`smartlinks_*`, with the legacy `utm_manager_*` keys still readable) are unchanged; only the PHP namespace (`MauticPlugin\SmartlinksBundle\` → `MauticPlugin\MT3SMarketingProgramBundle\`), the service IDs, the template namespace (`@Smartlinks/` → `@MT3SMarketingProgram/`), the **Plugins page entry** (one row: "MT3S Marketing Program") and the **permission base** changed (`smartlinks:smart_links:*` → `mt3smarketingprogram:smart_links:*`, `smartlinks:taxonomies:*` → `mt3smarketingprogram:taxonomies:*` — roles must be re-granted). The incoming migrations were renamed `Version_0_X_0_SmartLinks.php` to avoid the class-name collision with this bundle's own migrations. The old placeholder page `/s/marketing-program-utm-taxonomies` is gone (the real feature is at `/s/utm-taxonomies`), and the dev environment mounts only this repository. The source repository is archived at its `post-merge-v1` tag.
- 0.18.1: the naming normalization after the merge. The Smart Links **route names** were unified with the bundle's vendor prefix (`mautic_smartlinks_*` → `mt3s_smart_links_*`; the paths are unchanged: `/s/smart-links`, `/s/utm-taxonomies`, the public `/l/{slug}`), the **model service aliases** were collapsed to one canonical alias per model (`mautic.mt3smarketingprogram.model.<entity>`, so `getModel('mt3smarketingprogram.smart_link')`; the old `mt3s.*` and `mautic.mt3smp.*`-era aliases are gone), the **translation keys** of the domain were renamed (`mautic.smartlinks.*` → `mt3s.smart_links.*`; `mautic.config.tab.smartlinksconfig` stays, it is core's key), the **settings parameters** were renamed (`smartlinks_utm_config` → `mt3s_smart_links_utm_config`, `smartlinks_config` → `mt3s_smart_links_config`, with both legacy keys — the standalone SmartlinksBundle's `smartlinks_*` and the UtmManagerBundle's `utm_manager_*` — still readable until the settings are saved again), the **JS loader prefixes** were unified (`smartlinksSmartLink`/`smartlinksUtmTaxonomy` → `mt3sMpSmartLink`/`mt3sMpUtmTaxonomy`), `Integration/Support/ConfigSupport` was renamed `SmartlinksConfigSupport`, the integration display names were aligned ("MT3S Marketing Program" / "Smart Links") and the phpunit suite was renamed (`UtmManagerBundle` → `MT3SMarketingProgramBundle`). No tables, columns, URLs or stored data changed.
- The old URLs (`/s/plans`, `/s/plan-tasks`, `/s/programs`, `/s/program-tasks`, …) are gone: the routes were renamed and the old names return 404.
A rename like this needs care:
- The historical migrations must stay literal (they describe the old schema) or be neutralized; after the entity renames, their Doctrine mappings no longer match and they can only run with literal SQL.
- The `plugins` DB row must be updated to the new bundle name (and its version kept), or Mautic's installer treats the plugin as new and its `SchemaTool` pass creates empty tables from the current mappings. If that happens, drop the empty tables and turn the install into an update before reloading.
- The permission keys of each role are stored in the `permissions` table per (bundle, name); a role that had `plan:plans:*` grants doesn't automatically get `mt3smarketingprogram:programs:*`, and cached permission sets in the sessions need a re-login.
- `getModel('mt3smarketingprogram.<entity>')` resolves to the service `mautic.mt3smarketingprogram.model.<entity>`, like core bundles' `mautic.<x>.model.<x>`: only the service IDs decide.
- The `config/local.php` parameter keys are not renamed by the migration either (they are not in the database): `plan_currency` → `mt3s_marketing_program_currency`, the `plan_*_types` lists → `mt3s_marketing_program_*_types`, and the pre-0.15 audience keys `plan_target_attribute_*`, `plan_target_decision_roles` and `plan_target_tones` → `mt3s_marketing_program_audience_attribute_*`, `mt3s_marketing_program_audience_decision_roles` and `mt3s_marketing_program_audience_tones`. Rename them by hand after upgrading, or the type lists on the settings page and every type dropdown read empty (the stored items keep their type keys, they only show "Unknown type").
© MT3 Solutions. It is provided as open source, in the hope it is useful, without any warranty.