From c27268443cb409023856e6452feccd2ce734bd89 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 5 Jul 2021 17:40:21 +0200 Subject: [PATCH 01/58] start creation AsideActivity bundle --- .../ChillAsideActivityBundle/CHANGELOG.md | 0 .../ChillAsideActivityBundle.php | 9 + .../Entity/AsideActivity.php | 42 ++ .../Entity/AsideActivityType.php | 100 +++ src/Bundle/ChillAsideActivityBundle/LICENSE | 661 ++++++++++++++++++ src/Bundle/ChillAsideActivityBundle/README.md | 3 + .../Repository/AsideActivityRepository.php | 50 ++ .../AsideActivityTypeRepository.php | 50 ++ .../chill.webpack.config.js | 3 + .../ChillAsideActivityBundle/composer.json | 94 +++ 10 files changed, 1012 insertions(+) create mode 100644 src/Bundle/ChillAsideActivityBundle/CHANGELOG.md create mode 100644 src/Bundle/ChillAsideActivityBundle/ChillAsideActivityBundle.php create mode 100644 src/Bundle/ChillAsideActivityBundle/Entity/AsideActivity.php create mode 100644 src/Bundle/ChillAsideActivityBundle/Entity/AsideActivityType.php create mode 100644 src/Bundle/ChillAsideActivityBundle/LICENSE create mode 100644 src/Bundle/ChillAsideActivityBundle/README.md create mode 100644 src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityRepository.php create mode 100644 src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityTypeRepository.php create mode 100644 src/Bundle/ChillAsideActivityBundle/chill.webpack.config.js create mode 100644 src/Bundle/ChillAsideActivityBundle/composer.json diff --git a/src/Bundle/ChillAsideActivityBundle/CHANGELOG.md b/src/Bundle/ChillAsideActivityBundle/CHANGELOG.md new file mode 100644 index 000000000..e69de29bb diff --git a/src/Bundle/ChillAsideActivityBundle/ChillAsideActivityBundle.php b/src/Bundle/ChillAsideActivityBundle/ChillAsideActivityBundle.php new file mode 100644 index 000000000..d5dc2cf9a --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/ChillAsideActivityBundle.php @@ -0,0 +1,9 @@ +id; + } + + public function getType(): ?AsideActivityType + { + return $this->type; + } + + public function setType(?AsideActivityType $type): self + { + $this->type = $type; + + return $this; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/Entity/AsideActivityType.php b/src/Bundle/ChillAsideActivityBundle/Entity/AsideActivityType.php new file mode 100644 index 000000000..05a063892 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/Entity/AsideActivityType.php @@ -0,0 +1,100 @@ +asideActivities = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getTitle(): ?string + { + return $this->title; + } + + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + public function getIsActive(): ?bool + { + return $this->isActive; + } + + public function setIsActive(bool $isActive): self + { + $this->isActive = $isActive; + + return $this; + } + + /** + * @return Collection|AsideActivity[] + */ + public function getAsideActivities(): Collection + { + return $this->asideActivities; + } + + public function addAsideActivity(AsideActivity $asideActivity): self + { + if (!$this->asideActivities->contains($asideActivity)) { + $this->asideActivities[] = $asideActivity; + $asideActivity->setType($this); + } + + return $this; + } + + public function removeAsideActivity(AsideActivity $asideActivity): self + { + if ($this->asideActivities->removeElement($asideActivity)) { + // set the owning side to null (unless already changed) + if ($asideActivity->getType() === $this) { + $asideActivity->setType(null); + } + } + + return $this; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/LICENSE b/src/Bundle/ChillAsideActivityBundle/LICENSE new file mode 100644 index 000000000..ddfcbd34e --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/LICENSE @@ -0,0 +1,661 @@ +GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are 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. + +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. + +Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + +A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + +The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + +An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + +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 Affero 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. Remote Network Interaction; Use with the GNU General Public License. + +Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + +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 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 work with which it is combined will remain governed by version +3 of the GNU General Public License. + +14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions of +the GNU Affero 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 Affero 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 Affero 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 Affero 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. + + +Copyright (C) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero 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 Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + +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 AGPL, see +. diff --git a/src/Bundle/ChillAsideActivityBundle/README.md b/src/Bundle/ChillAsideActivityBundle/README.md new file mode 100644 index 000000000..8a151c17e --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/README.md @@ -0,0 +1,3 @@ +# Aside activities module + +This module offers the possibility to add extra curricular activities per user (eg. administrative tasks, formation, meetings) not immediately related to client support. diff --git a/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityRepository.php b/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityRepository.php new file mode 100644 index 000000000..a11705db5 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('a') + ->andWhere('a.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('a.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?AsideActivity + { + return $this->createQueryBuilder('a') + ->andWhere('a.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityTypeRepository.php b/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityTypeRepository.php new file mode 100644 index 000000000..1942e8e32 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityTypeRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('a') + ->andWhere('a.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('a.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?AsideActivityType + { + return $this->createQueryBuilder('a') + ->andWhere('a.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/chill.webpack.config.js b/src/Bundle/ChillAsideActivityBundle/chill.webpack.config.js new file mode 100644 index 000000000..98569ccae --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/chill.webpack.config.js @@ -0,0 +1,3 @@ +module.exports = function(encore, entries) { + entries.push(__dirname + '/Resources/public/index.js'); +}; diff --git a/src/Bundle/ChillAsideActivityBundle/composer.json b/src/Bundle/ChillAsideActivityBundle/composer.json new file mode 100644 index 000000000..8d4b22fd6 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/composer.json @@ -0,0 +1,94 @@ +{ + "name": "chill-project/chill-bundles", + "license": "AGPL-3.0-only", + "type": "library", + "description": "Most used bundles for chill-project", + "keywords": [ + "chill", + "social worker" + ], + "autoload": { + "psr-4": { + "Chill\\ActivityBundle\\": "src/Bundle/ChillActivityBundle", + "Chill\\BudgetBundle\\": "src/Bundle/ChillBudgetBundle", + "Chill\\CustomFieldsBundle\\": "src/Bundle/ChillCustomFieldsBundle", + "Chill\\DocStoreBundle\\": "src/Bundle/ChillDocStoreBundle", + "Chill\\EventBundle\\": "src/Bundle/ChillEventBundle", + "Chill\\FamilyMemberBundle\\": "src/Bundle/ChillFamilyMemberBundle", + "Chill\\MainBundle\\": "src/Bundle/ChillMainBundle", + "Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle", + "Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle", + "Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle", + "Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle", + "Chill\\AsideActivityBundle\\": "src/Bundle/ChillAsideActivityBundle" + } + }, + "autoload-dev": { + "psr-4": { + "App\\": "tests/app/src/" + } + }, + "require": { + "champs-libres/async-uploader-bundle": "dev-sf4", + "graylog2/gelf-php": "^1.5", + "symfony/form": "4.*", + "symfony/twig-bundle": "^4.4", + "twig/extra-bundle": "^2.12|^3.0", + "twig/twig": "^2.12|^3.0", + "composer/package-versions-deprecated": "^1.10", + "doctrine/doctrine-bundle": "^2.1", + "doctrine/doctrine-migrations-bundle": "^3.0", + "doctrine/orm": "^2.7", + "symfony/asset": "4.*", + "symfony/monolog-bundle": "^3.5", + "symfony/security-bundle": "4.*", + "symfony/translation": "4.*", + "symfony/validator": "4.*", + "sensio/framework-extra-bundle": "^5.5", + "symfony/yaml": "4.*", + "symfony/webpack-encore-bundle": "^1.11", + "knplabs/knp-menu": "^3.1", + "knplabs/knp-menu-bundle": "^3.0", + "symfony/templating": "4.*", + "twig/intl-extra": "^3.0", + "symfony/workflow": "4.*", + "symfony/expression-language": "4.*", + "knplabs/knp-time-bundle": "^1.12", + "symfony/intl": "4.*", + "symfony/swiftmailer-bundle": "^3.5", + "league/csv": "^9.6", + "phpoffice/phpspreadsheet": "^1.16", + "symfony/browser-kit": "^5.2", + "symfony/css-selector": "^5.2", + "twig/markdown-extra": "^3.3", + "erusev/parsedown": "^1.7", + "symfony/serializer": "^5.2", + "symfony/webpack-encore-bundle": "^1.11" + }, + "conflict": { + "symfony/symfony": "*" + }, + "require-dev": { + "fakerphp/faker": "^1.13", + "phpunit/phpunit": "^7.0", + "symfony/dotenv": "^5.1", + "symfony/maker-bundle": "^1.20", + "doctrine/doctrine-fixtures-bundle": "^3.3", + "symfony/stopwatch": "^5.1", + "symfony/web-profiler-bundle": "^5.0", + "symfony/var-dumper": "4.*", + "symfony/debug-bundle": "^5.1", + "symfony/phpunit-bridge": "^5.2", + "nelmio/alice": "^3.8" + }, + "scripts": { + "auto-scripts": { + "cache:clear": "symfony-cmd", + "assets:install %PUBLIC_DIR%": "symfony-cmd" + } + }, + "config": { + "vendor-dir": "tests/app/vendor", + "bin-dir": "bin" + } +} \ No newline at end of file From 10de2d796659bc2715f67505ff480bfc70518464 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 6 Jul 2021 14:08:44 +0200 Subject: [PATCH 02/58] start of AsideActivity entities --- .../ChillAsideActivityBundle.php | 9 -- .../Entity/AsideActivity.php | 42 -------- .../Entity/AsideActivityType.php | 100 ------------------ .../Repository/AsideActivityRepository.php | 50 --------- .../AsideActivityTypeRepository.php | 50 --------- 5 files changed, 251 deletions(-) delete mode 100644 src/Bundle/ChillAsideActivityBundle/ChillAsideActivityBundle.php delete mode 100644 src/Bundle/ChillAsideActivityBundle/Entity/AsideActivity.php delete mode 100644 src/Bundle/ChillAsideActivityBundle/Entity/AsideActivityType.php delete mode 100644 src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityRepository.php delete mode 100644 src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityTypeRepository.php diff --git a/src/Bundle/ChillAsideActivityBundle/ChillAsideActivityBundle.php b/src/Bundle/ChillAsideActivityBundle/ChillAsideActivityBundle.php deleted file mode 100644 index d5dc2cf9a..000000000 --- a/src/Bundle/ChillAsideActivityBundle/ChillAsideActivityBundle.php +++ /dev/null @@ -1,9 +0,0 @@ -id; - } - - public function getType(): ?AsideActivityType - { - return $this->type; - } - - public function setType(?AsideActivityType $type): self - { - $this->type = $type; - - return $this; - } -} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/Entity/AsideActivityType.php b/src/Bundle/ChillAsideActivityBundle/Entity/AsideActivityType.php deleted file mode 100644 index 05a063892..000000000 --- a/src/Bundle/ChillAsideActivityBundle/Entity/AsideActivityType.php +++ /dev/null @@ -1,100 +0,0 @@ -asideActivities = new ArrayCollection(); - } - - public function getId(): ?int - { - return $this->id; - } - - public function getTitle(): ?string - { - return $this->title; - } - - public function setTitle(string $title): self - { - $this->title = $title; - - return $this; - } - - public function getIsActive(): ?bool - { - return $this->isActive; - } - - public function setIsActive(bool $isActive): self - { - $this->isActive = $isActive; - - return $this; - } - - /** - * @return Collection|AsideActivity[] - */ - public function getAsideActivities(): Collection - { - return $this->asideActivities; - } - - public function addAsideActivity(AsideActivity $asideActivity): self - { - if (!$this->asideActivities->contains($asideActivity)) { - $this->asideActivities[] = $asideActivity; - $asideActivity->setType($this); - } - - return $this; - } - - public function removeAsideActivity(AsideActivity $asideActivity): self - { - if ($this->asideActivities->removeElement($asideActivity)) { - // set the owning side to null (unless already changed) - if ($asideActivity->getType() === $this) { - $asideActivity->setType(null); - } - } - - return $this; - } -} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityRepository.php b/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityRepository.php deleted file mode 100644 index a11705db5..000000000 --- a/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityRepository.php +++ /dev/null @@ -1,50 +0,0 @@ -createQueryBuilder('a') - ->andWhere('a.exampleField = :val') - ->setParameter('val', $value) - ->orderBy('a.id', 'ASC') - ->setMaxResults(10) - ->getQuery() - ->getResult() - ; - } - */ - - /* - public function findOneBySomeField($value): ?AsideActivity - { - return $this->createQueryBuilder('a') - ->andWhere('a.exampleField = :val') - ->setParameter('val', $value) - ->getQuery() - ->getOneOrNullResult() - ; - } - */ -} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityTypeRepository.php b/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityTypeRepository.php deleted file mode 100644 index 1942e8e32..000000000 --- a/src/Bundle/ChillAsideActivityBundle/Repository/AsideActivityTypeRepository.php +++ /dev/null @@ -1,50 +0,0 @@ -createQueryBuilder('a') - ->andWhere('a.exampleField = :val') - ->setParameter('val', $value) - ->orderBy('a.id', 'ASC') - ->setMaxResults(10) - ->getQuery() - ->getResult() - ; - } - */ - - /* - public function findOneBySomeField($value): ?AsideActivityType - { - return $this->createQueryBuilder('a') - ->andWhere('a.exampleField = :val') - ->setParameter('val', $value) - ->getQuery() - ->getOneOrNullResult() - ; - } - */ -} \ No newline at end of file From eff1d6e797c90acfbcd95767952c523b1c5cdc58 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 6 Jul 2021 14:10:36 +0200 Subject: [PATCH 03/58] start of AsideActivity entities --- .../src/ChillAsideActivityBundle.php | 11 + .../ChillAsideActivityExtension.php | 33 +++ .../src/Entity/AsideActivity.php | 199 ++++++++++++++++++ .../src/Entity/AsideActivityType.php | 100 +++++++++ .../src/Form/AsideActivityType.php | 35 +++ .../Repository/AsideActivityRepository.php | 52 +++++ .../AsideActivityTypeRepository.php | 52 +++++ .../src/Resources/config/services.php | 14 ++ 8 files changed, 496 insertions(+) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php create mode 100644 src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityType.php create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityRepository.php create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityTypeRepository.php create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/config/services.php diff --git a/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php b/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php new file mode 100644 index 000000000..c9640d370 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php @@ -0,0 +1,11 @@ +load('services.php'); + } +} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php new file mode 100644 index 000000000..3b6cd18d1 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -0,0 +1,199 @@ +id; + } + + public function getType(): ?AsideActivityType + { + return $this->type; + } + + public function setType(?AsideActivityType $type): self + { + $this->type = $type; + + return $this; + } + + public function getCreatedBy(): ?User + { + return $this->createdBy; + } + + public function setCreatedBy(?User $createdBy): self + { + $this->createdBy = $createdBy; + + return $this; + } + + public function getCreatedAt(): ?\DateTimeInterface + { + return $this->createdAt; + } + + public function setCreatedAt(\DateTimeInterface $createdAt): self + { + $this->createdAt = $createdAt; + + return $this; + } + + public function getUpdatedBy(): ?User + { + return $this->updatedBy; + } + + public function setUpdatedBy(?User $updatedBy): self + { + $this->updatedBy = $updatedBy; + + return $this; + } + + public function getUpdatedAt(): ?\DateTimeImmutable + { + return $this->updatedAt; + } + + public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self + { + $this->updatedAt = $updatedAt; + + return $this; + } + + public function getAgent(): ?User + { + return $this->agent; + } + + public function setAgent(?User $agent): self + { + $this->agent = $agent; + + return $this; + } + + public function getDate(): ?\DateTimeInterface + { + return $this->date; + } + + public function setDate(\DateTimeInterface $date): self + { + $this->date = $date; + + return $this; + } + + public function getDuration(): ?\DateTimeInterface + { + return $this->duration; + } + + public function setDuration(?\DateTimeInterface $duration): self + { + $this->duration = $duration; + + return $this; + } + + public function getLocation(): ?string + { + return $this->location; + } + + public function setLocation(?string $location): self + { + $this->location = $location; + + return $this; + } + + public function getNote(): ?string + { + return $this->note; + } + + public function setNote(?string $note): self + { + $this->note = $note; + + return $this; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityType.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityType.php new file mode 100644 index 000000000..ce94b4c93 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityType.php @@ -0,0 +1,100 @@ +asideActivities = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getTitle(): ?string + { + return $this->title; + } + + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + public function getIsActive(): ?bool + { + return $this->isActive; + } + + public function setIsActive(bool $isActive): self + { + $this->isActive = $isActive; + + return $this; + } + + /** + * @return Collection|AsideActivity[] + */ + public function getAsideActivities(): Collection + { + return $this->asideActivities; + } + + public function addAsideActivity(AsideActivity $asideActivity): self + { + if (!$this->asideActivities->contains($asideActivity)) { + $this->asideActivities[] = $asideActivity; + $asideActivity->setType($this); + } + + return $this; + } + + public function removeAsideActivity(AsideActivity $asideActivity): self + { + if ($this->asideActivities->removeElement($asideActivity)) { + // set the owning side to null (unless already changed) + if ($asideActivity->getType() === $this) { + $asideActivity->setType(null); + } + } + + return $this; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php new file mode 100644 index 000000000..6497c25c0 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php @@ -0,0 +1,35 @@ +add('date', DateType::class, [ + 'label' => 'Nom' + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class) + ; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityRepository.php b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityRepository.php new file mode 100644 index 000000000..054259b63 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityRepository.php @@ -0,0 +1,52 @@ +repository = $entityManager->getRepository(AsideActivity::class); + } + + public function find($id): ?AsideActivity + { + return $this->repository->find($id); + } + + /** + * @return AsideActivity[] + */ + public function findAll(): array + { + return $this->repository->findAll(); + } + + /** + * @return AsideActivity[] + */ + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array + { + return $this->repository->findBy($criteria, $orderBy, $limit, $offset); + } + + public function findOneBy(array $criteria): ?AsideActivity + { + return $this->repository->findOneBy($criteria); + } + + public function getClassName(): string + { + return AsideActivity::class; + } + +} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityTypeRepository.php b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityTypeRepository.php new file mode 100644 index 000000000..8cb2daad9 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityTypeRepository.php @@ -0,0 +1,52 @@ +repository = $entityManager->getRepository(AsideActivityType::class); + } + + + public function find($id): ?AsideActivityType + { + return $this->repository->find($id); + } + + /** + * @return AsideActivityType[] + */ + public function findAll(): array + { + return $this->repository->findAll(); + } + + /** + * @return AsideActivityType[] + */ + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array + { + return $this->repository->findBy($criteria, $orderBy, $limit, $offset); + } + + public function findOneBy(array $criteria): ?AsideActivityType + { + return $this->repository->findOneBy($criteria); + } + + public function getClassName(): string + { + return AsideActivityType::class; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/config/services.php b/src/Bundle/ChillAsideActivityBundle/src/Resources/config/services.php new file mode 100644 index 000000000..827fa1765 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/config/services.php @@ -0,0 +1,14 @@ + Date: Tue, 6 Jul 2021 14:11:06 +0200 Subject: [PATCH 04/58] changes to composer.json --- composer.json | 15 +-- .../chill.webpack.config.js | 3 - .../ChillAsideActivityBundle/composer.json | 94 ------------------- 3 files changed, 9 insertions(+), 103 deletions(-) delete mode 100644 src/Bundle/ChillAsideActivityBundle/chill.webpack.config.js delete mode 100644 src/Bundle/ChillAsideActivityBundle/composer.json diff --git a/composer.json b/composer.json index fb0d2dcd1..dd761a99d 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,10 @@ "license": "AGPL-3.0-only", "type": "library", "description": "Most used bundles for chill-project", - "keywords": ["chill", "social worker"], + "keywords": [ + "chill", + "social worker" + ], "autoload": { "psr-4": { "Chill\\ActivityBundle\\": "src/Bundle/ChillActivityBundle", @@ -16,12 +19,13 @@ "Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle", "Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle", "Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle", - "Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle" + "Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle", + "Chill\\AsideActivityBundle\\": "src/Bundle/ChillAsideActivityBundle/src" } }, "autoload-dev": { "psr-4": { - "App\\": "tests/app/src/" + "App\\": "tests/app/src/" } }, "require": { @@ -84,7 +88,6 @@ } }, "config": { - "vendor-dir": "tests/app/vendor", - "bin-dir": "bin" + "bin-dir": "bin" } -} +} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/chill.webpack.config.js b/src/Bundle/ChillAsideActivityBundle/chill.webpack.config.js deleted file mode 100644 index 98569ccae..000000000 --- a/src/Bundle/ChillAsideActivityBundle/chill.webpack.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function(encore, entries) { - entries.push(__dirname + '/Resources/public/index.js'); -}; diff --git a/src/Bundle/ChillAsideActivityBundle/composer.json b/src/Bundle/ChillAsideActivityBundle/composer.json deleted file mode 100644 index 8d4b22fd6..000000000 --- a/src/Bundle/ChillAsideActivityBundle/composer.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "chill-project/chill-bundles", - "license": "AGPL-3.0-only", - "type": "library", - "description": "Most used bundles for chill-project", - "keywords": [ - "chill", - "social worker" - ], - "autoload": { - "psr-4": { - "Chill\\ActivityBundle\\": "src/Bundle/ChillActivityBundle", - "Chill\\BudgetBundle\\": "src/Bundle/ChillBudgetBundle", - "Chill\\CustomFieldsBundle\\": "src/Bundle/ChillCustomFieldsBundle", - "Chill\\DocStoreBundle\\": "src/Bundle/ChillDocStoreBundle", - "Chill\\EventBundle\\": "src/Bundle/ChillEventBundle", - "Chill\\FamilyMemberBundle\\": "src/Bundle/ChillFamilyMemberBundle", - "Chill\\MainBundle\\": "src/Bundle/ChillMainBundle", - "Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle", - "Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle", - "Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle", - "Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle", - "Chill\\AsideActivityBundle\\": "src/Bundle/ChillAsideActivityBundle" - } - }, - "autoload-dev": { - "psr-4": { - "App\\": "tests/app/src/" - } - }, - "require": { - "champs-libres/async-uploader-bundle": "dev-sf4", - "graylog2/gelf-php": "^1.5", - "symfony/form": "4.*", - "symfony/twig-bundle": "^4.4", - "twig/extra-bundle": "^2.12|^3.0", - "twig/twig": "^2.12|^3.0", - "composer/package-versions-deprecated": "^1.10", - "doctrine/doctrine-bundle": "^2.1", - "doctrine/doctrine-migrations-bundle": "^3.0", - "doctrine/orm": "^2.7", - "symfony/asset": "4.*", - "symfony/monolog-bundle": "^3.5", - "symfony/security-bundle": "4.*", - "symfony/translation": "4.*", - "symfony/validator": "4.*", - "sensio/framework-extra-bundle": "^5.5", - "symfony/yaml": "4.*", - "symfony/webpack-encore-bundle": "^1.11", - "knplabs/knp-menu": "^3.1", - "knplabs/knp-menu-bundle": "^3.0", - "symfony/templating": "4.*", - "twig/intl-extra": "^3.0", - "symfony/workflow": "4.*", - "symfony/expression-language": "4.*", - "knplabs/knp-time-bundle": "^1.12", - "symfony/intl": "4.*", - "symfony/swiftmailer-bundle": "^3.5", - "league/csv": "^9.6", - "phpoffice/phpspreadsheet": "^1.16", - "symfony/browser-kit": "^5.2", - "symfony/css-selector": "^5.2", - "twig/markdown-extra": "^3.3", - "erusev/parsedown": "^1.7", - "symfony/serializer": "^5.2", - "symfony/webpack-encore-bundle": "^1.11" - }, - "conflict": { - "symfony/symfony": "*" - }, - "require-dev": { - "fakerphp/faker": "^1.13", - "phpunit/phpunit": "^7.0", - "symfony/dotenv": "^5.1", - "symfony/maker-bundle": "^1.20", - "doctrine/doctrine-fixtures-bundle": "^3.3", - "symfony/stopwatch": "^5.1", - "symfony/web-profiler-bundle": "^5.0", - "symfony/var-dumper": "4.*", - "symfony/debug-bundle": "^5.1", - "symfony/phpunit-bridge": "^5.2", - "nelmio/alice": "^3.8" - }, - "scripts": { - "auto-scripts": { - "cache:clear": "symfony-cmd", - "assets:install %PUBLIC_DIR%": "symfony-cmd" - } - }, - "config": { - "vendor-dir": "tests/app/vendor", - "bin-dir": "bin" - } -} \ No newline at end of file From 8389afb4a834ee46c3babbb3394f108e4502b8b1 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 6 Jul 2021 15:56:21 +0200 Subject: [PATCH 05/58] first migration: creation entities AsideActivity(Type) --- .../src/migrations/Version20210706124644.php | 220 ++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php new file mode 100644 index 000000000..77e2b76ce --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php @@ -0,0 +1,220 @@ +addSql('CREATE SEQUENCE AsideActivity_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE AsideActivityType_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE AsideActivity (id INT NOT NULL, type_id INT NOT NULL, agent_id INT NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, duration TIME(0) WITHOUT TIME ZONE DEFAULT NULL, location VARCHAR(100) DEFAULT NULL, note TEXT DEFAULT NULL, createdBy_id INT NOT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_E9FA2191C54C8C93 ON AsideActivity (type_id)'); + $this->addSql('CREATE INDEX IDX_E9FA21913174800F ON AsideActivity (createdBy_id)'); + $this->addSql('CREATE INDEX IDX_E9FA219165FF1AEC ON AsideActivity (updatedBy_id)'); + $this->addSql('CREATE INDEX IDX_E9FA21913414710B ON AsideActivity (agent_id)'); + $this->addSql('COMMENT ON COLUMN AsideActivity.updatedAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE AsideActivityType (id INT NOT NULL, title VARCHAR(255) NOT NULL, isActive BOOLEAN NOT NULL, PRIMARY KEY(id))'); + $this->addSql('ALTER TABLE AsideActivity ADD CONSTRAINT FK_E9FA2191C54C8C93 FOREIGN KEY (type_id) REFERENCES AsideActivityType (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE AsideActivity ADD CONSTRAINT FK_E9FA21913174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE AsideActivity ADD CONSTRAINT FK_E9FA219165FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE AsideActivity ADD CONSTRAINT FK_E9FA21913414710B FOREIGN KEY (agent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + // this up() migration is auto-generated, please modify it to your needs + + // $this->addSql('DROP TABLE chill_main_address_legacy'); + // $this->addSql('ALTER INDEX idx_55026b0ca76ed395 RENAME TO IDX_AC74095AA76ED395'); + // $this->addSql('ALTER INDEX idx_55026b0cc54c8c93 RENAME TO IDX_AC74095AC54C8C93'); + // $this->addSql('ALTER INDEX idx_55026b0c682b5931 RENAME TO IDX_AC74095A682B5931'); + // $this->addSql('ALTER INDEX idx_55026b0c217bbb47 RENAME TO IDX_AC74095A217BBB47'); + // $this->addSql('ALTER INDEX idx_ac74095a550b0c53 RENAME TO IDX_AC74095AD7FA8EF0'); + // $this->addSql('ALTER TABLE activityreason ALTER name SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN activityreason.name IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER INDEX idx_654a2fcd12469de2 RENAME TO IDX_AF82522312469DE2'); + // $this->addSql('ALTER TABLE activityreasoncategory ALTER name SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN activityreasoncategory.name IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER TABLE activitytype ALTER category_id DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_main_address DROP customs'); + // $this->addSql('ALTER TABLE chill_main_address ALTER isnoaddress DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_main_address ALTER point TYPE geometry(POINT,4326)'); + // $this->addSql('ALTER TABLE chill_main_address ALTER point DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point TYPE geometry(POINT,4326)'); + // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point DROP DEFAULT'); + // $this->addSql('CREATE INDEX search_name_code ON chill_main_postal_code (code, label)'); + // $this->addSql('ALTER INDEX idx_64a4a621504cb38d RENAME TO IDX_E260A868504CB38D'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive ALTER ordering DROP DEFAULT'); + // $this->addSql('ALTER INDEX idx_92351ece727aca70 RENAME TO IDX_72D110E8727ACA70'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ALTER startdate DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startdate TYPE DATE'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startdate DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER enddate TYPE DATE'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER enddate DROP DEFAULT'); + // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.startDate IS \'(DC2Type:date_immutable)\''); + // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.endDate IS \'(DC2Type:date_immutable)\''); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD CONSTRAINT FK_B694FB365FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + // $this->addSql('CREATE INDEX IDX_B694FB365FF1AEC ON chill_person_accompanying_period_work (updatedBy_id)'); + // $this->addSql('ALTER TABLE chill_person_household DROP CONSTRAINT fk_household_comment_embeddable_user'); + // $this->addSql('DROP INDEX IDX_BE50A270116F5FA9'); + // $this->addSql('DROP INDEX household_members_not_overlaps'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER startdate TYPE DATE'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER startdate DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER enddate TYPE DATE'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER enddate DROP DEFAULT'); + // $this->addSql('COMMENT ON COLUMN chill_person_household_members.startDate IS \'(DC2Type:date_immutable)\''); + // $this->addSql('COMMENT ON COLUMN chill_person_household_members.endDate IS \'(DC2Type:date_immutable)\''); + // $this->addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(7)'); + // $this->addSql('COMMENT ON COLUMN chill_person_marital_status.name IS \'(DC2Type:json_array)\''); + // $this->addSql('DROP INDEX mobilenumber_trgm_idx'); + // $this->addSql('DROP INDEX fullnamecanonical_trgm_idx'); + // $this->addSql('DROP INDEX phonenumber_trgm_idx'); + // $this->addSql('ALTER TABLE chill_person_person DROP cfdata_old'); + // $this->addSql('ALTER TABLE chill_person_person ALTER maritalstatus_id TYPE VARCHAR(7)'); + // $this->addSql('ALTER TABLE chill_person_person ALTER cfdata SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN chill_person_person.cFData IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER INDEX idx_3370d4403818da5 RENAME TO IDX_BF210A143818DA5'); + // $this->addSql('ALTER INDEX idx_3370d4401c9da55 RENAME TO IDX_BF210A141C9DA55'); + // $this->addSql('ALTER INDEX idx_bf210a145521be40 RENAME TO IDX_BF210A14D7D03CE3'); + // $this->addSql('ALTER INDEX idx_person_center RENAME TO IDX_BF210A145932F377'); + // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT FK_7201106F217BBB47'); + // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT FK_7201106F82F1BAF4'); + // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT FK_7201106F217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT FK_7201106F82F1BAF4 FOREIGN KEY (language_id) REFERENCES language (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + // $this->addSql('ALTER TABLE chill_person_social_action ALTER defaultnotificationdelay SET NOT NULL'); + // $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER delay SET NOT NULL'); + // $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER notificationdelay SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN country.name IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER TABLE custom_field_long_choice_options ALTER internal_key DROP DEFAULT'); + // $this->addSql('COMMENT ON COLUMN custom_field_long_choice_options.text IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER TABLE customfield ALTER required DROP DEFAULT'); + // $this->addSql('ALTER TABLE customfield ALTER required SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN customfield.name IS \'(DC2Type:json_array)\''); + // $this->addSql('COMMENT ON COLUMN customfield.options IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER INDEX idx_40fb5d6dfec418b RENAME TO IDX_7A6FDBEFEC418B'); + // $this->addSql('ALTER INDEX idx_286dc95df53b66 RENAME TO IDX_7A48DF7F5DF53B66'); + // $this->addSql('ALTER TABLE customfieldsgroup ALTER options DROP DEFAULT'); + // $this->addSql('ALTER TABLE customfieldsgroup ALTER options SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN customfieldsgroup.name IS \'(DC2Type:json_array)\''); + // $this->addSql('COMMENT ON COLUMN customfieldsgroup.options IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER INDEX idx_a14d8f3d447bbb3b RENAME TO IDX_A14D8F3D96DF1F10'); + // $this->addSql('COMMENT ON COLUMN language.name IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER TABLE permission_groups ALTER flags DROP DEFAULT'); + // $this->addSql('COMMENT ON COLUMN scopes.name IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER INDEX chill_3party.idx_c65d4397c7d3a8e6 RENAME TO IDX_14DC4475C7D3A8E6'); + // $this->addSql('ALTER INDEX chill_3party.idx_c65d43975932f377 RENAME TO IDX_14DC44755932F377'); + // $this->addSql('ALTER TABLE users ALTER usernamecanonical SET NOT NULL'); + // $this->addSql('DROP INDEX uniq_93f763ae217bbb47'); + // $this->addSql('ALTER TABLE chill_vendee.vendeeperson_entourage ADD CONSTRAINT FK_4D319FFEF57537C3 FOREIGN KEY (vendeeperson_id) REFERENCES chill_vendee.vendee_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + // $this->addSql('ALTER INDEX chill_vendee.idx_1a4b602deef79338 RENAME TO IDX_DD0A4C00EEF79338'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE AsideActivity DROP CONSTRAINT FK_E9FA2191C54C8C93'); + $this->addSql('DROP SEQUENCE AsideActivity_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE AsideActivityType_id_seq CASCADE'); + // $this->addSql('CREATE TABLE chill_main_address_legacy (id INT DEFAULT NULL, postcode_id INT DEFAULT NULL, street VARCHAR(255) DEFAULT NULL, streetnumber VARCHAR(255) DEFAULT NULL, validfrom DATE DEFAULT NULL, isnoaddress BOOLEAN DEFAULT NULL, customs JSONB DEFAULT NULL, floor VARCHAR(16) DEFAULT NULL, corridor VARCHAR(16) DEFAULT NULL, steps VARCHAR(16) DEFAULT NULL, buildingname VARCHAR(255) DEFAULT NULL, flat VARCHAR(16) DEFAULT NULL, distribution VARCHAR(255) DEFAULT NULL, extra VARCHAR(255) DEFAULT NULL, validto DATE DEFAULT NULL, point VARCHAR(255) DEFAULT NULL, linkedtothirdparty_id INT DEFAULT NULL)'); + $this->addSql('DROP TABLE AsideActivity'); + $this->addSql('DROP TABLE AsideActivityType'); + /* + $this->addSql('CREATE SCHEMA public'); + + $this->addSql('COMMENT ON COLUMN scopes.name IS NULL'); + $this->addSql('ALTER INDEX idx_7a48df7f5df53b66 RENAME TO idx_286dc95df53b66'); + $this->addSql('COMMENT ON COLUMN country.name IS NULL'); + $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT fk_7201106f217bbb47'); + $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT fk_7201106f82f1baf4'); + $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT fk_7201106f217bbb47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT fk_7201106f82f1baf4 FOREIGN KEY (language_id) REFERENCES language (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('COMMENT ON COLUMN language.name IS NULL'); + $this->addSql('ALTER TABLE customfieldsgroup ALTER options SET DEFAULT \'{}\''); + $this->addSql('ALTER TABLE customfieldsgroup ALTER options DROP NOT NULL'); + $this->addSql('COMMENT ON COLUMN customfieldsgroup.name IS NULL'); + $this->addSql('COMMENT ON COLUMN customfieldsgroup.options IS NULL'); + $this->addSql('ALTER TABLE activityreasoncategory ALTER name DROP NOT NULL'); + $this->addSql('COMMENT ON COLUMN activityreasoncategory.name IS NULL'); + $this->addSql('ALTER TABLE activityreason ALTER name DROP NOT NULL'); + $this->addSql('COMMENT ON COLUMN activityreason.name IS NULL'); + $this->addSql('ALTER INDEX idx_af82522312469de2 RENAME TO idx_654a2fcd12469de2'); + $this->addSql('ALTER INDEX idx_a14d8f3d96df1f10 RENAME TO idx_a14d8f3d447bbb3b'); + $this->addSql('ALTER TABLE customfield ALTER required SET DEFAULT \'false\''); + $this->addSql('ALTER TABLE customfield ALTER required DROP NOT NULL'); + $this->addSql('COMMENT ON COLUMN customfield.options IS NULL'); + $this->addSql('COMMENT ON COLUMN customfield.name IS NULL'); + $this->addSql('ALTER INDEX idx_7a6fdbefec418b RENAME TO idx_40fb5d6dfec418b'); + $this->addSql('ALTER TABLE custom_field_long_choice_options ALTER internal_key SET DEFAULT \'\''); + $this->addSql('COMMENT ON COLUMN custom_field_long_choice_options.text IS NULL'); + $this->addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(10)'); + $this->addSql('COMMENT ON COLUMN chill_person_marital_status.name IS NULL'); + $this->addSql('ALTER TABLE permission_groups ALTER flags SET DEFAULT \'[]\''); + $this->addSql('ALTER INDEX chill_3party.idx_14dc4475c7d3a8e6 RENAME TO idx_c65d4397c7d3a8e6'); + $this->addSql('ALTER INDEX chill_3party.idx_14dc44755932f377 RENAME TO idx_c65d43975932f377'); + $this->addSql('ALTER TABLE users ALTER usernameCanonical DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive ALTER ordering SET DEFAULT \'0\''); + $this->addSql('ALTER INDEX idx_72d110e8727aca70 RENAME TO idx_92351ece727aca70'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ALTER startDate SET DEFAULT \'1970-01-01\''); + $this->addSql('ALTER TABLE chill_person_social_action ALTER defaultNotificationDelay DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER delay DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER notificationDelay DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_main_address_reference ALTER point TYPE VARCHAR(255)'); + $this->addSql('ALTER TABLE chill_main_address_reference ALTER point DROP DEFAULT'); + $this->addSql('ALTER TABLE chill_main_address ADD customs JSONB DEFAULT \'[]\''); + $this->addSql('ALTER TABLE chill_main_address ALTER isNoAddress SET DEFAULT \'false\''); + $this->addSql('ALTER TABLE chill_main_address ALTER point TYPE VARCHAR(255)'); + $this->addSql('ALTER TABLE chill_main_address ALTER point DROP DEFAULT'); + $this->addSql('ALTER INDEX idx_e260a868504cb38d RENAME TO idx_64a4a621504cb38d'); + $this->addSql('ALTER INDEX idx_ac74095aa76ed395 RENAME TO idx_55026b0ca76ed395'); + $this->addSql('ALTER INDEX idx_ac74095a682b5931 RENAME TO idx_55026b0c682b5931'); + $this->addSql('ALTER INDEX idx_ac74095a217bbb47 RENAME TO idx_55026b0c217bbb47'); + $this->addSql('ALTER INDEX idx_ac74095ac54c8c93 RENAME TO idx_55026b0cc54c8c93'); + $this->addSql('ALTER INDEX idx_ac74095ad7fa8ef0 RENAME TO IDX_AC74095A550B0C53'); + $this->addSql('ALTER TABLE chill_person_household_members ALTER startDate TYPE DATE'); + $this->addSql('ALTER TABLE chill_person_household_members ALTER startDate DROP DEFAULT'); + $this->addSql('ALTER TABLE chill_person_household_members ALTER endDate TYPE DATE'); + $this->addSql('ALTER TABLE chill_person_household_members ALTER endDate DROP DEFAULT'); + $this->addSql('COMMENT ON COLUMN chill_person_household_members.startdate IS NULL'); + $this->addSql('COMMENT ON COLUMN chill_person_household_members.enddate IS NULL'); + $this->addSql('CREATE INDEX household_members_not_overlaps ON chill_person_household_members (person_id) WHERE (sharedhousehold IS TRUE)'); + $this->addSql('ALTER TABLE activitytype ALTER category_id SET DEFAULT 1'); + $this->addSql('ALTER TABLE chill_person_household ADD CONSTRAINT fk_household_comment_embeddable_user FOREIGN KEY (comment_members_userid) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX IDX_BE50A270116F5FA9 ON chill_person_household (comment_members_userid)'); + $this->addSql('DROP INDEX search_name_code'); + $this->addSql('ALTER TABLE chill_person_person ADD cfdata_old TEXT DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_person_person ALTER cFData DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_person ALTER maritalStatus_id TYPE VARCHAR(10)'); + $this->addSql('COMMENT ON COLUMN chill_person_person.cfdata_old IS \'(DC2Type:array)\''); + $this->addSql('COMMENT ON COLUMN chill_person_person.cfdata IS NULL'); + $this->addSql('CREATE INDEX mobilenumber_trgm_idx ON chill_person_person (mobilenumber)'); + $this->addSql('CREATE INDEX fullnamecanonical_trgm_idx ON chill_person_person (fullnamecanonical)'); + $this->addSql('CREATE INDEX phonenumber_trgm_idx ON chill_person_person (phonenumber)'); + $this->addSql('ALTER INDEX idx_bf210a141c9da55 RENAME TO idx_3370d4401c9da55'); + $this->addSql('ALTER INDEX idx_bf210a143818da5 RENAME TO idx_3370d4403818da5'); + $this->addSql('ALTER INDEX idx_bf210a145932f377 RENAME TO idx_person_center'); + $this->addSql('ALTER INDEX idx_bf210a14d7d03ce3 RENAME TO IDX_BF210A145521BE40'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP CONSTRAINT FK_B694FB365FF1AEC'); + $this->addSql('DROP INDEX IDX_B694FB365FF1AEC'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startDate TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startDate DROP DEFAULT'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER endDate TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER endDate DROP DEFAULT'); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.startdate IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.enddate IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE UNIQUE INDEX uniq_93f763ae217bbb47 ON chill_vendee.vendee_person (person_id)'); + $this->addSql('ALTER TABLE chill_vendee.vendeeperson_entourage DROP CONSTRAINT FK_4D319FFEF57537C3'); + $this->addSql('ALTER INDEX chill_vendee.idx_dd0a4c00eef79338 RENAME TO idx_1a4b602deef79338'); + */ + } +} \ No newline at end of file From e7c76734a6b9d7e459870db80c24990446909c3c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 6 Jul 2021 15:56:55 +0200 Subject: [PATCH 06/58] start form --- .../src/Form/AsideActivityType.php | 61 +++++++++++++++---- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php index 6497c25c0..00c227bcb 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php @@ -2,34 +2,71 @@ namespace Chill\AsideActivityBundle\Form; +use Chill\MainBundle\Entity\User; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; -use Chill\PersonBundle\Form\Type\ClosingMotivePickerType; -use Chill\MainBundle\Form\Type\TranslatableStringFormType; -use Symfony\Component\Form\Extension\Core\Type\CheckboxType; -use Symfony\Component\Form\Extension\Core\Type\NumberType; use Symfony\Component\Form\Extension\Core\Type\DateType; +use Symfony\Component\Form\Extension\Core\Type\NumberType; +use Symfony\Component\Form\Extension\Core\Type\TextareaType; +use Symfony\Component\Form\Extension\Core\Type\TextType; /** * * */ -class ClosingMotiveType extends AbstractType +class AsideActivityType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('date', DateType::class, [ - 'label' => 'Nom' + ->add('createdBy', 'entity', + array( + 'class' => User::class, + 'choice_label' => 'username' + ), + [ + 'label' => 'Utilisateur', + 'required' => true ]) - ; + ->add('agent', 'entity', + array( + 'class' => User::class, + 'choice_label' => 'username' + ), + [ + 'label' => 'Agent', + 'required' => true + ]) + ->add('type', 'entity', + array( + 'class' => AsideActivityType::class, + 'choice_label' => 'title' + ), + [ + 'label' => 'Type', + 'required' => true + ]) + ->add('date', DateType::class, [ + 'label' => 'Date', + 'required' => true + ]) + ->add('duration', NumberType::class, [ + 'label' => 'Durée' + ]) + ->add('location', TextType::class, [ + 'label' => 'Lieu' + ]) + ->add('note', TextareaType::class, [ + 'label' => 'Note' + ]) +; } - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { - $resolver - ->setDefault('class', \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class) - ; + $resolver->setDefaults([ + 'data_class' => AsideActivity::class, + ]); } } \ No newline at end of file From ea2d6eac7b07db7d32bfbce58b224157b1f4c3ca Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 7 Jul 2021 16:24:41 +0200 Subject: [PATCH 07/58] AsideActivityType entity changed to AsideActivityCategory + building forms for both entities --- .../Controller/AsideActivityController.php | 17 +++++++++ .../src/Entity/AsideActivity.php | 11 +++--- ...vityType.php => AsideActivityCategory.php} | 7 ++-- .../src/Form/AsideActivityCategoryType.php | 25 +++++++++++++ .../src/Form/AsideActivityType.php | 36 ++++++++----------- ...hp => AsideActivityCategoryRepository.php} | 16 ++++----- .../src/Templates/asideActivity_new.html.twig | 11 ++++++ 7 files changed, 84 insertions(+), 39 deletions(-) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php rename src/Bundle/ChillAsideActivityBundle/src/Entity/{AsideActivityType.php => AsideActivityCategory.php} (93%) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php rename src/Bundle/ChillAsideActivityBundle/src/Repository/{AsideActivityTypeRepository.php => AsideActivityCategoryRepository.php} (69%) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Templates/asideActivity_new.html.twig diff --git a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php new file mode 100644 index 000000000..9642257c4 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php @@ -0,0 +1,17 @@ +createForm(AsideActivityType::class); + + return $this->render('asideActivity_new.html.twig', [ + 'asideActivityForm' => $form->createView(), + ]); + } +} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index 3b6cd18d1..3a16a8df0 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -2,8 +2,6 @@ namespace Chill\AsideActivityBundle\Entity; -use Chill\AsideActivityBundle\Repository\AsideActivityRepository; -use Chill\AsideActivityBundle\Entity\AsideActivityType; use Chill\MainBundle\Entity\User; use Doctrine\ORM\Mapping as ORM; @@ -20,7 +18,7 @@ class AsideActivity private $id; /** - * @ORM\ManyToOne(targetEntity=AsideActivityType::class, inversedBy="asideActivities") + * @ORM\ManyToOne(targetEntity=AsideActivityCategory::class, inversedBy="asideActivities") * @ORM\JoinColumn(nullable=false) */ private $type; @@ -49,6 +47,7 @@ class AsideActivity /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) + * @Assert\NotBlank(message="Vous devez choisir un agent") */ private $agent; @@ -77,12 +76,12 @@ class AsideActivity return $this->id; } - public function getType(): ?AsideActivityType + public function getType(): ?AsideActivityCategory { return $this->type; } - public function setType(?AsideActivityType $type): self + public function setType(?AsideActivityCategory $type): self { $this->type = $type; @@ -196,4 +195,4 @@ class AsideActivity return $this; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityType.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php similarity index 93% rename from src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityType.php rename to src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index ce94b4c93..a81745791 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -2,15 +2,14 @@ namespace Chill\AsideActivityBundle\Entity; -use Chill\AsideActivityBundle\Entity\AsideActivity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; /** - * @ORM\Entity(repositoryClass=AsideActivityTypeRepository::class) + * @ORM\Entity */ -class AsideActivityType +class AsideActivityCategory { /** * @ORM\Id @@ -97,4 +96,4 @@ class AsideActivityType return $this; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php new file mode 100644 index 000000000..5c7054ded --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php @@ -0,0 +1,25 @@ +add('title', TextType::class, + [ + 'label' => 'Nom', + ]) + ->add('isActive', ChoiceType::class, + [ + 'choices' => [ + 'Yes' => true, + 'No' => false + ], + 'expanded' => true + ]); + } +} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php index 00c227bcb..b03822a76 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php @@ -2,14 +2,16 @@ namespace Chill\AsideActivityBundle\Form; +use Chill\AsideActivityBundle\Entity\AsideActivityCategory; use Chill\MainBundle\Entity\User; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\Extension\Core\Type\NumberType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; -use Symfony\Component\Form\Extension\Core\Type\TextType; + /** * @@ -20,32 +22,27 @@ class AsideActivityType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('createdBy', 'entity', - array( - 'class' => User::class, - 'choice_label' => 'username' - ), + ->add('createdBy', EntityType::class, [ 'label' => 'Utilisateur', - 'required' => true - ]) - ->add('agent', 'entity', - array( + 'required' => true, 'class' => User::class, 'choice_label' => 'username' - ), + ]) + ->add('agent', EntityType::class, [ 'label' => 'Agent', - 'required' => true + 'required' => true, + 'class' => User::class, + 'placeholder' => 'L’agent pour qui l\'activité annexe est créée', + 'choice_label' => 'username' ]) - ->add('type', 'entity', - array( - 'class' => AsideActivityType::class, - 'choice_label' => 'title' - ), + ->add('type', EntityType::class, [ 'label' => 'Type', - 'required' => true + 'required' => true, + 'class' => AsideActivityCategory::class, + 'choice_label' => 'title' ]) ->add('date', DateType::class, [ 'label' => 'Date', @@ -54,9 +51,6 @@ class AsideActivityType extends AbstractType ->add('duration', NumberType::class, [ 'label' => 'Durée' ]) - ->add('location', TextType::class, [ - 'label' => 'Lieu' - ]) ->add('note', TextareaType::class, [ 'label' => 'Note' ]) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityTypeRepository.php b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php similarity index 69% rename from src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityTypeRepository.php rename to src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php index 8cb2daad9..bcae0ef2c 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityTypeRepository.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php @@ -4,28 +4,28 @@ declare(strict_types=1); namespace Chill\AsideActivityBundle\Repository; -use Chill\AsideActivityBundle\Entity\AsideActivityType; +use Chill\AsideActivityBundle\Entity\AsideActivityCategory; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\Persistence\ObjectRepository; -class AsideActivityTypeRepository implements ObjectRepository +class AsideActivityCategoryRepository implements ObjectRepository { private EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { - $this->repository = $entityManager->getRepository(AsideActivityType::class); + $this->repository = $entityManager->getRepository(AsideActivityCategory::class); } - public function find($id): ?AsideActivityType + public function find($id): ?AsideActivityCategory { return $this->repository->find($id); } /** - * @return AsideActivityType[] + * @return AsideActivityCategory[] */ public function findAll(): array { @@ -33,20 +33,20 @@ class AsideActivityTypeRepository implements ObjectRepository } /** - * @return AsideActivityType[] + * @return AsideActivityCategory[] */ public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria): ?AsideActivityType + public function findOneBy(array $criteria): ?AsideActivityCategory { return $this->repository->findOneBy($criteria); } public function getClassName(): string { - return AsideActivityType::class; + return AsideActivityCategory::class; } } \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Templates/asideActivity_new.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Templates/asideActivity_new.html.twig new file mode 100644 index 000000000..0781272a1 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Templates/asideActivity_new.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/Admin/layout.html.twig' %} + +{% block title %} +{% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} +{% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} +{% endembed %} +{% endblock %} \ No newline at end of file From 645252fd85fced06ecc5d1fd4ddcb4bed309d48a Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 15 Jul 2021 16:15:46 +0200 Subject: [PATCH 08/58] start CRUD controllers asideActivityBundle --- .../AsideActivityCategoryController.php | 16 +++++ .../Controller/AsideActivityController.php | 24 ++++---- .../ChillAsideActivityExtension.php | 58 +++++++++++++++--- .../src/Form/AsideActivityCategoryType.php | 2 + .../src/Form/AsideActivityType.php | 22 +------ .../src/Resources/config/services.php | 14 ----- .../views/asideActivity/new.html.twig | 27 +++++++++ .../asideActivityCategory/edit.html.twig | 12 ++++ .../asideActivityCategory/index.html.twig | 60 +++++++++++++++++++ .../views/asideActivityCategory/new.html.twig | 11 ++++ .../src/Templates/asideActivity_new.html.twig | 11 ---- .../src/config/routes.yaml | 3 + .../src/config/services.yaml | 0 .../src/translations/messages.yaml | 0 14 files changed, 195 insertions(+), 65 deletions(-) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php delete mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/config/services.php create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/edit.html.twig create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/new.html.twig delete mode 100644 src/Bundle/ChillAsideActivityBundle/src/Templates/asideActivity_new.html.twig create mode 100644 src/Bundle/ChillAsideActivityBundle/src/config/routes.yaml create mode 100644 src/Bundle/ChillAsideActivityBundle/src/config/services.yaml create mode 100644 src/Bundle/ChillAsideActivityBundle/src/translations/messages.yaml diff --git a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php new file mode 100644 index 000000000..60007b179 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php @@ -0,0 +1,16 @@ +createForm(AsideActivityType::class); - - return $this->render('asideActivity_new.html.twig', [ - 'asideActivityForm' => $form->createView(), - ]); - } + } diff --git a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php index 087ae6456..952dd1400 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php @@ -12,9 +12,10 @@ namespace Chill\AsideActivityBundle\DependencyInjection; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; -use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; +use Symfony\Component\DependencyInjection\Loader; -final class ChillAsideActivityExtension extends Extension +final class ChillAsideActivityExtension extends Extension implements PrependExtensionInterface { /** * {@inheritdoc} @@ -23,11 +24,54 @@ final class ChillAsideActivityExtension extends Extension */ public function load(array $configs, ContainerBuilder $container): void { - $loader = new PhpFileLoader( - $container, - new FileLocator(__DIR__ . '/../Resources/config') - ); + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config')); + $loader->load('services.yaml'); + } - $loader->load('services.php'); + public function prepend(ContainerBuilder $container) + { + $this->prependRoute($container); + $this->prependCruds($container); + } + + protected function prependRoute(ContainerBuilder $container) + { + //declare routes for task bundle + $container->prependExtensionConfig('chill_main', array( + 'routing' => array( + 'resources' => array( + '@ChillAsideActivityBundle/config/routes.yaml', + ) + ) + )); + } + + protected function prependCruds(ContainerBuilder $container) + { + $container->prependExtensionConfig('chill_main', [ + 'cruds' => [ + [ + 'class' => \Chill\AsideActivityBundle\Entity\AsideActivityCategory::class, + 'name' => 'aside_activity_category', + 'base_path' => '/admin/asideactivity/category', + 'form_class' => \Chill\AsideActivityBundle\Form\AsideActivityCategoryType::class, + 'controller' => \Chill\AsideActivityBundle\Controller\AsideActivityCategoryController::class, + 'actions' => [ + 'index' => [ + 'template' => '@ChillAsideActivity/asideActivityCategory/index.html.twig', + 'role' => 'ROLE_ADMIN' + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillAsideActivity/asideActivityCategory/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillAsideActivity/asideActivityCategory/edit.html.twig', + ] + ] + ], + ] + ]); } } \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php index 5c7054ded..36c818b4c 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php @@ -1,5 +1,7 @@ 'L’agent pour qui l\'activité annexe est créée', 'choice_label' => 'username' ]) - ->add('type', EntityType::class, - [ - 'label' => 'Type', - 'required' => true, - 'class' => AsideActivityCategory::class, - 'choice_label' => 'title' - ]) - ->add('date', DateType::class, [ - 'label' => 'Date', - 'required' => true - ]) - ->add('duration', NumberType::class, [ - 'label' => 'Durée' - ]) ->add('note', TextareaType::class, [ 'label' => 'Note' ]) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/config/services.php b/src/Bundle/ChillAsideActivityBundle/src/Resources/config/services.php deleted file mode 100644 index 827fa1765..000000000 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/config/services.php +++ /dev/null @@ -1,14 +0,0 @@ -Creér un activité annexe + + {{ form_start(asideActivityForm) }} + + + + + {{ form_widget(asideActivityForm) }} + + + {{ form_end(asideActivityForm)}} + +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/edit.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/edit.html.twig new file mode 100644 index 000000000..dacee767c --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/edit.html.twig @@ -0,0 +1,12 @@ +{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block layout_wvm_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_view %}{% endblock %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig new file mode 100644 index 000000000..fd1fd8e29 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig @@ -0,0 +1,60 @@ +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} + +{% block admin_content %} +

{{ 'ActivityType list'|trans }}

+ + + + + + + + + + + {% for entity in entities %} + + + + + + {% endfor %} + +
{{ 'Name'|trans }}{{ 'Active'|trans }}{{ 'Actions'|trans }}
{{ entity.name|localize_translatable_string }} + {%- if entity.active -%} + + {%- else -%} + + {%- endif -%} + +
    +
  • + +
  • +
+
+ + + {% endblock %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/new.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/new.html.twig new file mode 100644 index 000000000..d7ac89752 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/new.html.twig @@ -0,0 +1,11 @@ +{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block layout_wvm_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Templates/asideActivity_new.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Templates/asideActivity_new.html.twig deleted file mode 100644 index 0781272a1..000000000 --- a/src/Bundle/ChillAsideActivityBundle/src/Templates/asideActivity_new.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} - -{% block title %} -{% include('@ChillMain/CRUD/_new_title.html.twig') %} -{% endblock %} - -{% block admin_content %} -{% embed '@ChillMain/CRUD/_new_content.html.twig' %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} -{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/config/routes.yaml b/src/Bundle/ChillAsideActivityBundle/src/config/routes.yaml new file mode 100644 index 000000000..622102e34 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/config/routes.yaml @@ -0,0 +1,3 @@ +chill_asideactivities_controllers: + resource: "@ChillAsideActivityBundle/Controller" + type: annotation \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/config/services.yaml b/src/Bundle/ChillAsideActivityBundle/src/config/services.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/src/Bundle/ChillAsideActivityBundle/src/translations/messages.yaml b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.yaml new file mode 100644 index 000000000..e69de29bb From e72a8fe5a0f703152d2d0fceb4113fd4dc7941d8 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 10:20:35 +0200 Subject: [PATCH 09/58] bootstrap class added --- .../src/Resources/views/asideActivityCategory/index.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig index fd1fd8e29..fa8d6573b 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig @@ -19,7 +19,7 @@ {% block admin_content %}

{{ 'ActivityType list'|trans }}

- +
From 4fa1820d8d12a450c1f5b9d5e93263bbaa5fdaac Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 10:37:42 +0200 Subject: [PATCH 10/58] bootstrap classes added --- .../Resources/views/asideActivityCategory/index.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig index fa8d6573b..03efb0197 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig @@ -39,9 +39,9 @@ {%- endif -%} @@ -52,7 +52,7 @@
  • - + {{ 'Create a new activity type'|trans }}
  • From ee8e9f1ebc84e2d828c3c58b331f82982a130355 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 10:39:27 +0200 Subject: [PATCH 11/58] commented out lines deleted from migration --- .../src/migrations/Version20210706124644.php | 172 ------------------ 1 file changed, 172 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php index 77e2b76ce..8fdcb64e3 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php @@ -34,90 +34,6 @@ final class Version20210706124644 extends AbstractMigration $this->addSql('ALTER TABLE AsideActivity ADD CONSTRAINT FK_E9FA219165FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE AsideActivity ADD CONSTRAINT FK_E9FA21913414710B FOREIGN KEY (agent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); // this up() migration is auto-generated, please modify it to your needs - - // $this->addSql('DROP TABLE chill_main_address_legacy'); - // $this->addSql('ALTER INDEX idx_55026b0ca76ed395 RENAME TO IDX_AC74095AA76ED395'); - // $this->addSql('ALTER INDEX idx_55026b0cc54c8c93 RENAME TO IDX_AC74095AC54C8C93'); - // $this->addSql('ALTER INDEX idx_55026b0c682b5931 RENAME TO IDX_AC74095A682B5931'); - // $this->addSql('ALTER INDEX idx_55026b0c217bbb47 RENAME TO IDX_AC74095A217BBB47'); - // $this->addSql('ALTER INDEX idx_ac74095a550b0c53 RENAME TO IDX_AC74095AD7FA8EF0'); - // $this->addSql('ALTER TABLE activityreason ALTER name SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN activityreason.name IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER INDEX idx_654a2fcd12469de2 RENAME TO IDX_AF82522312469DE2'); - // $this->addSql('ALTER TABLE activityreasoncategory ALTER name SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN activityreasoncategory.name IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER TABLE activitytype ALTER category_id DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_main_address DROP customs'); - // $this->addSql('ALTER TABLE chill_main_address ALTER isnoaddress DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_main_address ALTER point TYPE geometry(POINT,4326)'); - // $this->addSql('ALTER TABLE chill_main_address ALTER point DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point TYPE geometry(POINT,4326)'); - // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point DROP DEFAULT'); - // $this->addSql('CREATE INDEX search_name_code ON chill_main_postal_code (code, label)'); - // $this->addSql('ALTER INDEX idx_64a4a621504cb38d RENAME TO IDX_E260A868504CB38D'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive ALTER ordering DROP DEFAULT'); - // $this->addSql('ALTER INDEX idx_92351ece727aca70 RENAME TO IDX_72D110E8727ACA70'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ALTER startdate DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startdate TYPE DATE'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startdate DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER enddate TYPE DATE'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER enddate DROP DEFAULT'); - // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.startDate IS \'(DC2Type:date_immutable)\''); - // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.endDate IS \'(DC2Type:date_immutable)\''); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD CONSTRAINT FK_B694FB365FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - // $this->addSql('CREATE INDEX IDX_B694FB365FF1AEC ON chill_person_accompanying_period_work (updatedBy_id)'); - // $this->addSql('ALTER TABLE chill_person_household DROP CONSTRAINT fk_household_comment_embeddable_user'); - // $this->addSql('DROP INDEX IDX_BE50A270116F5FA9'); - // $this->addSql('DROP INDEX household_members_not_overlaps'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER startdate TYPE DATE'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER startdate DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER enddate TYPE DATE'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER enddate DROP DEFAULT'); - // $this->addSql('COMMENT ON COLUMN chill_person_household_members.startDate IS \'(DC2Type:date_immutable)\''); - // $this->addSql('COMMENT ON COLUMN chill_person_household_members.endDate IS \'(DC2Type:date_immutable)\''); - // $this->addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(7)'); - // $this->addSql('COMMENT ON COLUMN chill_person_marital_status.name IS \'(DC2Type:json_array)\''); - // $this->addSql('DROP INDEX mobilenumber_trgm_idx'); - // $this->addSql('DROP INDEX fullnamecanonical_trgm_idx'); - // $this->addSql('DROP INDEX phonenumber_trgm_idx'); - // $this->addSql('ALTER TABLE chill_person_person DROP cfdata_old'); - // $this->addSql('ALTER TABLE chill_person_person ALTER maritalstatus_id TYPE VARCHAR(7)'); - // $this->addSql('ALTER TABLE chill_person_person ALTER cfdata SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN chill_person_person.cFData IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER INDEX idx_3370d4403818da5 RENAME TO IDX_BF210A143818DA5'); - // $this->addSql('ALTER INDEX idx_3370d4401c9da55 RENAME TO IDX_BF210A141C9DA55'); - // $this->addSql('ALTER INDEX idx_bf210a145521be40 RENAME TO IDX_BF210A14D7D03CE3'); - // $this->addSql('ALTER INDEX idx_person_center RENAME TO IDX_BF210A145932F377'); - // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT FK_7201106F217BBB47'); - // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT FK_7201106F82F1BAF4'); - // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT FK_7201106F217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT FK_7201106F82F1BAF4 FOREIGN KEY (language_id) REFERENCES language (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - // $this->addSql('ALTER TABLE chill_person_social_action ALTER defaultnotificationdelay SET NOT NULL'); - // $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER delay SET NOT NULL'); - // $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER notificationdelay SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN country.name IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER TABLE custom_field_long_choice_options ALTER internal_key DROP DEFAULT'); - // $this->addSql('COMMENT ON COLUMN custom_field_long_choice_options.text IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER TABLE customfield ALTER required DROP DEFAULT'); - // $this->addSql('ALTER TABLE customfield ALTER required SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN customfield.name IS \'(DC2Type:json_array)\''); - // $this->addSql('COMMENT ON COLUMN customfield.options IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER INDEX idx_40fb5d6dfec418b RENAME TO IDX_7A6FDBEFEC418B'); - // $this->addSql('ALTER INDEX idx_286dc95df53b66 RENAME TO IDX_7A48DF7F5DF53B66'); - // $this->addSql('ALTER TABLE customfieldsgroup ALTER options DROP DEFAULT'); - // $this->addSql('ALTER TABLE customfieldsgroup ALTER options SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN customfieldsgroup.name IS \'(DC2Type:json_array)\''); - // $this->addSql('COMMENT ON COLUMN customfieldsgroup.options IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER INDEX idx_a14d8f3d447bbb3b RENAME TO IDX_A14D8F3D96DF1F10'); - // $this->addSql('COMMENT ON COLUMN language.name IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER TABLE permission_groups ALTER flags DROP DEFAULT'); - // $this->addSql('COMMENT ON COLUMN scopes.name IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER INDEX chill_3party.idx_c65d4397c7d3a8e6 RENAME TO IDX_14DC4475C7D3A8E6'); - // $this->addSql('ALTER INDEX chill_3party.idx_c65d43975932f377 RENAME TO IDX_14DC44755932F377'); - // $this->addSql('ALTER TABLE users ALTER usernamecanonical SET NOT NULL'); - // $this->addSql('DROP INDEX uniq_93f763ae217bbb47'); - // $this->addSql('ALTER TABLE chill_vendee.vendeeperson_entourage ADD CONSTRAINT FK_4D319FFEF57537C3 FOREIGN KEY (vendeeperson_id) REFERENCES chill_vendee.vendee_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - // $this->addSql('ALTER INDEX chill_vendee.idx_1a4b602deef79338 RENAME TO IDX_DD0A4C00EEF79338'); } public function down(Schema $schema): void @@ -126,95 +42,7 @@ final class Version20210706124644 extends AbstractMigration $this->addSql('ALTER TABLE AsideActivity DROP CONSTRAINT FK_E9FA2191C54C8C93'); $this->addSql('DROP SEQUENCE AsideActivity_id_seq CASCADE'); $this->addSql('DROP SEQUENCE AsideActivityType_id_seq CASCADE'); - // $this->addSql('CREATE TABLE chill_main_address_legacy (id INT DEFAULT NULL, postcode_id INT DEFAULT NULL, street VARCHAR(255) DEFAULT NULL, streetnumber VARCHAR(255) DEFAULT NULL, validfrom DATE DEFAULT NULL, isnoaddress BOOLEAN DEFAULT NULL, customs JSONB DEFAULT NULL, floor VARCHAR(16) DEFAULT NULL, corridor VARCHAR(16) DEFAULT NULL, steps VARCHAR(16) DEFAULT NULL, buildingname VARCHAR(255) DEFAULT NULL, flat VARCHAR(16) DEFAULT NULL, distribution VARCHAR(255) DEFAULT NULL, extra VARCHAR(255) DEFAULT NULL, validto DATE DEFAULT NULL, point VARCHAR(255) DEFAULT NULL, linkedtothirdparty_id INT DEFAULT NULL)'); $this->addSql('DROP TABLE AsideActivity'); $this->addSql('DROP TABLE AsideActivityType'); - /* - $this->addSql('CREATE SCHEMA public'); - - $this->addSql('COMMENT ON COLUMN scopes.name IS NULL'); - $this->addSql('ALTER INDEX idx_7a48df7f5df53b66 RENAME TO idx_286dc95df53b66'); - $this->addSql('COMMENT ON COLUMN country.name IS NULL'); - $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT fk_7201106f217bbb47'); - $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT fk_7201106f82f1baf4'); - $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT fk_7201106f217bbb47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT fk_7201106f82f1baf4 FOREIGN KEY (language_id) REFERENCES language (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('COMMENT ON COLUMN language.name IS NULL'); - $this->addSql('ALTER TABLE customfieldsgroup ALTER options SET DEFAULT \'{}\''); - $this->addSql('ALTER TABLE customfieldsgroup ALTER options DROP NOT NULL'); - $this->addSql('COMMENT ON COLUMN customfieldsgroup.name IS NULL'); - $this->addSql('COMMENT ON COLUMN customfieldsgroup.options IS NULL'); - $this->addSql('ALTER TABLE activityreasoncategory ALTER name DROP NOT NULL'); - $this->addSql('COMMENT ON COLUMN activityreasoncategory.name IS NULL'); - $this->addSql('ALTER TABLE activityreason ALTER name DROP NOT NULL'); - $this->addSql('COMMENT ON COLUMN activityreason.name IS NULL'); - $this->addSql('ALTER INDEX idx_af82522312469de2 RENAME TO idx_654a2fcd12469de2'); - $this->addSql('ALTER INDEX idx_a14d8f3d96df1f10 RENAME TO idx_a14d8f3d447bbb3b'); - $this->addSql('ALTER TABLE customfield ALTER required SET DEFAULT \'false\''); - $this->addSql('ALTER TABLE customfield ALTER required DROP NOT NULL'); - $this->addSql('COMMENT ON COLUMN customfield.options IS NULL'); - $this->addSql('COMMENT ON COLUMN customfield.name IS NULL'); - $this->addSql('ALTER INDEX idx_7a6fdbefec418b RENAME TO idx_40fb5d6dfec418b'); - $this->addSql('ALTER TABLE custom_field_long_choice_options ALTER internal_key SET DEFAULT \'\''); - $this->addSql('COMMENT ON COLUMN custom_field_long_choice_options.text IS NULL'); - $this->addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(10)'); - $this->addSql('COMMENT ON COLUMN chill_person_marital_status.name IS NULL'); - $this->addSql('ALTER TABLE permission_groups ALTER flags SET DEFAULT \'[]\''); - $this->addSql('ALTER INDEX chill_3party.idx_14dc4475c7d3a8e6 RENAME TO idx_c65d4397c7d3a8e6'); - $this->addSql('ALTER INDEX chill_3party.idx_14dc44755932f377 RENAME TO idx_c65d43975932f377'); - $this->addSql('ALTER TABLE users ALTER usernameCanonical DROP NOT NULL'); - $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive ALTER ordering SET DEFAULT \'0\''); - $this->addSql('ALTER INDEX idx_72d110e8727aca70 RENAME TO idx_92351ece727aca70'); - $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ALTER startDate SET DEFAULT \'1970-01-01\''); - $this->addSql('ALTER TABLE chill_person_social_action ALTER defaultNotificationDelay DROP NOT NULL'); - $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER delay DROP NOT NULL'); - $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER notificationDelay DROP NOT NULL'); - $this->addSql('ALTER TABLE chill_main_address_reference ALTER point TYPE VARCHAR(255)'); - $this->addSql('ALTER TABLE chill_main_address_reference ALTER point DROP DEFAULT'); - $this->addSql('ALTER TABLE chill_main_address ADD customs JSONB DEFAULT \'[]\''); - $this->addSql('ALTER TABLE chill_main_address ALTER isNoAddress SET DEFAULT \'false\''); - $this->addSql('ALTER TABLE chill_main_address ALTER point TYPE VARCHAR(255)'); - $this->addSql('ALTER TABLE chill_main_address ALTER point DROP DEFAULT'); - $this->addSql('ALTER INDEX idx_e260a868504cb38d RENAME TO idx_64a4a621504cb38d'); - $this->addSql('ALTER INDEX idx_ac74095aa76ed395 RENAME TO idx_55026b0ca76ed395'); - $this->addSql('ALTER INDEX idx_ac74095a682b5931 RENAME TO idx_55026b0c682b5931'); - $this->addSql('ALTER INDEX idx_ac74095a217bbb47 RENAME TO idx_55026b0c217bbb47'); - $this->addSql('ALTER INDEX idx_ac74095ac54c8c93 RENAME TO idx_55026b0cc54c8c93'); - $this->addSql('ALTER INDEX idx_ac74095ad7fa8ef0 RENAME TO IDX_AC74095A550B0C53'); - $this->addSql('ALTER TABLE chill_person_household_members ALTER startDate TYPE DATE'); - $this->addSql('ALTER TABLE chill_person_household_members ALTER startDate DROP DEFAULT'); - $this->addSql('ALTER TABLE chill_person_household_members ALTER endDate TYPE DATE'); - $this->addSql('ALTER TABLE chill_person_household_members ALTER endDate DROP DEFAULT'); - $this->addSql('COMMENT ON COLUMN chill_person_household_members.startdate IS NULL'); - $this->addSql('COMMENT ON COLUMN chill_person_household_members.enddate IS NULL'); - $this->addSql('CREATE INDEX household_members_not_overlaps ON chill_person_household_members (person_id) WHERE (sharedhousehold IS TRUE)'); - $this->addSql('ALTER TABLE activitytype ALTER category_id SET DEFAULT 1'); - $this->addSql('ALTER TABLE chill_person_household ADD CONSTRAINT fk_household_comment_embeddable_user FOREIGN KEY (comment_members_userid) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('CREATE INDEX IDX_BE50A270116F5FA9 ON chill_person_household (comment_members_userid)'); - $this->addSql('DROP INDEX search_name_code'); - $this->addSql('ALTER TABLE chill_person_person ADD cfdata_old TEXT DEFAULT NULL'); - $this->addSql('ALTER TABLE chill_person_person ALTER cFData DROP NOT NULL'); - $this->addSql('ALTER TABLE chill_person_person ALTER maritalStatus_id TYPE VARCHAR(10)'); - $this->addSql('COMMENT ON COLUMN chill_person_person.cfdata_old IS \'(DC2Type:array)\''); - $this->addSql('COMMENT ON COLUMN chill_person_person.cfdata IS NULL'); - $this->addSql('CREATE INDEX mobilenumber_trgm_idx ON chill_person_person (mobilenumber)'); - $this->addSql('CREATE INDEX fullnamecanonical_trgm_idx ON chill_person_person (fullnamecanonical)'); - $this->addSql('CREATE INDEX phonenumber_trgm_idx ON chill_person_person (phonenumber)'); - $this->addSql('ALTER INDEX idx_bf210a141c9da55 RENAME TO idx_3370d4401c9da55'); - $this->addSql('ALTER INDEX idx_bf210a143818da5 RENAME TO idx_3370d4403818da5'); - $this->addSql('ALTER INDEX idx_bf210a145932f377 RENAME TO idx_person_center'); - $this->addSql('ALTER INDEX idx_bf210a14d7d03ce3 RENAME TO IDX_BF210A145521BE40'); - $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP CONSTRAINT FK_B694FB365FF1AEC'); - $this->addSql('DROP INDEX IDX_B694FB365FF1AEC'); - $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startDate TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); - $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startDate DROP DEFAULT'); - $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER endDate TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); - $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER endDate DROP DEFAULT'); - $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.startdate IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.enddate IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('CREATE UNIQUE INDEX uniq_93f763ae217bbb47 ON chill_vendee.vendee_person (person_id)'); - $this->addSql('ALTER TABLE chill_vendee.vendeeperson_entourage DROP CONSTRAINT FK_4D319FFEF57537C3'); - $this->addSql('ALTER INDEX chill_vendee.idx_dd0a4c00eef79338 RENAME TO idx_1a4b602deef79338'); - */ } } \ No newline at end of file From ccf5b9095124e32b0693f9de706a60374f6088de Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 10:40:29 +0200 Subject: [PATCH 12/58] filename changed to fix error --- .../Form/{AsideActivityType.php => AsideActivityFormType.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/Bundle/ChillAsideActivityBundle/src/Form/{AsideActivityType.php => AsideActivityFormType.php} (96%) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php similarity index 96% rename from src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php rename to src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index 804f25d7b..40633c362 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -11,7 +11,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\Extension\Core\Type\TextareaType; -class AsideActivityType extends AbstractType +class AsideActivityFormType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { From 9ac31d2d8b1ec22e258095f2b6e4fa8e2c50c8d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 3 Aug 2021 08:54:36 +0000 Subject: [PATCH 13/58] Apply 1 suggestion(s) to 1 file(s) --- .../ChillAsideActivityBundle/src/Entity/AsideActivity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index 3a16a8df0..47c014afd 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -30,7 +30,7 @@ class AsideActivity private $createdBy; /** - * @ORM\Column(type="datetime") + * @ORM\Column(type="datetime_immutable") */ private $createdAt; From 1edcb399c4011e22daf1525a8a58bc505e5cbc2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 3 Aug 2021 08:54:55 +0000 Subject: [PATCH 14/58] Apply 1 suggestion(s) to 1 file(s) --- .../ChillAsideActivityBundle/src/Entity/AsideActivity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index 47c014afd..e6adfe5a6 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -52,7 +52,7 @@ class AsideActivity private $agent; /** - * @ORM\Column(type="datetime") + * @ORM\Column(type="datetime_immutable") */ private $date; From f9195aa881f5841518f12c9c0d048f7390522d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 3 Aug 2021 09:13:02 +0000 Subject: [PATCH 15/58] Apply 1 suggestion(s) to 1 file(s) --- .../ChillAsideActivityBundle/src/Entity/AsideActivity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index e6adfe5a6..3a22ae384 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -15,7 +15,7 @@ class AsideActivity * @ORM\GeneratedValue * @ORM\Column(type="integer") */ - private $id; + private ?int $id; /** * @ORM\ManyToOne(targetEntity=AsideActivityCategory::class, inversedBy="asideActivities") From 2290da6f3bb741ca88775f3681ec0b543f36a8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 3 Aug 2021 09:14:21 +0000 Subject: [PATCH 16/58] Apply 1 suggestion(s) to 1 file(s) --- .../src/Entity/AsideActivityCategory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index a81745791..965282319 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -19,7 +19,7 @@ class AsideActivityCategory private $id; /** - * @ORM\Column(type="string", length=255) + * @ORM\Column(type="json", length=255) */ private $title; From 94d743c5b6cf350fdf2cb78c176ad261b8b3611c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 3 Aug 2021 09:14:50 +0000 Subject: [PATCH 17/58] Apply 1 suggestion(s) to 1 file(s) --- .../src/Entity/AsideActivityCategory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index 965282319..6623a603f 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -21,7 +21,7 @@ class AsideActivityCategory /** * @ORM\Column(type="json", length=255) */ - private $title; + private array $title; /** * @ORM\Column(type="boolean") From c13f63b3baf411c2b38990d6eae73051f5a5b183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 3 Aug 2021 09:15:04 +0000 Subject: [PATCH 18/58] Apply 1 suggestion(s) to 1 file(s) --- .../src/Entity/AsideActivityCategory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index 6623a603f..88f2c75cc 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -26,7 +26,7 @@ class AsideActivityCategory /** * @ORM\Column(type="boolean") */ - private $isActive; + private bool $isActive = true; /** * @ORM\OneToMany(targetEntity=AsideActivity::class, mappedBy="type") From 7b8a067002494f761283018d1e75e726ef52e83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 3 Aug 2021 09:15:15 +0000 Subject: [PATCH 19/58] Apply 1 suggestion(s) to 1 file(s) --- .../src/Entity/AsideActivityCategory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index 88f2c75cc..b6821fbad 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -55,7 +55,7 @@ class AsideActivityCategory return $this; } - public function getIsActive(): ?bool + public function getIsActive(): bool { return $this->isActive; } From ff58816ee03b5945c1ec48cdee6565cb59a960de Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 11:20:43 +0200 Subject: [PATCH 20/58] changed duration type into integer --- .../ChillAsideActivityBundle/src/Entity/AsideActivity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index e6adfe5a6..10be3d0e3 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -4,7 +4,7 @@ namespace Chill\AsideActivityBundle\Entity; use Chill\MainBundle\Entity\User; use Doctrine\ORM\Mapping as ORM; - +use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity */ @@ -57,7 +57,7 @@ class AsideActivity private $date; /** - * @ORM\Column(type="time", nullable=true) + * @ORM\Column(type="integer", nullable=true) */ private $duration; From 4cd2dc63c5520dc9e4e96081e81721abd7aa5831 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 11:21:20 +0200 Subject: [PATCH 21/58] asideActivities property removed + corresponding methods --- .../src/Entity/AsideActivityCategory.php | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index a81745791..fff0cf5e7 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -28,16 +28,6 @@ class AsideActivityCategory */ private $isActive; - /** - * @ORM\OneToMany(targetEntity=AsideActivity::class, mappedBy="type") - */ - private $asideActivities; - - public function __construct() - { - $this->asideActivities = new ArrayCollection(); - } - public function getId(): ?int { return $this->id; @@ -66,34 +56,4 @@ class AsideActivityCategory return $this; } - - /** - * @return Collection|AsideActivity[] - */ - public function getAsideActivities(): Collection - { - return $this->asideActivities; - } - - public function addAsideActivity(AsideActivity $asideActivity): self - { - if (!$this->asideActivities->contains($asideActivity)) { - $this->asideActivities[] = $asideActivity; - $asideActivity->setType($this); - } - - return $this; - } - - public function removeAsideActivity(AsideActivity $asideActivity): self - { - if ($this->asideActivities->removeElement($asideActivity)) { - // set the owning side to null (unless already changed) - if ($asideActivity->getType() === $this) { - $asideActivity->setType(null); - } - } - - return $this; - } } From 23bc71a38ccf4296560ba1048f66709d46193c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 3 Aug 2021 09:26:03 +0000 Subject: [PATCH 22/58] Apply 1 suggestion(s) to 1 file(s) --- .../src/migrations/Version20210706124644.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php index 8fdcb64e3..59fa35be4 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php @@ -21,7 +21,7 @@ final class Version20210706124644 extends AbstractMigration { $this->addSql('CREATE SEQUENCE AsideActivity_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE AsideActivityType_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE AsideActivityType_id_seq INCREMENT BY 1 MINVALUE 1 START 1000'); $this->addSql('CREATE TABLE AsideActivity (id INT NOT NULL, type_id INT NOT NULL, agent_id INT NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, duration TIME(0) WITHOUT TIME ZONE DEFAULT NULL, location VARCHAR(100) DEFAULT NULL, note TEXT DEFAULT NULL, createdBy_id INT NOT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE INDEX IDX_E9FA2191C54C8C93 ON AsideActivity (type_id)'); $this->addSql('CREATE INDEX IDX_E9FA21913174800F ON AsideActivity (createdBy_id)'); From 0bc894836f7b972415256afe99ee1c63d945ad5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 3 Aug 2021 12:39:50 +0000 Subject: [PATCH 23/58] Apply 1 suggestion(s) to 1 file(s) --- .../src/Entity/AsideActivityCategory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index bd9318040..7c9b0f102 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -8,6 +8,7 @@ use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity + * @Table(schema="chill_asideactivity") */ class AsideActivityCategory { From a5948259d9456207eca7a291f4737684567a0f9c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 14:41:01 +0200 Subject: [PATCH 24/58] templates added for aside activities --- .../views/asideActivity/edit.html.twig | 12 +++++ .../views/asideActivity/index.html.twig | 44 +++++++++++++++++++ .../asideActivityCategory/index.html.twig | 16 ------- 3 files changed, 56 insertions(+), 16 deletions(-) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/edit.html.twig create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/edit.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/edit.html.twig new file mode 100644 index 000000000..dacee767c --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/edit.html.twig @@ -0,0 +1,12 @@ +{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block layout_wvm_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_view %}{% endblock %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig new file mode 100644 index 000000000..3e0a4f404 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig @@ -0,0 +1,44 @@ +{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} + +{% block admin_content %} +

    {{ 'ActivityType list'|trans }}

    + +
{{ 'Name'|trans }} -
    +
    • - +
+ + + + + + + + + {% for entity in entities %} + + + + + + {% endfor %} + +
{{ 'Name'|trans }}{{ 'Active'|trans }}{{ 'Actions'|trans }}
{{ entity.name|localize_translatable_string }} + {%- if entity.active -%} + + {%- else -%} + + {%- endif -%} + +
    +
  • + +
  • +
+
+ + + {% endblock %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig index 03efb0197..3e0a4f404 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig @@ -1,19 +1,3 @@ -{# - * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} {% extends "@ChillActivity/Admin/layout_activity.html.twig" %} {% block admin_content %} From 357b87dadba5c49db79aea764178361127508f18 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 14:43:23 +0200 Subject: [PATCH 25/58] crud config added for aside activity --- .../ChillAsideActivityExtension.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php index 952dd1400..fb24d5d46 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php @@ -71,6 +71,27 @@ final class ChillAsideActivityExtension extends Extension implements PrependExte ] ] ], + [ + 'class' => \Chill\AsideActivityBundle\Entity\AsideActivity::class, + 'name' => 'aside_activity', + 'base_path' => '/asideactivity', + 'form_class' => \Chill\AsideActivityBundle\Form\AsideActivityFormType::class, + 'controller' => \Chill\AsideActivityBundle\Controller\AsideActivityController::class, + 'actions' => [ + 'index' => [ + 'template' => '@ChillAsideActivity/asideActivity/index.html.twig', + 'role' => 'ROLE_USER' + ], + 'new' => [ + 'role' => 'ROLE_USER', + 'template' => '@ChillAsideActivity/asideActivity/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_USER', + 'template' => '@ChillAsideActivity/asideActivity/edit.html.twig', + ] + ] + ], ] ]); } From b571620e6cd26ec6a7d24c7e04da025d1b87f5d0 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 14:45:21 +0200 Subject: [PATCH 26/58] aside activity category changed into final class --- .../src/Entity/AsideActivityCategory.php | 2 +- .../views/asideActivity/new.html.twig | 28 ++++--------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index bd9318040..5ac22ced4 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity */ -class AsideActivityCategory +final class AsideActivityCategory { /** * @ORM\Id diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig index e6283d8d4..d7ac89752 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig @@ -1,27 +1,11 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} +{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} {% block title %} -{% include('@ChillMain/CRUD/_new_title.html.twig') %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} {% endblock %} -{% block admin_content %} -{% embed '@ChillMain/CRUD/_new_content.html.twig' %} - {% block content_form_actions_save_and_show %}{% endblock %} -{% endembed %} +{% block layout_wvm_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} {% endblock %} - -{% block body %} - -

Creér un activité annexe

- - {{ form_start(asideActivityForm) }} - - - - - {{ form_widget(asideActivityForm) }} - - - {{ form_end(asideActivityForm)}} - -{% endblock %} \ No newline at end of file From 82841f47c8de1cf30dc214bf1644e4e489577f4f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 14:46:10 +0200 Subject: [PATCH 27/58] aside activity changed into final class and implements trackUpdateInterface, TrackCreationInterface --- .../ChillAsideActivityBundle/src/Entity/AsideActivity.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index 479396482..18ca4e715 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -2,13 +2,15 @@ namespace Chill\AsideActivityBundle\Entity; +use Chill\MainBundle\Doctrine\Model\TrackCreationInterface; +use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface; use Chill\MainBundle\Entity\User; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity */ -class AsideActivity +final class AsideActivity implements TrackUpdateInterface, TrackCreationInterface { /** * @ORM\Id From a0154331de7bd356df7ece0de54e5c9029d32c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 3 Aug 2021 12:51:40 +0000 Subject: [PATCH 28/58] Apply 1 suggestion(s) to 1 file(s) --- src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index 18ca4e715..15070542d 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -9,6 +9,7 @@ use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity + * @Table(schema="chill_asideactivity") */ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterface { From e42a5217be43b9f22de4989d3cf65cca1aa71326 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 14:53:39 +0200 Subject: [PATCH 29/58] createdBy field deleted from form --- .../src/Form/AsideActivityFormType.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index 40633c362..72da5bfca 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -16,13 +16,6 @@ class AsideActivityFormType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('createdBy', EntityType::class, - [ - 'label' => 'Utilisateur', - 'required' => true, - 'class' => User::class, - 'choice_label' => 'username' - ]) ->add('agent', EntityType::class, [ 'label' => 'Agent', From 3e498c34e5a4a87f2de7cae882bb46952d1f80a1 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 16:49:02 +0200 Subject: [PATCH 30/58] aside activity category commented out of form --- .../src/Form/AsideActivityFormType.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index 72da5bfca..db735eac3 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -3,6 +3,7 @@ namespace Chill\AsideActivityBundle\Form; use Chill\AsideActivityBundle\Entity\AsideActivity; +use Chill\AsideActivityBundle\Entity\AsideActivityCategory; use Chill\MainBundle\Entity\User; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; @@ -21,11 +22,20 @@ class AsideActivityFormType extends AbstractType 'label' => 'Agent', 'required' => true, 'class' => User::class, - 'placeholder' => 'L’agent pour qui l\'activité annexe est créée', + 'placeholder' => 'Choissisez l\'agent pour qui l\'activité est créée', 'choice_label' => 'username' ]) + // ->add('type', EntityType::class, + // [ + // 'label' => 'Type', + // 'required' => true, + // 'class' => AsideActivityCategory::class, + // 'placeholder' => 'Choissisez le type d\'activité', + // 'choice_label' => 'title' + // ]) ->add('note', TextareaType::class, [ - 'label' => 'Note' + 'label' => 'Note', + 'required' => false, ]) ; } From fadf2d62b01474f4d51d34c5721af1bd991a0672 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 16:49:51 +0200 Subject: [PATCH 31/58] use statements added and typehint updatedAt fixed --- .../ChillAsideActivityBundle/src/Entity/AsideActivity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index 15070542d..9adad4b83 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity - * @Table(schema="chill_asideactivity") + * @ORM\Table(schema="chill_asideactivity") */ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterface { @@ -132,7 +132,7 @@ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterfac return $this->updatedAt; } - public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self + public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; From 85b7e4add8cb777a1e903c8cfeb80cfdd5e79eda Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 3 Aug 2021 16:50:07 +0200 Subject: [PATCH 32/58] use statement added --- .../src/Entity/AsideActivityCategory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index c3d64661f..ba1856091 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -8,7 +8,7 @@ use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity - * @Table(schema="chill_asideactivity") + * @ORM\Table(schema="chill_asideactivity") */ final class AsideActivityCategory { From 7f3b2662094a5a149b0bffff8d12c312eb4d9e33 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 4 Aug 2021 10:34:39 +0200 Subject: [PATCH 33/58] new migration --- .../src/migrations/Version20210804082249.php | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php new file mode 100644 index 000000000..00d353368 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php @@ -0,0 +1,232 @@ +addSql('CREATE SCHEMA chill_asideactivity'); + $this->addSql('ALTER TABLE asideactivity DROP CONSTRAINT fk_e9fa2191c54c8c93'); + $this->addSql('DROP SEQUENCE asideactivity_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE asideactivitytype_id_seq CASCADE'); + $this->addSql('CREATE SEQUENCE chill_asideactivity.AsideActivity_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE chill_asideactivity.AsideActivityCategory_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE chill_asideactivity.AsideActivity (id INT NOT NULL, type_id INT NOT NULL, agent_id INT NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, duration INT DEFAULT NULL, location VARCHAR(100) DEFAULT NULL, note TEXT DEFAULT NULL, createdBy_id INT NOT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_A866DA0EC54C8C93 ON chill_asideactivity.AsideActivity (type_id)'); + $this->addSql('CREATE INDEX IDX_A866DA0E3174800F ON chill_asideactivity.AsideActivity (createdBy_id)'); + $this->addSql('CREATE INDEX IDX_A866DA0E65FF1AEC ON chill_asideactivity.AsideActivity (updatedBy_id)'); + $this->addSql('CREATE INDEX IDX_A866DA0E3414710B ON chill_asideactivity.AsideActivity (agent_id)'); + $this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.createdAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.updatedAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.date IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE chill_asideactivity.AsideActivityCategory (id INT NOT NULL, title JSON NOT NULL, isActive BOOLEAN NOT NULL, PRIMARY KEY(id))'); + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD CONSTRAINT FK_A866DA0EC54C8C93 FOREIGN KEY (type_id) REFERENCES chill_asideactivity.AsideActivityCategory (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD CONSTRAINT FK_A866DA0E3174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD CONSTRAINT FK_A866DA0E65FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD CONSTRAINT FK_A866DA0E3414710B FOREIGN KEY (agent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('DROP TABLE asideactivitytype'); + $this->addSql('DROP TABLE asideactivity'); + // $this->addSql('DROP TABLE chill_main_address_legacy'); + // $this->addSql('ALTER INDEX idx_55026b0ca76ed395 RENAME TO IDX_AC74095AA76ED395'); + // $this->addSql('ALTER INDEX idx_55026b0cc54c8c93 RENAME TO IDX_AC74095AC54C8C93'); + // $this->addSql('ALTER INDEX idx_55026b0c682b5931 RENAME TO IDX_AC74095A682B5931'); + // $this->addSql('ALTER INDEX idx_55026b0c217bbb47 RENAME TO IDX_AC74095A217BBB47'); + // $this->addSql('ALTER INDEX idx_ac74095a550b0c53 RENAME TO IDX_AC74095AD7FA8EF0'); + // $this->addSql('ALTER TABLE activityreason ALTER name SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN activityreason.name IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER INDEX idx_654a2fcd12469de2 RENAME TO IDX_AF82522312469DE2'); + // $this->addSql('ALTER TABLE activityreasoncategory ALTER name SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN activityreasoncategory.name IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER TABLE activitytype ALTER category_id DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_main_address DROP customs'); + // $this->addSql('ALTER TABLE chill_main_address ALTER isnoaddress DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_main_address ALTER point TYPE geometry(POINT,4326)'); + // $this->addSql('ALTER TABLE chill_main_address ALTER point DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point TYPE geometry(POINT,4326)'); + // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point DROP DEFAULT'); + // $this->addSql('CREATE INDEX search_name_code ON chill_main_postal_code (code, label)'); + // $this->addSql('ALTER INDEX idx_64a4a621504cb38d RENAME TO IDX_E260A868504CB38D'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive ALTER ordering DROP DEFAULT'); + // $this->addSql('ALTER INDEX idx_92351ece727aca70 RENAME TO IDX_72D110E8727ACA70'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ALTER startdate DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startdate TYPE DATE'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startdate DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER enddate TYPE DATE'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER enddate DROP DEFAULT'); + // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.startDate IS \'(DC2Type:date_immutable)\''); + // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.endDate IS \'(DC2Type:date_immutable)\''); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD CONSTRAINT FK_B694FB365FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + // $this->addSql('CREATE INDEX IDX_B694FB365FF1AEC ON chill_person_accompanying_period_work (updatedBy_id)'); + // $this->addSql('ALTER TABLE chill_person_household DROP CONSTRAINT fk_household_comment_embeddable_user'); + // $this->addSql('DROP INDEX IDX_BE50A270116F5FA9'); + // $this->addSql('DROP INDEX household_members_not_overlaps'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER startdate TYPE DATE'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER startdate DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER enddate TYPE DATE'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER enddate DROP DEFAULT'); + // $this->addSql('COMMENT ON COLUMN chill_person_household_members.startDate IS \'(DC2Type:date_immutable)\''); + // $this->addSql('COMMENT ON COLUMN chill_person_household_members.endDate IS \'(DC2Type:date_immutable)\''); + // $this->addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(7)'); + // $this->addSql('COMMENT ON COLUMN chill_person_marital_status.name IS \'(DC2Type:json_array)\''); + // $this->addSql('DROP INDEX mobilenumber_trgm_idx'); + // $this->addSql('DROP INDEX fullnamecanonical_trgm_idx'); + // $this->addSql('DROP INDEX phonenumber_trgm_idx'); + // $this->addSql('ALTER TABLE chill_person_person DROP cfdata_old'); + // $this->addSql('ALTER TABLE chill_person_person ALTER maritalstatus_id TYPE VARCHAR(7)'); + // $this->addSql('ALTER TABLE chill_person_person ALTER cfdata SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN chill_person_person.cFData IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER INDEX idx_3370d4403818da5 RENAME TO IDX_BF210A143818DA5'); + // $this->addSql('ALTER INDEX idx_3370d4401c9da55 RENAME TO IDX_BF210A141C9DA55'); + // $this->addSql('ALTER INDEX idx_bf210a145521be40 RENAME TO IDX_BF210A14D7D03CE3'); + // $this->addSql('ALTER INDEX idx_person_center RENAME TO IDX_BF210A145932F377'); + // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT FK_7201106F217BBB47'); + // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT FK_7201106F82F1BAF4'); + // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT FK_7201106F217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT FK_7201106F82F1BAF4 FOREIGN KEY (language_id) REFERENCES language (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + // $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER notificationdelay SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN country.name IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER TABLE custom_field_long_choice_options ALTER internal_key DROP DEFAULT'); + // $this->addSql('COMMENT ON COLUMN custom_field_long_choice_options.text IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER TABLE customfield ALTER required DROP DEFAULT'); + // $this->addSql('ALTER TABLE customfield ALTER required SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN customfield.name IS \'(DC2Type:json_array)\''); + // $this->addSql('COMMENT ON COLUMN customfield.options IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER INDEX idx_40fb5d6dfec418b RENAME TO IDX_7A6FDBEFEC418B'); + // $this->addSql('ALTER INDEX idx_286dc95df53b66 RENAME TO IDX_7A48DF7F5DF53B66'); + // $this->addSql('ALTER TABLE customfieldsgroup ALTER options DROP DEFAULT'); + // $this->addSql('ALTER TABLE customfieldsgroup ALTER options SET NOT NULL'); + // $this->addSql('COMMENT ON COLUMN customfieldsgroup.name IS \'(DC2Type:json_array)\''); + // $this->addSql('COMMENT ON COLUMN customfieldsgroup.options IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER INDEX idx_a14d8f3d447bbb3b RENAME TO IDX_A14D8F3D96DF1F10'); + // $this->addSql('COMMENT ON COLUMN language.name IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER TABLE permission_groups ALTER flags DROP DEFAULT'); + // $this->addSql('COMMENT ON COLUMN scopes.name IS \'(DC2Type:json_array)\''); + // $this->addSql('ALTER INDEX chill_3party.idx_c65d4397c7d3a8e6 RENAME TO IDX_14DC4475C7D3A8E6'); + // $this->addSql('ALTER INDEX chill_3party.idx_c65d43975932f377 RENAME TO IDX_14DC44755932F377'); + // $this->addSql('ALTER TABLE users ALTER usernamecanonical SET NOT NULL'); + // $this->addSql('DROP INDEX uniq_93f763ae217bbb47'); + // $this->addSql('ALTER TABLE chill_vendee.vendeeperson_entourage ADD CONSTRAINT FK_4D319FFEF57537C3 FOREIGN KEY (vendeeperson_id) REFERENCES chill_vendee.vendee_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + // $this->addSql('ALTER INDEX chill_vendee.idx_1a4b602deef79338 RENAME TO IDX_DD0A4C00EEF79338'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity DROP CONSTRAINT FK_A866DA0EC54C8C93'); + $this->addSql('DROP SEQUENCE chill_asideactivity.AsideActivity_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_asideactivity.AsideActivityCategory_id_seq CASCADE'); + $this->addSql('CREATE SEQUENCE asideactivity_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE asideactivitytype_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE asideactivitytype (id INT NOT NULL, title VARCHAR(255) NOT NULL, isactive BOOLEAN NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE asideactivity (id INT NOT NULL, type_id INT NOT NULL, agent_id INT NOT NULL, createdby_id INT NOT NULL, updatedby_id INT DEFAULT NULL, createdat TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updatedat TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, duration TIME(0) WITHOUT TIME ZONE DEFAULT NULL, location VARCHAR(100) DEFAULT NULL, note TEXT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX idx_e9fa21913174800f ON asideactivity (createdby_id)'); + $this->addSql('CREATE INDEX idx_e9fa2191c54c8c93 ON asideactivity (type_id)'); + $this->addSql('CREATE INDEX idx_e9fa219165ff1aec ON asideactivity (updatedby_id)'); + $this->addSql('CREATE INDEX idx_e9fa21913414710b ON asideactivity (agent_id)'); + $this->addSql('COMMENT ON COLUMN asideactivity.updatedat IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE chill_main_address_legacy (id INT DEFAULT NULL, postcode_id INT DEFAULT NULL, street VARCHAR(255) DEFAULT NULL, streetnumber VARCHAR(255) DEFAULT NULL, validfrom DATE DEFAULT NULL, isnoaddress BOOLEAN DEFAULT NULL, customs JSONB DEFAULT NULL, floor VARCHAR(16) DEFAULT NULL, corridor VARCHAR(16) DEFAULT NULL, steps VARCHAR(16) DEFAULT NULL, buildingname VARCHAR(255) DEFAULT NULL, flat VARCHAR(16) DEFAULT NULL, distribution VARCHAR(255) DEFAULT NULL, extra VARCHAR(255) DEFAULT NULL, validto DATE DEFAULT NULL, point VARCHAR(255) DEFAULT NULL, linkedtothirdparty_id INT DEFAULT NULL)'); + $this->addSql('ALTER TABLE asideactivity ADD CONSTRAINT fk_e9fa2191c54c8c93 FOREIGN KEY (type_id) REFERENCES asideactivitytype (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE asideactivity ADD CONSTRAINT fk_e9fa21913174800f FOREIGN KEY (createdby_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE asideactivity ADD CONSTRAINT fk_e9fa219165ff1aec FOREIGN KEY (updatedby_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE asideactivity ADD CONSTRAINT fk_e9fa21913414710b FOREIGN KEY (agent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('DROP TABLE chill_asideactivity.AsideActivity'); + $this->addSql('DROP TABLE chill_asideactivity.AsideActivityCategory'); + // $this->addSql('COMMENT ON COLUMN scopes.name IS NULL'); + // $this->addSql('ALTER INDEX idx_7a48df7f5df53b66 RENAME TO idx_286dc95df53b66'); + // $this->addSql('COMMENT ON COLUMN country.name IS NULL'); + // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT fk_7201106f217bbb47'); + // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT fk_7201106f82f1baf4'); + // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT fk_7201106f217bbb47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT fk_7201106f82f1baf4 FOREIGN KEY (language_id) REFERENCES language (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + // $this->addSql('COMMENT ON COLUMN language.name IS NULL'); + // $this->addSql('ALTER TABLE customfieldsgroup ALTER options SET DEFAULT \'{}\''); + // $this->addSql('ALTER TABLE customfieldsgroup ALTER options DROP NOT NULL'); + // $this->addSql('COMMENT ON COLUMN customfieldsgroup.name IS NULL'); + // $this->addSql('COMMENT ON COLUMN customfieldsgroup.options IS NULL'); + // $this->addSql('ALTER TABLE activityreasoncategory ALTER name DROP NOT NULL'); + // $this->addSql('COMMENT ON COLUMN activityreasoncategory.name IS NULL'); + // $this->addSql('ALTER TABLE activityreason ALTER name DROP NOT NULL'); + // $this->addSql('COMMENT ON COLUMN activityreason.name IS NULL'); + // $this->addSql('ALTER INDEX idx_af82522312469de2 RENAME TO idx_654a2fcd12469de2'); + // $this->addSql('ALTER INDEX idx_a14d8f3d96df1f10 RENAME TO idx_a14d8f3d447bbb3b'); + // $this->addSql('ALTER TABLE customfield ALTER required SET DEFAULT \'false\''); + // $this->addSql('ALTER TABLE customfield ALTER required DROP NOT NULL'); + // $this->addSql('COMMENT ON COLUMN customfield.options IS NULL'); + // $this->addSql('COMMENT ON COLUMN customfield.name IS NULL'); + // $this->addSql('ALTER INDEX idx_7a6fdbefec418b RENAME TO idx_40fb5d6dfec418b'); + // $this->addSql('ALTER TABLE custom_field_long_choice_options ALTER internal_key SET DEFAULT \'\''); + // $this->addSql('COMMENT ON COLUMN custom_field_long_choice_options.text IS NULL'); + // $this->addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(10)'); + // $this->addSql('COMMENT ON COLUMN chill_person_marital_status.name IS NULL'); + // $this->addSql('ALTER TABLE permission_groups ALTER flags SET DEFAULT \'[]\''); + // $this->addSql('ALTER INDEX chill_3party.idx_14dc4475c7d3a8e6 RENAME TO idx_c65d4397c7d3a8e6'); + // $this->addSql('ALTER INDEX chill_3party.idx_14dc44755932f377 RENAME TO idx_c65d43975932f377'); + // $this->addSql('ALTER TABLE users ALTER usernameCanonical DROP NOT NULL'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive ALTER ordering SET DEFAULT \'0\''); + // $this->addSql('ALTER INDEX idx_72d110e8727aca70 RENAME TO idx_92351ece727aca70'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ALTER startDate SET DEFAULT \'1970-01-01\''); + // $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER notificationDelay DROP NOT NULL'); + // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point TYPE VARCHAR(255)'); + // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_main_address ADD customs JSONB DEFAULT \'[]\''); + // $this->addSql('ALTER TABLE chill_main_address ALTER isNoAddress SET DEFAULT \'false\''); + // $this->addSql('ALTER TABLE chill_main_address ALTER point TYPE VARCHAR(255)'); + // $this->addSql('ALTER TABLE chill_main_address ALTER point DROP DEFAULT'); + // $this->addSql('ALTER INDEX idx_e260a868504cb38d RENAME TO idx_64a4a621504cb38d'); + // $this->addSql('ALTER INDEX idx_ac74095aa76ed395 RENAME TO idx_55026b0ca76ed395'); + // $this->addSql('ALTER INDEX idx_ac74095a682b5931 RENAME TO idx_55026b0c682b5931'); + // $this->addSql('ALTER INDEX idx_ac74095a217bbb47 RENAME TO idx_55026b0c217bbb47'); + // $this->addSql('ALTER INDEX idx_ac74095ac54c8c93 RENAME TO idx_55026b0cc54c8c93'); + // $this->addSql('ALTER INDEX idx_ac74095ad7fa8ef0 RENAME TO IDX_AC74095A550B0C53'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER startDate TYPE DATE'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER startDate DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER endDate TYPE DATE'); + // $this->addSql('ALTER TABLE chill_person_household_members ALTER endDate DROP DEFAULT'); + // $this->addSql('COMMENT ON COLUMN chill_person_household_members.startdate IS NULL'); + // $this->addSql('COMMENT ON COLUMN chill_person_household_members.enddate IS NULL'); + // $this->addSql('CREATE INDEX household_members_not_overlaps ON chill_person_household_members (person_id) WHERE (sharedhousehold IS TRUE)'); + // $this->addSql('ALTER TABLE activitytype ALTER category_id SET DEFAULT 1'); + // $this->addSql('ALTER TABLE chill_person_household ADD CONSTRAINT fk_household_comment_embeddable_user FOREIGN KEY (comment_members_userid) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + // $this->addSql('CREATE INDEX IDX_BE50A270116F5FA9 ON chill_person_household (comment_members_userid)'); + // $this->addSql('DROP INDEX search_name_code'); + // $this->addSql('ALTER TABLE chill_person_person ADD cfdata_old TEXT DEFAULT NULL'); + // $this->addSql('ALTER TABLE chill_person_person ALTER cFData DROP NOT NULL'); + // $this->addSql('ALTER TABLE chill_person_person ALTER maritalStatus_id TYPE VARCHAR(10)'); + // $this->addSql('COMMENT ON COLUMN chill_person_person.cfdata_old IS \'(DC2Type:array)\''); + // $this->addSql('COMMENT ON COLUMN chill_person_person.cfdata IS NULL'); + // $this->addSql('CREATE INDEX mobilenumber_trgm_idx ON chill_person_person (mobilenumber)'); + // $this->addSql('CREATE INDEX fullnamecanonical_trgm_idx ON chill_person_person (fullnamecanonical)'); + // $this->addSql('CREATE INDEX phonenumber_trgm_idx ON chill_person_person (phonenumber)'); + // $this->addSql('ALTER INDEX idx_bf210a141c9da55 RENAME TO idx_3370d4401c9da55'); + // $this->addSql('ALTER INDEX idx_bf210a143818da5 RENAME TO idx_3370d4403818da5'); + // $this->addSql('ALTER INDEX idx_bf210a145932f377 RENAME TO idx_person_center'); + // $this->addSql('ALTER INDEX idx_bf210a14d7d03ce3 RENAME TO IDX_BF210A145521BE40'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP CONSTRAINT FK_B694FB365FF1AEC'); + // $this->addSql('DROP INDEX IDX_B694FB365FF1AEC'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startDate TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startDate DROP DEFAULT'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER endDate TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); + // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER endDate DROP DEFAULT'); + // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.startdate IS \'(DC2Type:datetime_immutable)\''); + // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.enddate IS \'(DC2Type:datetime_immutable)\''); + // $this->addSql('CREATE UNIQUE INDEX uniq_93f763ae217bbb47 ON chill_vendee.vendee_person (person_id)'); + // $this->addSql('ALTER TABLE chill_vendee.vendeeperson_entourage DROP CONSTRAINT FK_4D319FFEF57537C3'); + // $this->addSql('ALTER INDEX chill_vendee.idx_dd0a4c00eef79338 RENAME TO idx_1a4b602deef79338'); + } +} From eec913375e14ad549d5dbb7039213c5148dbd64c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 4 Aug 2021 15:12:44 +0200 Subject: [PATCH 34/58] obsolete annotation deleted @packages --- .../src/Controller/AsideActivityCategoryController.php | 2 -- .../src/Controller/AsideActivityController.php | 3 --- 2 files changed, 5 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php index 60007b179..37f10c343 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php @@ -7,8 +7,6 @@ use Chill\MainBundle\CRUD\Controller\CRUDController; /** * Class AsideActivityBundle - * - * @package Chill\AsideActivityBundle\Controller */ class AsideActivityCategoryController extends CRUDController { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php index 1ba9212c2..55af4a6ab 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php @@ -7,10 +7,7 @@ use Chill\MainBundle\CRUD\Controller\CRUDController; /** * Class AsideActivityBundle - * - * @package Chill\AsideActivityBundle\Controller */ - class AsideActivityController extends CRUDController { From 61d8e06975d7a10cfe2dcc443683a70dc0546658 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 4 Aug 2021 15:13:45 +0200 Subject: [PATCH 35/58] typehints fixed --- .../ChillAsideActivityBundle/src/Entity/AsideActivity.php | 2 ++ .../src/Entity/AsideActivityCategory.php | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index 9adad4b83..8c4d3777b 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -1,5 +1,7 @@ id; } - public function getTitle(): ?string + public function getTitle(): ?array { return $this->title; } - public function setTitle(string $title): self + public function setTitle(array $title): self { $this->title = $title; From 3d630eeedfafa7e7e780807ec030416fe2ab4aaa Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 4 Aug 2021 15:19:43 +0200 Subject: [PATCH 36/58] PaginatorFactory error fixed provisionary. This should probably be done with dependency injection throughout the whole file though, to be checked --- src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php index ca28b1d14..18d37c99c 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php @@ -1137,11 +1137,12 @@ class CRUDController extends AbstractController } /** + * @todo (check how to do this with dependency injection and make changes...) * @return PaginatorFactory */ protected function getPaginatorFactory(): PaginatorFactory { - return $this->container->get(PaginatorFactory::class); + return $this->container->get('chill_main.paginator_factory'); } /** From 4716ab3e3c08b920db96089ad6b99141352e51e0 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 4 Aug 2021 15:20:21 +0200 Subject: [PATCH 37/58] twig template adapted to use with asideActivityCategory --- .../Resources/views/asideActivityCategory/index.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig index 3e0a4f404..c932eb594 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivityCategory/index.html.twig @@ -14,9 +14,9 @@ {% for entity in entities %} - {{ entity.name|localize_translatable_string }} + {{ entity.title|localize_translatable_string }} - {%- if entity.active -%} + {%- if entity.isActive -%} {%- else -%} @@ -25,7 +25,7 @@
  • - +
From 51f4d2ab0eb51a370b1c672e482c150f0287ffdf Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 4 Aug 2021 15:21:08 +0200 Subject: [PATCH 38/58] changed TextType to TranslatableStringFormType --- .../src/Form/AsideActivityCategoryType.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php index 36c818b4c..16657e18e 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php @@ -2,16 +2,18 @@ namespace Chill\AsideActivityBundle\Form; +use Chill\AsideActivityBundle\Entity\AsideActivityCategory; +use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; -use Symfony\Component\Form\Extension\Core\Type\TextType; + use Symfony\Component\Form\FormBuilderInterface; class AsideActivityCategoryType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { - $builder->add('title', TextType::class, + $builder->add('title', TranslatableStringFormType::class, [ 'label' => 'Nom', ]) From 7a56ff7d290f4f3d706d1d24f96b7ab550f5602e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 4 Aug 2021 16:30:27 +0200 Subject: [PATCH 39/58] translations yaml file created --- .../src/translations/messages.fr.yml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml diff --git a/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml new file mode 100644 index 000000000..521b33d74 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml @@ -0,0 +1,30 @@ +# Crud +crud: + aside_activity: + title_new: Nouveau type d'activité + title_edit: Edition d'un type d'activité + aside_activity_category: + title_new: Nouvelle catégorie de type d'activité + title_edit: Edition d'une catégorie de type d'activité + +#forms +Activity creation: Nouvelle activité +Create: Créer +Back to the list: Retour à la liste +Save activity: Sauver l'activité +Reset form: Remise à zéro du formulaire +Choose the agent for whom this activity is created: Choissisez l'agent pour qui l'activitée est creeé. +Choose the duration: Choisir la durée +Choose a category: Choisir un categorie +5 minutes: 5 minutes +10 minutes: 10 minutes +15 minutes: 15 minutes +20 minutes: 20 minutes +25 minutes: 25 minutes +30 minutes: 30 minutes +45 minutes: 45 minutes +1 hour: 1 heure +1 hour 15: 1 heure 15 +1 hour 30: 1 heure 30 +1 hour 45: 1 heure 45 +2 hours: 2 heures \ No newline at end of file From 72b43e9a9999670d1a0ae5446b942990c7de8cfe Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 4 Aug 2021 16:32:06 +0200 Subject: [PATCH 40/58] form type created to handle selection of asideactivity categories, not yet operational --- .../TranslatableAsideActivityCategory.php | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Form/Type/TranslatableAsideActivityCategory.php diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/Type/TranslatableAsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/TranslatableAsideActivityCategory.php new file mode 100644 index 000000000..7340afd80 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/TranslatableAsideActivityCategory.php @@ -0,0 +1,54 @@ +requestStack = $requestStack; + } + + public function getBlockPrefix() + { + return 'translatable_aside_activity_category'; + } + + public function getParent() + { + return EntityType::class; + } + + public function configureOptions(OptionsResolver $resolver) + { + $locale = $this->requestStack->getCurrentRequest()->getLocale(); + $resolver->setDefaults( + array( + 'class' => 'ChillAsideActivityBundle:AsideActivityCategory', + 'choice_label' => 'name['.$locale.']', + 'query_builder' => function (EntityRepository $er) { + return $er->createQueryBuilder('c') + ->where('c.active = true'); + } + ) + ); + } +} \ No newline at end of file From 0072f4c6766e7612fddce3b851742c94ca9ee80c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 4 Aug 2021 16:34:13 +0200 Subject: [PATCH 41/58] start of two new fields to select category and duration, but not working... problem with construct method in form --- .../src/Entity/AsideActivity.php | 2 +- .../src/Form/AsideActivityFormType.php | 26 ++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index 8c4d3777b..816dd88a0 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -52,7 +52,7 @@ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterfac /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) - * @Assert\NotBlank(message="Vous devez choisir un agent") + * @Assert\NotBlank() */ private $agent; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index db735eac3..1cd299576 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -4,6 +4,7 @@ namespace Chill\AsideActivityBundle\Form; use Chill\AsideActivityBundle\Entity\AsideActivity; use Chill\AsideActivityBundle\Entity\AsideActivityCategory; +use Chill\AsideActivityBundle\Form\Type\TranslatableAsideActivityCategory; use Chill\MainBundle\Entity\User; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; @@ -14,17 +15,31 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType; class AsideActivityFormType extends AbstractType { + protected array $timeChoices; + + public function __construct (array $timeChoices){ + $this->timeChoices = $timeChoices; + } + public function buildForm(FormBuilderInterface $builder, array $options) { + $timeChoices = []; + $durationTimeOptions = [ + 'choices' => $timeChoices, + 'placeholder' => 'Choose the duration', + ]; + $builder ->add('agent', EntityType::class, [ 'label' => 'Agent', 'required' => true, 'class' => User::class, - 'placeholder' => 'Choissisez l\'agent pour qui l\'activité est créée', + //translate + 'placeholder' => 'Choose the agent for whom this activity is created', 'choice_label' => 'username' ]) + // ->add('category', TranslatableAsideActivityCategory::class) // ->add('type', EntityType::class, // [ // 'label' => 'Type', @@ -33,11 +48,11 @@ class AsideActivityFormType extends AbstractType // 'placeholder' => 'Choissisez le type d\'activité', // 'choice_label' => 'title' // ]) + ->add('durationTime', ChoiceType::class, $durationTimeOptions) ->add('note', TextareaType::class, [ 'label' => 'Note', 'required' => false, - ]) -; + ]); } public function configureOptions(OptionsResolver $resolver): void @@ -46,4 +61,9 @@ class AsideActivityFormType extends AbstractType 'data_class' => AsideActivity::class, ]); } + + public function getBlockPrefix(): string + { + return 'chill_activitybundle_activity'; + } } \ No newline at end of file From d948ba0cd53cd2cbaac4317f387abe8895f31a3c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 4 Aug 2021 17:46:20 +0200 Subject: [PATCH 42/58] form.yaml created in attempt to fix translatableasideactivitycategory form type --- .../ChillAsideActivityBundle/src/config/services/form.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml diff --git a/src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml b/src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml new file mode 100644 index 000000000..928484735 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml @@ -0,0 +1,7 @@ +services: + chill.asideactivity.form.type.translatableasideactivitycategory: + class: Chill\AsideActivityBundle\Form\Type\TranslatableAsideActivityCategory + arguments: + - "@request_stack" + tags: + - { name: form.type, alias: translatable_asideactivity_category } \ No newline at end of file From d67b99b269a9f7bc401cd570101869fd211d84b0 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 6 Aug 2021 11:26:37 +0200 Subject: [PATCH 43/58] class changed into final class --- .../src/Form/AsideActivityCategoryType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php index 16657e18e..1bfc6ed37 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php @@ -9,7 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormBuilderInterface; -class AsideActivityCategoryType extends AbstractType +final class AsideActivityCategoryType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { From 8649d49d982f8b7c4d55ddef232a94080dc8261a Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 6 Aug 2021 11:27:31 +0200 Subject: [PATCH 44/58] date field added and activity type field. Form listed as service in services.yaml asideactivity form added as service to inject necessary arguments --- .../src/Form/AsideActivityFormType.php | 63 ++++++++++++------- .../src/config/services.yaml | 9 +++ 2 files changed, 51 insertions(+), 21 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index 1cd299576..fadfffce9 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -4,8 +4,9 @@ namespace Chill\AsideActivityBundle\Form; use Chill\AsideActivityBundle\Entity\AsideActivity; use Chill\AsideActivityBundle\Entity\AsideActivityCategory; -use Chill\AsideActivityBundle\Form\Type\TranslatableAsideActivityCategory; use Chill\MainBundle\Entity\User; +use Chill\MainBundle\Form\Type\ChillDateType; +use Chill\MainBundle\Templating\TranslatableStringHelper; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; @@ -13,21 +14,28 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\Extension\Core\Type\TextareaType; -class AsideActivityFormType extends AbstractType +final class AsideActivityFormType extends AbstractType { - protected array $timeChoices; + // protected array $timeChoices; + private TranslatableStringHelper $translatableStringHelper; - public function __construct (array $timeChoices){ - $this->timeChoices = $timeChoices; + public function __construct (TranslatableStringHelper $translatableStringHelper){ + // $this->timeChoices = $timeChoices; + $this->translatableStringHelper = $translatableStringHelper; } public function buildForm(FormBuilderInterface $builder, array $options) { - $timeChoices = []; - $durationTimeOptions = [ - 'choices' => $timeChoices, - 'placeholder' => 'Choose the duration', - ]; + // $timeChoices = []; + + // foreach ($this->timeChoices as $e) { + // $timeChoices[$e['label']] = $e['seconds']; + // } + + // $durationTimeOptions = [ + // 'choices' => $timeChoices, + // 'placeholder' => 'Choose the duration', + // ]; $builder ->add('agent', EntityType::class, @@ -39,16 +47,29 @@ class AsideActivityFormType extends AbstractType 'placeholder' => 'Choose the agent for whom this activity is created', 'choice_label' => 'username' ]) - // ->add('category', TranslatableAsideActivityCategory::class) - // ->add('type', EntityType::class, - // [ - // 'label' => 'Type', - // 'required' => true, - // 'class' => AsideActivityCategory::class, - // 'placeholder' => 'Choissisez le type d\'activité', - // 'choice_label' => 'title' - // ]) - ->add('durationTime', ChoiceType::class, $durationTimeOptions) + ->add('date', ChillDateType::class, + [ + 'label' => 'date', + 'data' => new \DateTime(), + //SETTING RANGE ONLY POSSIBLE WITH WIDGET 'CHOICE' AND NOT 'SINGLE_TEXT'? + // 'widget' => 'choice', + // 'years' => range(2020, date('Y')), + // 'months' => range(1, date('m')), + // 'days' => range(1, date('d')), + 'required' => true + ]) + ->add('type', EntityType::class, + [ + 'label' => 'Type', + 'required' => true, + 'class' => AsideActivityCategory::class, + 'placeholder' => 'Choose the activity category', + // 'choice_label' => 'title[""]' + 'choice_label' => function (AsideActivityCategory $asideActivityCategory) { + return $this->translatableStringHelper->localize($asideActivityCategory->getTitle()); + }, + ]) + // ->add('durationTime', ChoiceType::class, $durationTimeOptions) ->add('note', TextareaType::class, [ 'label' => 'Note', 'required' => false, @@ -64,6 +85,6 @@ class AsideActivityFormType extends AbstractType public function getBlockPrefix(): string { - return 'chill_activitybundle_activity'; + return 'chill_asideactivitybundle_asideactivity'; } } \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/config/services.yaml b/src/Bundle/ChillAsideActivityBundle/src/config/services.yaml index e69de29bb..fbf073f6d 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/config/services.yaml +++ b/src/Bundle/ChillAsideActivityBundle/src/config/services.yaml @@ -0,0 +1,9 @@ +services: + chill.asideactivity.form.type.asideactivity: + class: Chill\AsideActivityBundle\Form\AsideActivityFormType + arguments: + # - "@doctrine.orm.entity_manager" + - "@chill.main.helper.translatable_string" + # - "%chill_activity.form.time_duration%" + tags: + - { name: form.type, alias: chill_asideactivitybundle_asideactivity } \ No newline at end of file From 5d598bf46b26e206e83f323fee1bd9abab1ee01b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 6 Aug 2021 11:30:35 +0200 Subject: [PATCH 45/58] translations adjusted --- .../src/translations/messages.fr.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml index 521b33d74..d3f80c703 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml +++ b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml @@ -1,19 +1,20 @@ # Crud crud: aside_activity: - title_new: Nouveau type d'activité + title_new: Nouveau activité annexe title_edit: Edition d'un type d'activité aside_activity_category: - title_new: Nouvelle catégorie de type d'activité + title_new: Nouvelle catégorie d'activité annexe title_edit: Edition d'une catégorie de type d'activité #forms -Activity creation: Nouvelle activité +Activity creation: Nouvelle activité annexe Create: Créer Back to the list: Retour à la liste Save activity: Sauver l'activité Reset form: Remise à zéro du formulaire Choose the agent for whom this activity is created: Choissisez l'agent pour qui l'activitée est creeé. +Choose the activity category: Choissisez le type d'activité Choose the duration: Choisir la durée Choose a category: Choisir un categorie 5 minutes: 5 minutes From 9ee140a7d89721d974a1615cdc6054ab329d660d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 6 Aug 2021 11:52:01 +0200 Subject: [PATCH 46/58] loading of asideactivityform service moved to form.yaml --- .../ChillAsideActivityExtension.php | 3 ++- .../src/config/services.yaml | 17 ++++++++--------- .../src/config/services/form.yaml | 9 +++++---- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php index fb24d5d46..523c04495 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php @@ -25,7 +25,8 @@ final class ChillAsideActivityExtension extends Extension implements PrependExte public function load(array $configs, ContainerBuilder $container): void { $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config')); - $loader->load('services.yaml'); + // $loader->load('services.yaml'); + $loader->load('services/form.yaml'); } public function prepend(ContainerBuilder $container) diff --git a/src/Bundle/ChillAsideActivityBundle/src/config/services.yaml b/src/Bundle/ChillAsideActivityBundle/src/config/services.yaml index fbf073f6d..727efaa38 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/config/services.yaml +++ b/src/Bundle/ChillAsideActivityBundle/src/config/services.yaml @@ -1,9 +1,8 @@ -services: - chill.asideactivity.form.type.asideactivity: - class: Chill\AsideActivityBundle\Form\AsideActivityFormType - arguments: - # - "@doctrine.orm.entity_manager" - - "@chill.main.helper.translatable_string" - # - "%chill_activity.form.time_duration%" - tags: - - { name: form.type, alias: chill_asideactivitybundle_asideactivity } \ No newline at end of file +# services: +# chill.asideactivity.form.type.asideactivity: +# class: Chill\AsideActivityBundle\Form\AsideActivityFormType +# arguments: +# - "@chill.main.helper.translatable_string" +# # - "%chill_activity.form.time_duration%" +# tags: +# - { name: form.type, alias: chill_asideactivitybundle_asideactivity } \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml b/src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml index 928484735..52228fdcb 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml +++ b/src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml @@ -1,7 +1,8 @@ services: - chill.asideactivity.form.type.translatableasideactivitycategory: - class: Chill\AsideActivityBundle\Form\Type\TranslatableAsideActivityCategory + chill.asideactivity.form.type.asideactivity: + class: Chill\AsideActivityBundle\Form\AsideActivityFormType arguments: - - "@request_stack" + - "@chill.main.helper.translatable_string" + # - "%chill_activity.form.time_duration%" tags: - - { name: form.type, alias: translatable_asideactivity_category } \ No newline at end of file + - { name: form.type, alias: chill_asideactivitybundle_asideactivity } \ No newline at end of file From b74f9cf5dc43ca2db55d40bbbaa483a16c8c56c1 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 6 Aug 2021 17:35:46 +0200 Subject: [PATCH 47/58] getting all the asideActivity form to work with all fields. Still bug with DateTimeImmutable value somehwere --- .../src/Entity/AsideActivity.php | 22 +++--- .../src/Form/AsideActivityFormType.php | 76 +++++++++++++++---- .../TranslatableAsideActivityCategory.php | 54 ------------- .../src/config/services/form.yaml | 3 +- .../src/translations/messages.yaml | 0 5 files changed, 74 insertions(+), 81 deletions(-) delete mode 100644 src/Bundle/ChillAsideActivityBundle/src/Form/Type/TranslatableAsideActivityCategory.php delete mode 100644 src/Bundle/ChillAsideActivityBundle/src/translations/messages.yaml diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index 816dd88a0..0da691ff2 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -32,39 +32,39 @@ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterfac * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) */ - private $createdBy; + private \Chill\MainBundle\Entity\User $createdBy; /** * @ORM\Column(type="datetime_immutable") */ - private $createdAt; + private \DateTimeInterface $createdAt; /** * @ORM\ManyToOne(targetEntity=User::class) */ - private $updatedBy; + private \Chill\MainBundle\Entity\User $updatedBy; /** * @ORM\Column(type="datetime_immutable", nullable=true) */ - private $updatedAt; + private \DateTimeInterface $updatedAt; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) * @Assert\NotBlank() */ - private $agent; + private \Chill\MainBundle\Entity\User $agent; /** * @ORM\Column(type="datetime_immutable") */ - private $date; + private \DateTimeInterface $date; /** - * @ORM\Column(type="integer", nullable=true) + * @ORM\Column(type="time", nullable=true) */ - private $duration; + private ?\DateTime $duration = null; /** * @ORM\Column(type="string", length=100, nullable=true) @@ -129,7 +129,7 @@ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterfac return $this; } - public function getUpdatedAt(): ?\DateTimeImmutable + public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } @@ -165,12 +165,12 @@ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterfac return $this; } - public function getDuration(): ?\DateTimeInterface + public function getDuration(): ?\DateTime { return $this->duration; } - public function setDuration(?\DateTimeInterface $duration): self + public function setDuration(?\DateTime $duration): self { $this->duration = $duration; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index fadfffce9..b34e5bdf9 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -6,36 +6,41 @@ use Chill\AsideActivityBundle\Entity\AsideActivity; use Chill\AsideActivityBundle\Entity\AsideActivityCategory; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Form\Type\ChillDateType; +use Chill\MainBundle\Form\Type\ChillTextareaType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\Extension\Core\Type\TextareaType; - +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\FormEvents; final class AsideActivityFormType extends AbstractType { - // protected array $timeChoices; + protected array $timeChoices; private TranslatableStringHelper $translatableStringHelper; - public function __construct (TranslatableStringHelper $translatableStringHelper){ - // $this->timeChoices = $timeChoices; + public function __construct (TranslatableStringHelper $translatableStringHelper, array $timeChoices){ + $this->timeChoices = $timeChoices; $this->translatableStringHelper = $translatableStringHelper; } public function buildForm(FormBuilderInterface $builder, array $options) { - // $timeChoices = []; + $timeChoices = []; - // foreach ($this->timeChoices as $e) { - // $timeChoices[$e['label']] = $e['seconds']; - // } + foreach ($this->timeChoices as $e) { + $timeChoices[$e['label']] = $e['seconds']; + } - // $durationTimeOptions = [ - // 'choices' => $timeChoices, - // 'placeholder' => 'Choose the duration', - // ]; + $durationTimeTransformer = new DateTimeToTimestampTransformer('GMT', 'GMT'); + $durationTimeOptions = [ + 'choices' => $timeChoices, + 'placeholder' => 'Choose the duration', + ]; $builder ->add('agent', EntityType::class, @@ -50,7 +55,7 @@ final class AsideActivityFormType extends AbstractType ->add('date', ChillDateType::class, [ 'label' => 'date', - 'data' => new \DateTime(), + 'data' => new \DateTimeImmutable(), //SETTING RANGE ONLY POSSIBLE WITH WIDGET 'CHOICE' AND NOT 'SINGLE_TEXT'? // 'widget' => 'choice', // 'years' => range(2020, date('Y')), @@ -69,11 +74,52 @@ final class AsideActivityFormType extends AbstractType return $this->translatableStringHelper->localize($asideActivityCategory->getTitle()); }, ]) - // ->add('durationTime', ChoiceType::class, $durationTimeOptions) - ->add('note', TextareaType::class, [ + ->add('duration', ChoiceType::class, $durationTimeOptions) + ->add('note', ChillTextareaType::class, [ 'label' => 'Note', 'required' => false, ]); + + foreach (['duration'] as $fieldName) + { + $builder->get($fieldName) + ->addModelTransformer($durationTimeTransformer); + + $builder->get($fieldName) + ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $formEvent) use ( + $timeChoices, + $builder, + $durationTimeTransformer, + $durationTimeOptions, + $fieldName + ) { + // set the timezone to GMT, and fix the difference between current and GMT + // the datetimetransformer will then handle timezone as GMT + $timezoneUTC = new \DateTimeZone('GMT'); + /* @var $data \DateTime */ + $data = $formEvent->getData() === NULL ? + \DateTime::createFromFormat('U', 300) : + $formEvent->getData(); + $seconds = $data->getTimezone()->getOffset($data); + $data->setTimeZone($timezoneUTC); + $data->add(new \DateInterval('PT'.$seconds.'S')); + + // test if the timestamp is in the choices. + // If not, recreate the field with the new timestamp + if (!in_array($data->getTimestamp(), $timeChoices)) { + // the data are not in the possible values. add them + $timeChoices[$data->format('H:i')] = $data->getTimestamp(); + $form = $builder->create($fieldName, ChoiceType::class, array_merge( + $durationTimeOptions, [ + 'choices' => $timeChoices, + 'auto_initialize' => false + ] + )); + $form->addModelTransformer($durationTimeTransformer); + $formEvent->getForm()->getParent()->add($form->getForm()); + } + }); + } } public function configureOptions(OptionsResolver $resolver): void diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/Type/TranslatableAsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/TranslatableAsideActivityCategory.php deleted file mode 100644 index 7340afd80..000000000 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/Type/TranslatableAsideActivityCategory.php +++ /dev/null @@ -1,54 +0,0 @@ -requestStack = $requestStack; - } - - public function getBlockPrefix() - { - return 'translatable_aside_activity_category'; - } - - public function getParent() - { - return EntityType::class; - } - - public function configureOptions(OptionsResolver $resolver) - { - $locale = $this->requestStack->getCurrentRequest()->getLocale(); - $resolver->setDefaults( - array( - 'class' => 'ChillAsideActivityBundle:AsideActivityCategory', - 'choice_label' => 'name['.$locale.']', - 'query_builder' => function (EntityRepository $er) { - return $er->createQueryBuilder('c') - ->where('c.active = true'); - } - ) - ); - } -} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml b/src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml index 52228fdcb..193c61ed0 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml +++ b/src/Bundle/ChillAsideActivityBundle/src/config/services/form.yaml @@ -1,8 +1,9 @@ +--- services: chill.asideactivity.form.type.asideactivity: class: Chill\AsideActivityBundle\Form\AsideActivityFormType arguments: - "@chill.main.helper.translatable_string" - # - "%chill_activity.form.time_duration%" + - "%chill_activity.form.time_duration%" tags: - { name: form.type, alias: chill_asideactivitybundle_asideactivity } \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/translations/messages.yaml b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.yaml deleted file mode 100644 index e69de29bb..000000000 From fb43980a2a87dd390354a1e4a09452c32453adac Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 10 Aug 2021 10:56:45 +0200 Subject: [PATCH 48/58] everything changed to datetime --- .../src/Entity/AsideActivity.php | 18 +++++++++--------- .../src/Entity/AsideActivityCategory.php | 2 +- .../src/Form/AsideActivityFormType.php | 5 +++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index 0da691ff2..fda40ea1a 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -35,9 +35,9 @@ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterfac private \Chill\MainBundle\Entity\User $createdBy; /** - * @ORM\Column(type="datetime_immutable") + * @ORM\Column(type="datetime") */ - private \DateTimeInterface $createdAt; + private $createdAt; /** * @ORM\ManyToOne(targetEntity=User::class) @@ -45,9 +45,9 @@ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterfac private \Chill\MainBundle\Entity\User $updatedBy; /** - * @ORM\Column(type="datetime_immutable", nullable=true) + * @ORM\Column(type="datetime", nullable=true) */ - private \DateTimeInterface $updatedAt; + private $updatedAt; /** * @ORM\ManyToOne(targetEntity=User::class) @@ -57,14 +57,14 @@ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterfac private \Chill\MainBundle\Entity\User $agent; /** - * @ORM\Column(type="datetime_immutable") + * @ORM\Column(type="datetime") */ - private \DateTimeInterface $date; + private $date; /** * @ORM\Column(type="time", nullable=true) */ - private ?\DateTime $duration = null; + private ?\DateTimeInterface $duration = null; /** * @ORM\Column(type="string", length=100, nullable=true) @@ -165,12 +165,12 @@ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterfac return $this; } - public function getDuration(): ?\DateTime + public function getDuration(): ?\DateTimeInterface { return $this->duration; } - public function setDuration(?\DateTime $duration): self + public function setDuration(?\DateTimeInterface $duration): self { $this->duration = $duration; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index ae22b4d7e..6c580394b 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM; * @ORM\Entity * @ORM\Table(schema="chill_asideactivity") */ -final class AsideActivityCategory +class AsideActivityCategory { /** * @ORM\Id diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index b34e5bdf9..0ee91a9fe 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -55,7 +55,7 @@ final class AsideActivityFormType extends AbstractType ->add('date', ChillDateType::class, [ 'label' => 'date', - 'data' => new \DateTimeImmutable(), + 'data' => new \DateTime(), //SETTING RANGE ONLY POSSIBLE WITH WIDGET 'CHOICE' AND NOT 'SINGLE_TEXT'? // 'widget' => 'choice', // 'years' => range(2020, date('Y')), @@ -96,13 +96,14 @@ final class AsideActivityFormType extends AbstractType // set the timezone to GMT, and fix the difference between current and GMT // the datetimetransformer will then handle timezone as GMT $timezoneUTC = new \DateTimeZone('GMT'); - /* @var $data \DateTime */ + /* @var $data \DateTimeImmutable */ $data = $formEvent->getData() === NULL ? \DateTime::createFromFormat('U', 300) : $formEvent->getData(); $seconds = $data->getTimezone()->getOffset($data); $data->setTimeZone($timezoneUTC); $data->add(new \DateInterval('PT'.$seconds.'S')); + dump($data); // test if the timestamp is in the choices. // If not, recreate the field with the new timestamp From a1ed0d3ce48b40256c572ef08ab5b06b2aa85073 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 10 Aug 2021 11:32:27 +0200 Subject: [PATCH 49/58] list.html.twig template added and adapted to display list of aside activities, still need to adapt to show only activities of logged in user --- .../ChillAsideActivityExtension.php | 2 +- .../views/asideActivity/index.html.twig | 4 +- .../views/asideActivity/list.html.twig | 79 +++++++++++++++++++ 3 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig diff --git a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php index 523c04495..69bde308e 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php @@ -80,7 +80,7 @@ final class ChillAsideActivityExtension extends Extension implements PrependExte 'controller' => \Chill\AsideActivityBundle\Controller\AsideActivityController::class, 'actions' => [ 'index' => [ - 'template' => '@ChillAsideActivity/asideActivity/index.html.twig', + 'template' => '@ChillAsideActivity/asideActivity/list.html.twig', 'role' => 'ROLE_USER' ], 'new' => [ diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig index 3e0a4f404..0ad5ea3ee 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig @@ -6,7 +6,7 @@ - + {# #} @@ -14,7 +14,7 @@ {% for entity in entities %} - + {# #}
{{ 'Name'|trans }}{{ 'Name'|trans }}{{ 'Active'|trans }} {{ 'Actions'|trans }}
{{ entity.name|localize_translatable_string }}{{ entity.name|localize_translatable_string }} {%- if entity.active -%} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig new file mode 100644 index 000000000..0b1810452 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig @@ -0,0 +1,79 @@ +{# {% set person_id = null %} +{% if person %} + {% set person_id = person.id %} +{% endif %} #} +{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} + +{% block admin_content %} +

{{ 'Activity list' |trans }}

+ +{% if entities|length == 0 %} +

+ {{ "There isn't any activities."|trans }} + +

+{% else %} + +
+ + {% for entity in entities %} + {% set t = entity.type %} +
+
+
+ + {% if entity.date %} +

{{ entity.date|format_date('long') }}

+ {% endif %} + +
+

+ + {{ entity.duration|date('H:i') }} +

+
+ +
+
+
    + {% if entity.createdBy %} +
  • + {{ 'by'|trans }}{{ entity.createdBy.usernameCanonical }} +
  • + {% endif %} + +
  • + {{ entity.type.title | localize_translatable_string }} +
  • + +
+
+
+ {% + if entity.note is not empty + or entity.createdBy|length > 0 + %} +
+ {% if entity.note is not empty %} +
+ {{ entity.note|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }} +
+ {% endif %} +
+ {% endif %} + +
+ {% endfor %} +
+{% endif %} + +{# TODO set this condition in configuration #} + + + {% endblock %} From bbb69bcfe050976e47e0b911930716dd2974d9e8 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 10 Aug 2021 14:18:37 +0200 Subject: [PATCH 50/58] list template adapted to display aside activities ordered by date (DESC) --- .../views/asideActivity/index.html.twig | 44 -------------- .../views/asideActivity/list.html.twig | 58 ++++++++++++++----- .../src/translations/messages.fr.yml | 7 ++- 3 files changed, 49 insertions(+), 60 deletions(-) delete mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig deleted file mode 100644 index 0ad5ea3ee..000000000 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig +++ /dev/null @@ -1,44 +0,0 @@ -{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} - -{% block admin_content %} -

{{ 'ActivityType list'|trans }}

- - - - - {# #} - - - - - - {% for entity in entities %} - - {# #} - - - - {% endfor %} - -
{{ 'Name'|trans }}{{ 'Active'|trans }}{{ 'Actions'|trans }}
{{ entity.name|localize_translatable_string }} - {%- if entity.active -%} - - {%- else -%} - - {%- endif -%} - -
    -
  • - -
  • -
-
- - - {% endblock %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig index 0b1810452..ad8e62d24 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig @@ -1,11 +1,7 @@ -{# {% set person_id = null %} -{% if person %} - {% set person_id = person.id %} -{% endif %} #} {% extends "@ChillActivity/Admin/layout_activity.html.twig" %} {% block admin_content %} -

{{ 'Activity list' |trans }}

+

{{ 'My aside activities' |trans }}

{% if entities|length == 0 %}

@@ -15,15 +11,23 @@ {% else %}

- - {% for entity in entities %} + {# Sort activities according to date in descending order #} + {% for entity in entities|sort ((a, b) => b.date <=> a.date) %} {% set t = entity.type %} + + {# only load aside activities of current user. #} + {% if entity.agent == app.user %} +
+

+ {{ entity.type.title | localize_translatable_string }} +

+ {% if entity.date %} -

{{ entity.date|format_date('long') }}

+

{{ entity.date|format_date('long') }}

{% endif %}
@@ -38,17 +42,13 @@
    {% if entity.createdBy %}
  • - {{ 'by'|trans }}{{ entity.createdBy.usernameCanonical }} + {{ 'Created by: '|trans }}{{ entity.createdBy.usernameCanonical }}
  • {% endif %} - -
  • - {{ entity.type.title | localize_translatable_string }} -
  • -
+ {% if entity.note is not empty or entity.createdBy|length > 0 @@ -59,14 +59,42 @@ {{ entity.note|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }}
{% endif %} +
{% endif %} - +
+
    +
      + {#
    • + +
    • #} + {# TOOD + {% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %} + #} +
    • + +
    • + {# TOOD + {% endif %} + {% if is_granted('CHILL_ACTIVITY_DELETE', activity) %} + #} + {#
    • + +
    • #} + {# + {% endif %} + #} +
    +
+
+ {% endif %} {% endfor %} {% endif %} + + {# TODO set this condition in configuration #}
  • diff --git a/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml index d3f80c703..3746f4dda 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml +++ b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml @@ -28,4 +28,9 @@ Choose a category: Choisir un categorie 1 hour 15: 1 heure 15 1 hour 30: 1 heure 30 1 hour 45: 1 heure 45 -2 hours: 2 heures \ No newline at end of file +2 hours: 2 heures + +#list +My aside activities: Mes activités annexes +Date: Date +Created by: Creér par From 4c7129a3b2a16119eb175cf8f944704476b57eb6 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 10 Aug 2021 14:19:01 +0200 Subject: [PATCH 51/58] aside activities added to user menu --- src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php index e29239679..8a1b4c10e 100644 --- a/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php @@ -114,6 +114,14 @@ class UserMenuBuilder implements LocalMenuBuilderInterface 'order' => -10, 'icon' => 'tasks' ]); + + $menu->addChild("My aside activities", [ + 'route' => 'chill_crud_aside_activity_index' + ]) + ->setExtras([ + 'order' => -10, + 'icon' => 'tasks' + ]); } protected function addItemInMenu(MenuItem $menu, User $u, $message, $title, $status, $number, $order) From fc6a9ad64f0b4529d596ee4de713a5cb86f90260 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 10 Aug 2021 14:23:07 +0200 Subject: [PATCH 52/58] migration files moved into bundle --- .../src/migrations/Version20210806140343.php | 31 ++++++++++++ .../src/migrations/Version20210806140710.php | 32 +++++++++++++ .../src/migrations/Version20210810084456.php | 48 +++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140343.php create mode 100644 src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140710.php create mode 100644 src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210810084456.php diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140343.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140343.php new file mode 100644 index 000000000..f05da8643 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140343.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE chill_asideactivity.asideactivity DROP duration'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD duration INT DEFAULT NULL'); + } +} diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140710.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140710.php new file mode 100644 index 000000000..e71cd50d2 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140710.php @@ -0,0 +1,32 @@ +addSql('ALTER TABLE chill_asideactivity.asideactivity ADD duration TIME(0) WITHOUT TIME ZONE DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity DROP duration'); + + } +} diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210810084456.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210810084456.php new file mode 100644 index 000000000..51e9c0571 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210810084456.php @@ -0,0 +1,48 @@ +addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER createdat TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); + $this->addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER createdat DROP DEFAULT'); + $this->addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER updatedat TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); + $this->addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER updatedat DROP DEFAULT'); + $this->addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER date TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); + $this->addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER date DROP DEFAULT'); + $this->addSql('COMMENT ON COLUMN chill_asideactivity.asideactivity.createdAt IS NULL'); + $this->addSql('COMMENT ON COLUMN chill_asideactivity.asideactivity.updatedAt IS NULL'); + $this->addSql('COMMENT ON COLUMN chill_asideactivity.asideactivity.date IS NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER createdAt TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER createdAt DROP DEFAULT'); + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER updatedAt TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER updatedAt DROP DEFAULT'); + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER date TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); + $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER date DROP DEFAULT'); + $this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.createdat IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.updatedat IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.date IS \'(DC2Type:datetime_immutable)\''); + + } +} From 7d97889cbf2ee3d1c607ba38af222dacdd0edf83 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 10 Aug 2021 15:45:00 +0200 Subject: [PATCH 53/58] templates changed to use the standard CRUD templates + delete template added --- .../ChillAsideActivityExtension.php | 8 ++++ .../views/asideActivity/_delete.html.twig | 37 +++++++++++++++++++ .../views/asideActivity/_index.html.twig | 0 .../views/asideActivity/delete.html.twig | 8 ++++ .../views/asideActivity/edit.html.twig | 15 ++++---- .../views/asideActivity/index.html.twig | 8 ++++ .../views/asideActivity/list.html.twig | 6 +-- .../views/asideActivity/new.html.twig | 14 +++---- .../views/asideActivity/view.html.twig | 16 ++++++++ 9 files changed, 95 insertions(+), 17 deletions(-) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_index.html.twig create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/delete.html.twig create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig diff --git a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php index 69bde308e..bbc4c8f8b 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php @@ -87,9 +87,17 @@ final class ChillAsideActivityExtension extends Extension implements PrependExte 'role' => 'ROLE_USER', 'template' => '@ChillAsideActivity/asideActivity/new.html.twig', ], + 'view' => [ + 'role' => 'ROLE_USER', + 'template' => '@ChillAsideActivity/asideActivity/view.html.twig', + ], 'edit' => [ 'role' => 'ROLE_USER', 'template' => '@ChillAsideActivity/asideActivity/edit.html.twig', + ], + 'delete' => [ + 'role' => 'ROLE_USER', + 'template' => '@ChillAsideActivity/asideActivity/delete.html.twig', ] ] ], diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig new file mode 100644 index 000000000..85df29a9c --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig @@ -0,0 +1,37 @@ +
    + {% block crud_content_header %} +

    {{ ('crud.'~crud_name~'.title_delete')|trans({ '%as_string%': entity|chill_entity_render_string }) }}

    + {% endblock crud_content_header %} + +

    {{ ('crud.'~crud_name~'.confirm_message_delete')|trans({ '%as_string%': entity|chill_entity_render_string }) }}

    + + {{ form_start(form) }} + +
      + {% block content_form_actions_back %} +
    • + + {{ 'Cancel'|trans }} + +
    • + {% endblock %} + {% block content_form_actions_before %}{% endblock %} + {% block content_form_actions_view %} + {% if is_granted(chill_crud_config('role', crud_name, 'view'), entity) %} +
    • + + {{ 'crud.edit.back_to_view'|trans }} + +
    • + {% endif %} + {% endblock %} + {% block content_form_actions_confirm_delete %} +
    • + +
    • + {% endblock content_form_actions_confirm_delete %} + {% block content_form_actions_after %}{% endblock %} +
    + + {{ form_end(form) }} +
    \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_index.html.twig new file mode 100644 index 000000000..e69de29bb diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/delete.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/delete.html.twig new file mode 100644 index 000000000..de2d28c90 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/delete.html.twig @@ -0,0 +1,8 @@ +{% extends '@ChillMain/layout.html.twig' %} + +{% block title %}{{ ('crud.' ~ crud_name ~ '.delete.title')|trans({'%crud_name%': crud_name}) }}{% endblock %} + +{% block content %} + {% embed '@ChillAsideActivity/AsideActivity/_delete.html.twig' %} + {% endembed %} +{% endblock content %} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/edit.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/edit.html.twig index dacee767c..b0b6fed0f 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/edit.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/edit.html.twig @@ -1,12 +1,13 @@ -{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} +{% extends '@ChillMain/Admin/layout.html.twig' %} {% block title %} - {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% include('@ChillMain/CRUD/_edit_title.html.twig') %} {% endblock %} -{% block layout_wvm_content %} - {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} - {% block content_form_actions_view %}{% endblock %} - {% block content_form_actions_save_and_show %}{% endblock %} - {% endembed %} +{% block admin_content %} +{# {% as we are in the admin layout, we override the admin content with the CRUD content %} #} +{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {# we do not have "view" page. We empty the corresponding block #} + {% block content_form_actions_view %}{% endblock %} +{% endembed %} {% endblock %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig new file mode 100644 index 000000000..0e8ea0506 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig @@ -0,0 +1,8 @@ +{% extends '@ChillMain/layout.html.twig' %} + +{% block title %}{{ ('crud.' ~ crud_name ~ '.index.title')|trans({'%crud_name%': crud_name}) }}{% endblock %} + +{% block content %} + {% embed '@ChillAsideActivity/AsideActivity/_index.html.twig' %} + {% endembed %} +{% endblock content %} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig index ad8e62d24..f474dcf1b 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig @@ -78,9 +78,9 @@ {% endif %} {% if is_granted('CHILL_ACTIVITY_DELETE', activity) %} #} - {#
  • - -
  • #} +
  • + +
  • {# {% endif %} #} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig index d7ac89752..0781272a1 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig @@ -1,11 +1,11 @@ -{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} +{% extends '@ChillMain/Admin/layout.html.twig' %} {% block title %} - {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% include('@ChillMain/CRUD/_new_title.html.twig') %} {% endblock %} -{% block layout_wvm_content %} - {% embed '@ChillMain/CRUD/_new_content.html.twig' %} - {% block content_form_actions_save_and_show %}{% endblock %} - {% endembed %} -{% endblock %} +{% block admin_content %} +{% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} +{% endembed %} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig new file mode 100644 index 000000000..5f1d2319a --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig @@ -0,0 +1,16 @@ +{% extends '@ChillPerson/Person/layout.html.twig' %} + +{% set person = entity.person %} +{% set activeRouteKey = '' %} + +{% block title %} +{% include('@ChillPerson/CRUD/_view_title.html.twig') %} +{% endblock %} + +{% block personcontent %} +{% embed '@ChillPerson/CRUD/_view_content.html.twig' %} + {% block crud_content_header %} +

    {{ ('crud.' ~ crud_name ~ '.title_view')|trans({'%person%': person|chill_entity_render_string }) }}

    + {% endblock crud_content_header %} +{% endembed %} +{% endblock %} \ No newline at end of file From 8829d234ec85751c8f6706214b1b3acc1574944d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 12 Aug 2021 11:50:11 +0200 Subject: [PATCH 54/58] adapt to show date of death. it adapts but does not show actual date of death yet --- .../Resources/views/Entity/person.html.twig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig index 1c75bcac1..81af4d567 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig @@ -57,6 +57,15 @@ (person.gender == 'man') ? 'man' : 'neuter' %}

    + + {%- if person.deathdate is not null -%} + + + + + {%- else -%}

    {%- endif -%} {#- tricks to remove easily whitespace after template -#} From a6001c195a2e47717b8d56d027ce3f90ceb782ca Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 12 Aug 2021 11:53:04 +0200 Subject: [PATCH 55/58] templates added and adapted for delete, list en view of aside activity --- .../src/Entity/AsideActivity.php | 6 +++ .../views/asideActivity/_delete.html.twig | 4 +- .../views/asideActivity/delete.html.twig | 2 +- .../views/asideActivity/list.html.twig | 25 +++++------ .../views/asideActivity/view.html.twig | 11 +++-- .../src/translations/messages.fr.yml | 42 ++++++++++++++++++- 6 files changed, 68 insertions(+), 22 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index fda40ea1a..40d8aa6cd 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -200,4 +200,10 @@ final class AsideActivity implements TrackUpdateInterface, TrackCreationInterfac return $this; } + + // public function __toString() + // { + // // dump($this->type->getTitle()); + // return $this->type->getTitle(); + // } } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig index 85df29a9c..fdbccb838 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig @@ -1,9 +1,9 @@
    {% block crud_content_header %} -

    {{ ('crud.'~crud_name~'.title_delete')|trans({ '%as_string%': entity|chill_entity_render_string }) }}

    +

    {{ ('crud.'~crud_name~'.title_delete')|trans({ '%as_string%': 'Aside Activity' }) }}

    {% endblock crud_content_header %} -

    {{ ('crud.'~crud_name~'.confirm_message_delete')|trans({ '%as_string%': entity|chill_entity_render_string }) }}

    +

    {{ ('crud.'~crud_name~'.confirm_message_delete')|trans({ '%as_string%': 'Aside Activity' }) }}

    {{ form_start(form) }} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/delete.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/delete.html.twig index de2d28c90..9c8a1ff59 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/delete.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/delete.html.twig @@ -1,6 +1,6 @@ {% extends '@ChillMain/layout.html.twig' %} -{% block title %}{{ ('crud.' ~ crud_name ~ '.delete.title')|trans({'%crud_name%': crud_name}) }}{% endblock %} +{# {% block title %}{{ ('crud.' ~ crud_name ~ '.delete.title')|trans({'%crud_name%': crud_name}) }}{% endblock %} #} {% block content %} {% embed '@ChillAsideActivity/AsideActivity/_delete.html.twig' %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig index f474dcf1b..4017a7055 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/list.html.twig @@ -1,6 +1,7 @@ -{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} +{% extends "@ChillMain/layout.html.twig" %} -{% block admin_content %} +{% block content %} +

    {{ 'My aside activities' |trans }}

    {% if entities|length == 0 %} @@ -10,7 +11,7 @@

    {% else %} -
    +
    {# Sort activities according to date in descending order #} {% for entity in entities|sort ((a, b) => b.date <=> a.date) %} {% set t = entity.type %} @@ -29,13 +30,13 @@ {% if entity.date %}

    {{ entity.date|format_date('long') }}

    {% endif %} - +{#

    {{ entity.duration|date('H:i') }}

    -
    +
    #}
    @@ -49,25 +50,25 @@
    - {% + {# {% if entity.note is not empty or entity.createdBy|length > 0 %}
    {% if entity.note is not empty %}
    - {{ entity.note|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }} + {{ entity.note|chill_markdown_to_html }}
    {% endif %}
    - {% endif %} + {% endif %} #}
        - {#
      • - -
      • #} +
      • + +
      • {# TOOD {% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %} #} @@ -103,5 +104,5 @@
      - +
    {% endblock %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig index 5f1d2319a..4553e1c6f 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig @@ -1,16 +1,15 @@ -{% extends '@ChillPerson/Person/layout.html.twig' %} +{% extends '@ChillMain/layout.html.twig' %} -{% set person = entity.person %} {% set activeRouteKey = '' %} {% block title %} -{% include('@ChillPerson/CRUD/_view_title.html.twig') %} +{% include('@ChillMain/CRUD/_view_title.html.twig') %} {% endblock %} -{% block personcontent %} -{% embed '@ChillPerson/CRUD/_view_content.html.twig' %} +{% block content %} +{% embed '@ChillMain/CRUD/_view_content.html.twig' %} {% block crud_content_header %} -

    {{ ('crud.' ~ crud_name ~ '.title_view')|trans({'%person%': person|chill_entity_render_string }) }}

    +

    {{ ('crud.' ~ crud_name ~ '.title_view')|trans }}

    {% endblock crud_content_header %} {% endembed %} {% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml index 3746f4dda..6ddc70e6d 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml +++ b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml @@ -1,8 +1,42 @@ +#general +Show the aside activity: Voir l'activité annexe +Edit the aside activity: Modifier l'activité annexe +Aside activity: Activité annexe +Duration time: Durée +durationTime: durée +user_username: nom de l'utilisateur +Remark: Commentaire +No comments: Aucun commentaire +Add a new aside activity: Ajouter une nouvelle activité annexe +Aside activity list: Liste des activités annexes +present: présent +not present: absent +Delete: Supprimer +Update: Mettre à jour +Update activity: Modifier l'activité +Aside activity data: Données de l'activité annexe +No reason associated: Aucun sujet +There aren't any aside activities.: Aucune activité annexe enregistrée. +type_name: type de l'activité +Type: Type +Invisible: Invisible +Optional: Optionnel +Required: Obligatoire +Persons: Personnes +Users: Utilisateurs +Emergency: Urgent +by: 'Par ' +location: Lieu + # Crud crud: aside_activity: + title_view: Détail de l'activité annexe title_new: Nouveau activité annexe - title_edit: Edition d'un type d'activité + title_edit: Edition d'une activité annexe + title_delete: Supprimation d'une activité annexe + button_delete: Supprimer + confirm_message_delete: Êtes-vous sûr de vouloir supprimer cet activité annexe? aside_activity_category: title_new: Nouvelle catégorie d'activité annexe title_edit: Edition d'une catégorie de type d'activité @@ -34,3 +68,9 @@ Choose a category: Choisir un categorie My aside activities: Mes activités annexes Date: Date Created by: Creér par + + +#Aside activity delete +Delete aside activity: Supprimer une activité annexe +Are you sure you want to remove the aside activity concerning "%name%" ?: Êtes-vous sûr de vouloir supprimer une activité annexe qui concerne "%name%" ? +The activity has been successfully removed.: L'activité a été supprimée. \ No newline at end of file From f6376118a002138646d83a776408409faaf83c21 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 12 Aug 2021 11:54:50 +0200 Subject: [PATCH 56/58] commented out unneccesary lines for migration --- .../src/migrations/Version20210804082249.php | 162 ------------------ 1 file changed, 162 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php index 00d353368..8a0e98b9a 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php @@ -41,87 +41,6 @@ final class Version20210804082249 extends AbstractMigration $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD CONSTRAINT FK_A866DA0E3414710B FOREIGN KEY (agent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('DROP TABLE asideactivitytype'); $this->addSql('DROP TABLE asideactivity'); - // $this->addSql('DROP TABLE chill_main_address_legacy'); - // $this->addSql('ALTER INDEX idx_55026b0ca76ed395 RENAME TO IDX_AC74095AA76ED395'); - // $this->addSql('ALTER INDEX idx_55026b0cc54c8c93 RENAME TO IDX_AC74095AC54C8C93'); - // $this->addSql('ALTER INDEX idx_55026b0c682b5931 RENAME TO IDX_AC74095A682B5931'); - // $this->addSql('ALTER INDEX idx_55026b0c217bbb47 RENAME TO IDX_AC74095A217BBB47'); - // $this->addSql('ALTER INDEX idx_ac74095a550b0c53 RENAME TO IDX_AC74095AD7FA8EF0'); - // $this->addSql('ALTER TABLE activityreason ALTER name SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN activityreason.name IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER INDEX idx_654a2fcd12469de2 RENAME TO IDX_AF82522312469DE2'); - // $this->addSql('ALTER TABLE activityreasoncategory ALTER name SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN activityreasoncategory.name IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER TABLE activitytype ALTER category_id DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_main_address DROP customs'); - // $this->addSql('ALTER TABLE chill_main_address ALTER isnoaddress DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_main_address ALTER point TYPE geometry(POINT,4326)'); - // $this->addSql('ALTER TABLE chill_main_address ALTER point DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point TYPE geometry(POINT,4326)'); - // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point DROP DEFAULT'); - // $this->addSql('CREATE INDEX search_name_code ON chill_main_postal_code (code, label)'); - // $this->addSql('ALTER INDEX idx_64a4a621504cb38d RENAME TO IDX_E260A868504CB38D'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive ALTER ordering DROP DEFAULT'); - // $this->addSql('ALTER INDEX idx_92351ece727aca70 RENAME TO IDX_72D110E8727ACA70'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ALTER startdate DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startdate TYPE DATE'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startdate DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER enddate TYPE DATE'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER enddate DROP DEFAULT'); - // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.startDate IS \'(DC2Type:date_immutable)\''); - // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.endDate IS \'(DC2Type:date_immutable)\''); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD CONSTRAINT FK_B694FB365FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - // $this->addSql('CREATE INDEX IDX_B694FB365FF1AEC ON chill_person_accompanying_period_work (updatedBy_id)'); - // $this->addSql('ALTER TABLE chill_person_household DROP CONSTRAINT fk_household_comment_embeddable_user'); - // $this->addSql('DROP INDEX IDX_BE50A270116F5FA9'); - // $this->addSql('DROP INDEX household_members_not_overlaps'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER startdate TYPE DATE'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER startdate DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER enddate TYPE DATE'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER enddate DROP DEFAULT'); - // $this->addSql('COMMENT ON COLUMN chill_person_household_members.startDate IS \'(DC2Type:date_immutable)\''); - // $this->addSql('COMMENT ON COLUMN chill_person_household_members.endDate IS \'(DC2Type:date_immutable)\''); - // $this->addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(7)'); - // $this->addSql('COMMENT ON COLUMN chill_person_marital_status.name IS \'(DC2Type:json_array)\''); - // $this->addSql('DROP INDEX mobilenumber_trgm_idx'); - // $this->addSql('DROP INDEX fullnamecanonical_trgm_idx'); - // $this->addSql('DROP INDEX phonenumber_trgm_idx'); - // $this->addSql('ALTER TABLE chill_person_person DROP cfdata_old'); - // $this->addSql('ALTER TABLE chill_person_person ALTER maritalstatus_id TYPE VARCHAR(7)'); - // $this->addSql('ALTER TABLE chill_person_person ALTER cfdata SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN chill_person_person.cFData IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER INDEX idx_3370d4403818da5 RENAME TO IDX_BF210A143818DA5'); - // $this->addSql('ALTER INDEX idx_3370d4401c9da55 RENAME TO IDX_BF210A141C9DA55'); - // $this->addSql('ALTER INDEX idx_bf210a145521be40 RENAME TO IDX_BF210A14D7D03CE3'); - // $this->addSql('ALTER INDEX idx_person_center RENAME TO IDX_BF210A145932F377'); - // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT FK_7201106F217BBB47'); - // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT FK_7201106F82F1BAF4'); - // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT FK_7201106F217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT FK_7201106F82F1BAF4 FOREIGN KEY (language_id) REFERENCES language (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - // $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER notificationdelay SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN country.name IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER TABLE custom_field_long_choice_options ALTER internal_key DROP DEFAULT'); - // $this->addSql('COMMENT ON COLUMN custom_field_long_choice_options.text IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER TABLE customfield ALTER required DROP DEFAULT'); - // $this->addSql('ALTER TABLE customfield ALTER required SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN customfield.name IS \'(DC2Type:json_array)\''); - // $this->addSql('COMMENT ON COLUMN customfield.options IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER INDEX idx_40fb5d6dfec418b RENAME TO IDX_7A6FDBEFEC418B'); - // $this->addSql('ALTER INDEX idx_286dc95df53b66 RENAME TO IDX_7A48DF7F5DF53B66'); - // $this->addSql('ALTER TABLE customfieldsgroup ALTER options DROP DEFAULT'); - // $this->addSql('ALTER TABLE customfieldsgroup ALTER options SET NOT NULL'); - // $this->addSql('COMMENT ON COLUMN customfieldsgroup.name IS \'(DC2Type:json_array)\''); - // $this->addSql('COMMENT ON COLUMN customfieldsgroup.options IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER INDEX idx_a14d8f3d447bbb3b RENAME TO IDX_A14D8F3D96DF1F10'); - // $this->addSql('COMMENT ON COLUMN language.name IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER TABLE permission_groups ALTER flags DROP DEFAULT'); - // $this->addSql('COMMENT ON COLUMN scopes.name IS \'(DC2Type:json_array)\''); - // $this->addSql('ALTER INDEX chill_3party.idx_c65d4397c7d3a8e6 RENAME TO IDX_14DC4475C7D3A8E6'); - // $this->addSql('ALTER INDEX chill_3party.idx_c65d43975932f377 RENAME TO IDX_14DC44755932F377'); - // $this->addSql('ALTER TABLE users ALTER usernamecanonical SET NOT NULL'); - // $this->addSql('DROP INDEX uniq_93f763ae217bbb47'); - // $this->addSql('ALTER TABLE chill_vendee.vendeeperson_entourage ADD CONSTRAINT FK_4D319FFEF57537C3 FOREIGN KEY (vendeeperson_id) REFERENCES chill_vendee.vendee_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - // $this->addSql('ALTER INDEX chill_vendee.idx_1a4b602deef79338 RENAME TO IDX_DD0A4C00EEF79338'); } public function down(Schema $schema): void @@ -147,86 +66,5 @@ final class Version20210804082249 extends AbstractMigration $this->addSql('ALTER TABLE asideactivity ADD CONSTRAINT fk_e9fa21913414710b FOREIGN KEY (agent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('DROP TABLE chill_asideactivity.AsideActivity'); $this->addSql('DROP TABLE chill_asideactivity.AsideActivityCategory'); - // $this->addSql('COMMENT ON COLUMN scopes.name IS NULL'); - // $this->addSql('ALTER INDEX idx_7a48df7f5df53b66 RENAME TO idx_286dc95df53b66'); - // $this->addSql('COMMENT ON COLUMN country.name IS NULL'); - // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT fk_7201106f217bbb47'); - // $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT fk_7201106f82f1baf4'); - // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT fk_7201106f217bbb47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - // $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT fk_7201106f82f1baf4 FOREIGN KEY (language_id) REFERENCES language (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - // $this->addSql('COMMENT ON COLUMN language.name IS NULL'); - // $this->addSql('ALTER TABLE customfieldsgroup ALTER options SET DEFAULT \'{}\''); - // $this->addSql('ALTER TABLE customfieldsgroup ALTER options DROP NOT NULL'); - // $this->addSql('COMMENT ON COLUMN customfieldsgroup.name IS NULL'); - // $this->addSql('COMMENT ON COLUMN customfieldsgroup.options IS NULL'); - // $this->addSql('ALTER TABLE activityreasoncategory ALTER name DROP NOT NULL'); - // $this->addSql('COMMENT ON COLUMN activityreasoncategory.name IS NULL'); - // $this->addSql('ALTER TABLE activityreason ALTER name DROP NOT NULL'); - // $this->addSql('COMMENT ON COLUMN activityreason.name IS NULL'); - // $this->addSql('ALTER INDEX idx_af82522312469de2 RENAME TO idx_654a2fcd12469de2'); - // $this->addSql('ALTER INDEX idx_a14d8f3d96df1f10 RENAME TO idx_a14d8f3d447bbb3b'); - // $this->addSql('ALTER TABLE customfield ALTER required SET DEFAULT \'false\''); - // $this->addSql('ALTER TABLE customfield ALTER required DROP NOT NULL'); - // $this->addSql('COMMENT ON COLUMN customfield.options IS NULL'); - // $this->addSql('COMMENT ON COLUMN customfield.name IS NULL'); - // $this->addSql('ALTER INDEX idx_7a6fdbefec418b RENAME TO idx_40fb5d6dfec418b'); - // $this->addSql('ALTER TABLE custom_field_long_choice_options ALTER internal_key SET DEFAULT \'\''); - // $this->addSql('COMMENT ON COLUMN custom_field_long_choice_options.text IS NULL'); - // $this->addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(10)'); - // $this->addSql('COMMENT ON COLUMN chill_person_marital_status.name IS NULL'); - // $this->addSql('ALTER TABLE permission_groups ALTER flags SET DEFAULT \'[]\''); - // $this->addSql('ALTER INDEX chill_3party.idx_14dc4475c7d3a8e6 RENAME TO idx_c65d4397c7d3a8e6'); - // $this->addSql('ALTER INDEX chill_3party.idx_14dc44755932f377 RENAME TO idx_c65d43975932f377'); - // $this->addSql('ALTER TABLE users ALTER usernameCanonical DROP NOT NULL'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive ALTER ordering SET DEFAULT \'0\''); - // $this->addSql('ALTER INDEX idx_72d110e8727aca70 RENAME TO idx_92351ece727aca70'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ALTER startDate SET DEFAULT \'1970-01-01\''); - // $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER notificationDelay DROP NOT NULL'); - // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point TYPE VARCHAR(255)'); - // $this->addSql('ALTER TABLE chill_main_address_reference ALTER point DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_main_address ADD customs JSONB DEFAULT \'[]\''); - // $this->addSql('ALTER TABLE chill_main_address ALTER isNoAddress SET DEFAULT \'false\''); - // $this->addSql('ALTER TABLE chill_main_address ALTER point TYPE VARCHAR(255)'); - // $this->addSql('ALTER TABLE chill_main_address ALTER point DROP DEFAULT'); - // $this->addSql('ALTER INDEX idx_e260a868504cb38d RENAME TO idx_64a4a621504cb38d'); - // $this->addSql('ALTER INDEX idx_ac74095aa76ed395 RENAME TO idx_55026b0ca76ed395'); - // $this->addSql('ALTER INDEX idx_ac74095a682b5931 RENAME TO idx_55026b0c682b5931'); - // $this->addSql('ALTER INDEX idx_ac74095a217bbb47 RENAME TO idx_55026b0c217bbb47'); - // $this->addSql('ALTER INDEX idx_ac74095ac54c8c93 RENAME TO idx_55026b0cc54c8c93'); - // $this->addSql('ALTER INDEX idx_ac74095ad7fa8ef0 RENAME TO IDX_AC74095A550B0C53'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER startDate TYPE DATE'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER startDate DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER endDate TYPE DATE'); - // $this->addSql('ALTER TABLE chill_person_household_members ALTER endDate DROP DEFAULT'); - // $this->addSql('COMMENT ON COLUMN chill_person_household_members.startdate IS NULL'); - // $this->addSql('COMMENT ON COLUMN chill_person_household_members.enddate IS NULL'); - // $this->addSql('CREATE INDEX household_members_not_overlaps ON chill_person_household_members (person_id) WHERE (sharedhousehold IS TRUE)'); - // $this->addSql('ALTER TABLE activitytype ALTER category_id SET DEFAULT 1'); - // $this->addSql('ALTER TABLE chill_person_household ADD CONSTRAINT fk_household_comment_embeddable_user FOREIGN KEY (comment_members_userid) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - // $this->addSql('CREATE INDEX IDX_BE50A270116F5FA9 ON chill_person_household (comment_members_userid)'); - // $this->addSql('DROP INDEX search_name_code'); - // $this->addSql('ALTER TABLE chill_person_person ADD cfdata_old TEXT DEFAULT NULL'); - // $this->addSql('ALTER TABLE chill_person_person ALTER cFData DROP NOT NULL'); - // $this->addSql('ALTER TABLE chill_person_person ALTER maritalStatus_id TYPE VARCHAR(10)'); - // $this->addSql('COMMENT ON COLUMN chill_person_person.cfdata_old IS \'(DC2Type:array)\''); - // $this->addSql('COMMENT ON COLUMN chill_person_person.cfdata IS NULL'); - // $this->addSql('CREATE INDEX mobilenumber_trgm_idx ON chill_person_person (mobilenumber)'); - // $this->addSql('CREATE INDEX fullnamecanonical_trgm_idx ON chill_person_person (fullnamecanonical)'); - // $this->addSql('CREATE INDEX phonenumber_trgm_idx ON chill_person_person (phonenumber)'); - // $this->addSql('ALTER INDEX idx_bf210a141c9da55 RENAME TO idx_3370d4401c9da55'); - // $this->addSql('ALTER INDEX idx_bf210a143818da5 RENAME TO idx_3370d4403818da5'); - // $this->addSql('ALTER INDEX idx_bf210a145932f377 RENAME TO idx_person_center'); - // $this->addSql('ALTER INDEX idx_bf210a14d7d03ce3 RENAME TO IDX_BF210A145521BE40'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP CONSTRAINT FK_B694FB365FF1AEC'); - // $this->addSql('DROP INDEX IDX_B694FB365FF1AEC'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startDate TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER startDate DROP DEFAULT'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER endDate TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); - // $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER endDate DROP DEFAULT'); - // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.startdate IS \'(DC2Type:datetime_immutable)\''); - // $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.enddate IS \'(DC2Type:datetime_immutable)\''); - // $this->addSql('CREATE UNIQUE INDEX uniq_93f763ae217bbb47 ON chill_vendee.vendee_person (person_id)'); - // $this->addSql('ALTER TABLE chill_vendee.vendeeperson_entourage DROP CONSTRAINT FK_4D319FFEF57537C3'); - // $this->addSql('ALTER INDEX chill_vendee.idx_dd0a4c00eef79338 RENAME TO idx_1a4b602deef79338'); } } From f58be46466adfe2e74672a0816bf265fd3434765 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 17 Aug 2021 14:03:18 +0200 Subject: [PATCH 57/58] Fix error about not opened bracket --- .../Resources/views/AccompanyingCourse/index.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index c18abc767..356f7fd32 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -27,7 +27,7 @@
    - {% if accompanyingCourse.locationStatus == 'address' or accompanyingCourse.locationStatus == 'none') %} + {% if accompanyingCourse.locationStatus == 'address' or accompanyingCourse.locationStatus == 'none' %}
    {{ 'This course is located at a temporarily address. You should locate this course to an user'|trans }}
    From a58bdb466ce5e18b712a51112cc0096abb8fd491 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 17 Aug 2021 15:23:57 +0200 Subject: [PATCH 58/58] Fix error when options['customButtons'] is empty --- .../Resources/views/Entity/thirdparty.html.twig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig b/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig index 4ad66ce1d..0cd5960bf 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig +++ b/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig @@ -92,14 +92,16 @@ {{ options['customButtons']['before'] }} {% endif %} - {%- if options['customButtons']['replace'] is not defined and is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) -%} + {% if options['customButtons']['replace'] is defined %} + {{ options['customButtons']['replace'] }} + {% elseif is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) %}
  • - {%- else -%} - {{ options['customButtons']['replace'] }} - {%- endif -%} + {% else %} + {# rien faire ? j'ai eu un bug car options['customButtons'] était vide (marc) #} + {% endif %} {% if options['customButtons']['after'] is defined %} {{ options['customButtons']['after'] }}