diff --git a/.gitignore b/.gitignore index a6845dd3e..3017e8d48 100755 --- a/.gitignore +++ b/.gitignore @@ -1,31 +1,44 @@ -local/config/build.properties -local/config/config_db.php -local/config/build -local/config/database.yml -local/config/database.yml.sample.save -core/vendor -local/config/runtime-conf.xml -cache/* -log/* -bin/* -local/session/* -coverage -.idea -.buildpath -.project -.settings/ -local/media/documents/* -local/media/images/* -web/assets/* -web/cache/* -web/tinymce -web/media -phpdoc*.log -xhprof/ -phpunit.phar -.DS_Store -phpmyadmin -templates/default-esi -local/modules/TemplateEsiModule -composer.phar -web/.htaccess +local/config/build.properties +local/config/config_db.php +local/config/build +local/config/database.yml +local/config/database.yml.sample.save +core/vendor +local/config/runtime-conf.xml +cache/* +log/* +bin/* +local/session/* +coverage +.idea +.buildpath +.project +.settings/ +local/media/documents/* +local/media/images/* +web/assets/* +web/cache/* +web/tinymce +web/media +phpdoc*.log +xhprof/ +phpunit.phar +.DS_Store +phpmyadmin +composer.phar +web/.htaccess + +# Ignore everything in the "modules" directory, except the "default modules" +local/modules/* +!local/modules/Cheque/ +!local/modules/Front/ +!local/modules/TheliaDebugBar/ +!local/modules/Tinymce/ +!local/modules/Colissimo/ + +# Ignore everything in the "templates" directory, except the "default template" +templates/* +!templates/backOffice/ +!templates/email/ +!templates/frontOffice/ +!templates/pdf/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..af9d60242 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "local/modules/Klikandpay"] + path = local/modules/Klikandpay + url = https://github.com/thelia-modules/Klikandpay diff --git a/.travis.yml b/.travis.yml index eb6e3a046..56524f1a5 100755 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ before_script: - composer install --prefer-dist --dev - sh -c "mysql -u$DB_USER -e 'SET FOREIGN_KEY_CHECKS = 0; DROP DATABASE IF EXISTS thelia;SET FOREIGN_KEY_CHECKS = 1;'; fi" - php Thelia thelia:install --db_host=localhost --db_username=$DB_USER --db_name=thelia - - php install/faker.php + - php setup/faker.php - php Thelia module:activate Colissimo - php Thelia module:activate Cheque diff --git a/CHANGELOG.md b/CHANGELOG.md index 77146ebee..7797282d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,36 @@ +#2.0.1 +- possibility to apply a permanent discount on a customer +- display estimated shipping on cart page +- export newsletter subscribers list +- Fix redirect issues +- enhancement of coupon UI +- enhancement of admin menu. Coupon is now in Tools menu +- front office, email and pdf templates are translated in Russian and Czech +- fix bugs : https://github.com/thelia/thelia/issues?milestone=4&page=1&state=closed + #2.0.0 -- coupons effect are recalculated after each product's cart modification +- Coupons values are re-evaluated when a product quantity is changed in the shopping cart - You can declare new compilerPass in modules. See Thelia\Module\BaseModule::getCompilers phpDoc - Add ability to load assets from another template. See https://gist.github.com/lunika/9365180 +- allow possibility to use Dependency Injection compiler in Thelia modules +- Add Deactivate Module Command Line +- Add indexes to database to improve performance +- Order and customer references are more human readable than before +- Refactor intl process. A domain is created for each templates and modules : + - core => for thelia core translations + - bo.template_name (eg : bo.default) => for each backoffice template + - fo.template_name (eg : fo.default) => for each frontoffice template + - pdf.template_name (eg : pdf.default) => for each pdf template + - email.template_name (eg : email.default) => for each email template + - modules : + - module_code (eg : paypal) => fore module core translations + - module_code.ai (eg : paypal.ai) => used in AdminIncludes templates + - bo.module_code.template_name (eg : bo.paypal.default) => used in back office template + - fo.module_code.template_name (eg : fo.paypal.default) => used in front office template +- new parameter for smarty ```intl``` function. The parameter ```d``` allow you to specify the translation domain (as explain before). This parameter is optional +- the ```d``` can be omitted if you use ```{default_translation_domain domain='bo.default'}``` in your layout. If you use this smarty function, the ```d``` parameter is automatically set with the domain specify in ```default_translation_domain``` function +- We changed Thelia's license. Thelia is published under the LGPL 3.0+ License + #2.0.0-RC1 - Remove container from BaseAction. diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 6812da56c..2ded5698b 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -4,6 +4,7 @@ please email us (info@thelia.net) or fork this file on Github and send a pull-re Manuel Raynaud - manu@thelia.net Etienne Roudeix - etienne.roudeix@gmail.com Franck Allimant - franck@allimant.org +Julien Chanséaume - jchanseaume@openstudio.fr Guillaume Morel - gmorel@openstudio.fr Michaël Espeche - mespeche@openstudio.fr Christophe Laffont - claffont@openstudio.fr diff --git a/LICENSE.txt b/LICENSE.txt index 94a9ed024..65c5ca88a 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,674 +1,165 @@ - GNU GENERAL PUBLIC LICENSE + GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 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 General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser 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 +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/Readme.md b/Readme.md index 921ccce47..58134075e 100644 --- a/Readme.md +++ b/Readme.md @@ -5,11 +5,13 @@ Thelia ------ [![Build Status](https://travis-ci.org/thelia/thelia.png?branch=master)](https://travis-ci.org/thelia/thelia) [![License](https://poser.pugx.org/thelia/thelia/license.png)](https://packagist.org/packages/thelia/thelia) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/thelia/thelia/badges/quality-score.png?s=61e3e04a69bffd71c29b08e5392080317a546716)](https://scrutinizer-ci.com/g/thelia/thelia/) -[Thelia](http://thelia.net/v2) is an open source tool for creating e-business websites and managing online content. This software is published under GPL. +[Thelia](http://thelia.net/) is an open source tool for creating e-business websites and managing online content. This software is published under LGPL. -Here is the most recent developed code for the next major version (v2). You can download this version for testing or having a look on the code (or anything you wish, respecting GPL). See http://thelia.net/v2 web site for more information. +This is the new major version of Thelia. -Most part of the code can possibly change, a large part will be refactor soon, graphical setup does not exist yet. +You can download this version and have a try or take a look at the source code (or anything you wish, respecting LGPL). See http://thelia.net/ web site for more information. + +A repository containing all thelia modules is available at this address : https://github.com/thelia-modules Requirements ------------ @@ -34,7 +36,7 @@ If you use Mac OSX, it still doesn't use php 5.4 as default php version... There * use last MAMP version and put the php bin directory in your path: ```bash -export PATH=/Applications/MAMP/bin/php/php5.4.x/bin/:$PATH +export PATH=/Applications/MAMP/bin/php/php5.5.x/bin/:$PATH ``` * configure a complete development environment : http://php-osx.liip.ch/ @@ -65,15 +67,36 @@ SET @@GLOBAL.sql_mode='NO_ENGINE_SUBSTITUTION', @@SESSION.sql_mode='NO_ENGINE_SU For more information on sql_mode you can consult the [MySQL doc](http://dev.mysql.com/doc/refman/5.0/fr/server-sql-mode.html "sql Mode") -Installation ------------- +## Download Thelia 2 ``` bash $ curl -sS https://getcomposer.org/installer | php -$ php composer.phar create-project thelia/thelia path/ 2.0.0-RC1 +$ php composer.phar create-project thelia/thelia path/ 2.0.0 ``` -Finish the installation using cli tools : +## Install it + +You can install Thelia by two different way + +### Using install wizard + +Installing thelia with the web install wizard allow to create an administrator, add some informations about your shop, etc + +First of all, you have to configure a vhost as describe in [configuration](http://doc.thelia.net/en/documentation/configuration.html) section. + +The install wizard in accessible with your favorite browser : + +``` bash +http://yourdomain.tld/[/subdomain_if_needed]/install +``` + +For example, I have thelia downloaded at http://thelia.net and my vhost is correctly configured, I have to reach this address : + +``` bash +http://thelia.net/install +``` + +### Using cli tools ``` bash $ php Thelia thelia:install @@ -89,6 +112,12 @@ Thelia documentation is available at http://doc.thelia.net The documentation is also in beta version and some part can be obsolete cause to some refactor. +Roadmap +------- + +The Roadmap is available at http://thelia.net/community/roadmap + + Contribute ---------- diff --git a/Thelia b/Thelia index a161b610f..ab1dc7a07 100755 --- a/Thelia +++ b/Thelia @@ -1,6 +1,8 @@ #!/usr/bin/env php =5.4", "ircmaxell/password-compat": "1.0.*", "propel/propel": "dev-master", - "psr/log" : "1.0", + "psr/log": "1.0", "symfony/class-loader": "2.2.*", - "symfony/config" : "2.2.*", - "symfony/console" : "2.2.*", - "symfony/dependency-injection" : "2.2.*", - "symfony/event-dispatcher" : "2.2.*", - "symfony/http-kernel" : "2.2.*", - "symfony/routing" : "2.2.*", - "symfony/filesystem" : "2.2.*", - "symfony/yaml" : "2.2.*", - "symfony/translation" : "2.2.*", - + "symfony/config": "2.2.*", + "symfony/console": "2.2.*", + "symfony/dependency-injection": "2.2.*", + "symfony/event-dispatcher": "2.2.*", + "symfony/http-kernel": "2.2.*", + "symfony/routing": "2.2.*", + "symfony/filesystem": "2.2.*", + "symfony/yaml": "2.2.*", + "symfony/translation": "2.2.*", "symfony-cmf/routing": "1.0.0", - "symfony/form": "2.2.*", "symfony/validator": "2.3.*", - "smarty/smarty": "v3.1.14", "kriswallsmith/assetic": "1.2.*@dev", "leafo/lessphp": "0.4.*", "ptachoire/cssembed": "1.0.*", - + "doctrine/cache": "v1.3.0", "simplepie/simplepie": "dev-master", - "imagine/imagine": "0.*", "symfony/icu": "1.0", "swiftmailer/swiftmailer": "5.0.*", @@ -42,20 +38,20 @@ "ensepar/html2pdf": "1.0.1", "symfony/finder": "~2.2" }, - "require-dev" : { + "require-dev": { "phpunit/phpunit": "3.7.*", "fzaninotto/faker": "dev-master", "maximebf/debugbar": "dev-master" }, "minimum-stability": "stable", - "config" : { - "vendor-dir" : "core/vendor", - "bin-dir" : "bin" + "config": { + "vendor-dir": "core/vendor", + "bin-dir": "bin" }, "autoload": { "psr-0": { "": "local/modules/", - "Thelia" : "core/lib/" + "Thelia": "core/lib/" } }, "extra": { @@ -79,7 +75,9 @@ "reference": "tags/Smarty_3_1_14/distribution/" }, "autoload": { - "classmap": ["libs/"] + "classmap": [ + "libs/" + ] } } } diff --git a/composer.lock b/composer.lock index b333e828c..d7da926ba 100644 --- a/composer.lock +++ b/composer.lock @@ -3,8 +3,82 @@ "This file locks the dependencies of your project to a known state", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "92d99dbb21763697accf7050ded155b6", + "hash": "d1e1c31ed8e38f2282ab431898cf8b08", "packages": [ + { + "name": "doctrine/cache", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "e16d7adf45664a50fa86f515b6d5e7f670130449" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/e16d7adf45664a50fa86f515b6d5e7f670130449", + "reference": "e16d7adf45664a50fa86f515b6d5e7f670130449", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "phpunit/phpunit": ">=3.7", + "satooshi/php-coveralls": "~0.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Cache\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan H. Wage", + "email": "jonwage@gmail.com", + "homepage": "http://www.jwage.com/", + "role": "Creator" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "http://jmsyst.com", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Caching library offering an object-oriented API for many cache backends", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ], + "time": "2013-10-25 19:04:14" + }, { "name": "ensepar/html2pdf", "version": "1.0.1", diff --git a/core/bootstrap.php b/core/bootstrap.php index 7578ec1de..87cbb2907 100644 --- a/core/bootstrap.php +++ b/core/bootstrap.php @@ -1,9 +1,17 @@ getUriForPath('/install')); + header('Location: '.$request->getUriForPath('/install')); + exit; } } diff --git a/core/lib/Thelia/Action/Address.php b/core/lib/Thelia/Action/Address.php index 9e278d899..e6e9b9f65 100644 --- a/core/lib/Thelia/Action/Address.php +++ b/core/lib/Thelia/Action/Address.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Administrator.php b/core/lib/Thelia/Action/Administrator.php index 77078df0b..74e11f517 100644 --- a/core/lib/Thelia/Action/Administrator.php +++ b/core/lib/Thelia/Action/Administrator.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Area.php b/core/lib/Thelia/Action/Area.php index 19037c9e4..f15039d02 100644 --- a/core/lib/Thelia/Action/Area.php +++ b/core/lib/Thelia/Action/Area.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Attribute.php b/core/lib/Thelia/Action/Attribute.php index 5372f1ec7..ef7866476 100644 --- a/core/lib/Thelia/Action/Attribute.php +++ b/core/lib/Thelia/Action/Attribute.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/AttributeAv.php b/core/lib/Thelia/Action/AttributeAv.php index 5c3fdebc4..1b88b4209 100644 --- a/core/lib/Thelia/Action/AttributeAv.php +++ b/core/lib/Thelia/Action/AttributeAv.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/BaseAction.php b/core/lib/Thelia/Action/BaseAction.php index 46dc3eaf1..ed42f14e1 100644 --- a/core/lib/Thelia/Action/BaseAction.php +++ b/core/lib/Thelia/Action/BaseAction.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; @@ -38,7 +27,7 @@ class BaseAction * @param ModelCriteria $query * @param UpdatePositionEvent $event * - * @return mixed + * @return null */ protected function genericUpdatePosition(ModelCriteria $query, UpdatePositionEvent $event) { diff --git a/core/lib/Thelia/Action/BaseCachedFile.php b/core/lib/Thelia/Action/BaseCachedFile.php index 63f99dc1f..ce70eed47 100644 --- a/core/lib/Thelia/Action/BaseCachedFile.php +++ b/core/lib/Thelia/Action/BaseCachedFile.php @@ -1,26 +1,14 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ - namespace Thelia\Action; use Thelia\Core\Event\CachedFileEvent; diff --git a/core/lib/Thelia/Action/Cache.php b/core/lib/Thelia/Action/Cache.php index 85cedadd8..6532dda35 100644 --- a/core/lib/Thelia/Action/Cache.php +++ b/core/lib/Thelia/Action/Cache.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Cart.php b/core/lib/Thelia/Action/Cart.php index 69ef2dd29..da4ff8706 100644 --- a/core/lib/Thelia/Action/Cart.php +++ b/core/lib/Thelia/Action/Cart.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; @@ -26,12 +15,14 @@ namespace Thelia\Action; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Thelia\Core\Event\Cart\CartEvent; +use Thelia\Core\Event\Currency\CurrencyChangeEvent; use Thelia\Core\Event\TheliaEvents; -use Thelia\Model\ProductPrice; -use Thelia\Model\ProductPriceQuery; +use Thelia\Model\Base\ProductSaleElementsQuery; +use Thelia\Model\Currency; use Thelia\Model\CartItem; use Thelia\Model\CartItemQuery; use Thelia\Model\ConfigQuery; +use Thelia\Model\Tools\ProductPriceTools; /** * @@ -43,6 +34,7 @@ use Thelia\Model\ConfigQuery; */ class Cart extends BaseAction implements EventSubscriberInterface { + /** * * add an article in the current cart @@ -55,6 +47,13 @@ class Cart extends BaseAction implements EventSubscriberInterface $newness = $event->getNewness(); $append = $event->getAppend(); $quantity = $event->getQuantity(); + $currency = $cart->getCurrency(); + $customer = $cart->getCustomer(); + $discount = 0; + + if (null !== $customer && $customer->getDiscount() > 0) { + $discount = $customer->getDiscount(); + } $productSaleElementsId = $event->getProductSaleElementsId(); $productId = $event->getProduct(); @@ -62,13 +61,16 @@ class Cart extends BaseAction implements EventSubscriberInterface $cartItem = $this->findItem($cart->getId(), $productId, $productSaleElementsId); if ($cartItem === null || $newness) { - $productPrice = ProductPriceQuery::create() - ->filterByProductSaleElementsId($productSaleElementsId) - ->findOne(); - $event->setCartItem( - $this->doAddItem($event->getDispatcher(), $cart, $productId, $productPrice->getProductSaleElements(), $quantity, $productPrice) - ); + $productSaleElements = ProductSaleElementsQuery::create() + ->findPk($productSaleElementsId); + + if (null !== $productSaleElements) { + $productPrices = $productSaleElements->getPricesByCurrency($currency, $discount); + $event->setCartItem( + $this->doAddItem($event->getDispatcher(), $cart, $productId, $productSaleElements, $quantity, $productPrices) + ); + } } if ($append && $cartItem !== null) { @@ -136,6 +138,52 @@ class Cart extends BaseAction implements EventSubscriberInterface } } + public function updateCart(CurrencyChangeEvent $event) + { + $session = $event->getRequest()->getSession(); + $cart = $session->getCart(); + if (null !== $cart) { + $this->updateCartPrices($cart, $event->getCurrency()); + } + } + + /** + * + * Refresh article's price + * + * @param \Thelia\Model\Cart $cart + * @param \Thelia\Model\Currency $currency + */ + public function updateCartPrices(\Thelia\Model\Cart $cart, Currency $currency) + { + + $customer = $cart->getCustomer(); + $discount = 0; + + if (null !== $customer && $customer->getDiscount() > 0) { + $discount = $customer->getDiscount(); + } + + // cart item + foreach ($cart->getCartItems() as $cartItem) { + $productSaleElements = $cartItem->getProductSaleElements(); + + $productPrice = $productSaleElements->getPricesByCurrency($currency, $discount); + + $cartItem + ->setPrice($productPrice->getPrice()) + ->setPromoPrice($productPrice->getPromoPrice()); + + $cartItem->save(); + } + + // update the currency cart + $cart->setCurrencyId($currency->getId()); + $cart->save(); + + } + + /** * Returns an array of event names this subscriber wants to listen to. * @@ -163,6 +211,7 @@ class Cart extends BaseAction implements EventSubscriberInterface TheliaEvents::CART_DELETEITEM => array("deleteItem", 128), TheliaEvents::CART_UPDATEITEM => array("changeItem", 128), TheliaEvents::CART_CLEAR => array("clear", 128), + TheliaEvents::CHANGE_DEFAULT_CURRENCY => array("updateCart", 128), ); } @@ -186,15 +235,16 @@ class Cart extends BaseAction implements EventSubscriberInterface /** * try to attach a new item to an existing cart * - * @param \Thelia\Model\Cart $cart - * @param int $productId - * @param \Thelia\Model\ProductSaleElements $productSaleElements - * @param float $quantity - * @param ProductPrice $productPrice + * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher + * @param \Thelia\Model\Cart $cart + * @param int $productId + * @param \Thelia\Model\ProductSaleElements $productSaleElements + * @param float $quantity + * @param ProductPriceTools $productPrices * * @return CartItem */ - protected function doAddItem(EventDispatcherInterface $dispatcher, \Thelia\Model\Cart $cart, $productId, \Thelia\Model\ProductSaleElements $productSaleElements, $quantity, ProductPrice $productPrice) + protected function doAddItem(EventDispatcherInterface $dispatcher, \Thelia\Model\Cart $cart, $productId, \Thelia\Model\ProductSaleElements $productSaleElements, $quantity, ProductPriceTools $productPrices) { $cartItem = new CartItem(); $cartItem->setDisptacher($dispatcher); @@ -203,8 +253,8 @@ class Cart extends BaseAction implements EventSubscriberInterface ->setProductId($productId) ->setProductSaleElementsId($productSaleElements->getId()) ->setQuantity($quantity) - ->setPrice($productPrice->getPrice()) - ->setPromoPrice($productPrice->getPromoPrice()) + ->setPrice($productPrices->getPrice()) + ->setPromoPrice($productPrices->getPromoPrice()) ->setPromo($productSaleElements->getPromo()) ->setPriceEndOfLife(time() + ConfigQuery::read("cart.priceEOF", 60*60*24*30)) ->save(); diff --git a/core/lib/Thelia/Action/Category.php b/core/lib/Thelia/Action/Category.php index 2029af138..b2ccf4146 100644 --- a/core/lib/Thelia/Action/Category.php +++ b/core/lib/Thelia/Action/Category.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Config.php b/core/lib/Thelia/Action/Config.php index 377eb17f6..f63c86479 100644 --- a/core/lib/Thelia/Action/Config.php +++ b/core/lib/Thelia/Action/Config.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Content.php b/core/lib/Thelia/Action/Content.php index 98a094f7b..e6f4462c7 100644 --- a/core/lib/Thelia/Action/Content.php +++ b/core/lib/Thelia/Action/Content.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Country.php b/core/lib/Thelia/Action/Country.php index 4c2d0839b..bf43a888d 100644 --- a/core/lib/Thelia/Action/Country.php +++ b/core/lib/Thelia/Action/Country.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Coupon.php b/core/lib/Thelia/Action/Coupon.php index 82de51bdf..aaa827a9d 100644 --- a/core/lib/Thelia/Action/Coupon.php +++ b/core/lib/Thelia/Action/Coupon.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Currency.php b/core/lib/Thelia/Action/Currency.php index 5e391c2bc..0a79e37be 100644 --- a/core/lib/Thelia/Action/Currency.php +++ b/core/lib/Thelia/Action/Currency.php @@ -1,31 +1,20 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Thelia\Core\Event\ActionEvent; use Thelia\Model\CurrencyQuery; use Thelia\Model\Currency as CurrencyModel; @@ -98,18 +87,14 @@ class Currency extends BaseAction implements EventSubscriberInterface { if (null !== $currency = CurrencyQuery::create()->findPk($event->getCurrencyId())) { + // Reset default status + CurrencyQuery::create()->filterByByDefault(true)->update(array('ByDefault' => false)); - if ($currency->getByDefault() != $event->getIsDefault()) { - - // Reset default status - CurrencyQuery::create()->filterByByDefault(true)->update(array('ByDefault' => false)); - - $currency - ->setDispatcher($event->getDispatcher()) - ->setByDefault($event->getIsDefault()) - ->save() - ; - } + $currency + ->setDispatcher($event->getDispatcher()) + ->setByDefault($event->getIsDefault()) + ->save() + ; $event->setCurrency($currency); } @@ -134,7 +119,7 @@ class Currency extends BaseAction implements EventSubscriberInterface } } - public function updateRates(EventDispatcherInterface $dispatcher) + public function updateRates(ActionEvent $event) { $rates_url = ConfigQuery::read('currency_rate_update_url', 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml'); @@ -148,7 +133,7 @@ class Currency extends BaseAction implements EventSubscriberInterface if (null !== $currency = CurrencyQuery::create()->findOneByCode($code)) { $currency - ->setDispatcher($dispatcher) + ->setDispatcher($event->getDispatcher()) ->setRate($rate) ->save() ; diff --git a/core/lib/Thelia/Action/Customer.php b/core/lib/Thelia/Action/Customer.php index 6220aefe5..62e10446e 100644 --- a/core/lib/Thelia/Action/Customer.php +++ b/core/lib/Thelia/Action/Customer.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; @@ -147,6 +136,11 @@ class Customer extends BaseAction implements EventSubscriberInterface public function login(CustomerLoginEvent $event) { + $customer = $event->getCustomer(); + + if (method_exists($customer, 'clearDispatcher')) { + $customer->clearDispatcher(); + } $this->securityContext->setCustomerUser($event->getCustomer()); } diff --git a/core/lib/Thelia/Action/Document.php b/core/lib/Thelia/Action/Document.php index 4605ee7c9..b41ea920c 100644 --- a/core/lib/Thelia/Action/Document.php +++ b/core/lib/Thelia/Action/Document.php @@ -1,26 +1,14 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ - namespace Thelia\Action; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/core/lib/Thelia/Action/Feature.php b/core/lib/Thelia/Action/Feature.php index f2cda8e24..544a74b34 100644 --- a/core/lib/Thelia/Action/Feature.php +++ b/core/lib/Thelia/Action/Feature.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/FeatureAv.php b/core/lib/Thelia/Action/FeatureAv.php index 9a97c871b..9240a0f04 100644 --- a/core/lib/Thelia/Action/FeatureAv.php +++ b/core/lib/Thelia/Action/FeatureAv.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Folder.php b/core/lib/Thelia/Action/Folder.php index 7483c08b6..779fc2376 100644 --- a/core/lib/Thelia/Action/Folder.php +++ b/core/lib/Thelia/Action/Folder.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/HttpException.php b/core/lib/Thelia/Action/HttpException.php index d889529fa..934bd9827 100644 --- a/core/lib/Thelia/Action/HttpException.php +++ b/core/lib/Thelia/Action/HttpException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Image.php b/core/lib/Thelia/Action/Image.php index 3f92c7cc5..ef76254bf 100644 --- a/core/lib/Thelia/Action/Image.php +++ b/core/lib/Thelia/Action/Image.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Lang.php b/core/lib/Thelia/Action/Lang.php index 20fde397a..b44c1b6b3 100644 --- a/core/lib/Thelia/Action/Lang.php +++ b/core/lib/Thelia/Action/Lang.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; @@ -52,6 +41,9 @@ class Lang extends BaseAction implements EventSubscriberInterface ->setCode($event->getCode()) ->setDateFormat($event->getDateFormat()) ->setTimeFormat($event->getTimeFormat()) + ->setDecimalSeparator($event->getDecimalSeparator()) + ->setThousandsSeparator($event->getThousandsSeparator()) + ->setDecimals($event->getDecimals()) ->save(); $event->setLang($lang); @@ -80,6 +72,9 @@ class Lang extends BaseAction implements EventSubscriberInterface ->setLocale($event->getLocale()) ->setDateFormat($event->getDateFormat()) ->setTimeFormat($event->getTimeFormat()) + ->setDecimalSeparator($event->getDecimalSeparator()) + ->setThousandsSeparator($event->getThousandsSeparator()) + ->setDecimals($event->getDecimals()) ->save(); $event->setLang($lang); diff --git a/core/lib/Thelia/Action/MailingSystem.php b/core/lib/Thelia/Action/MailingSystem.php index 2f62d749b..95caee753 100644 --- a/core/lib/Thelia/Action/MailingSystem.php +++ b/core/lib/Thelia/Action/MailingSystem.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Message.php b/core/lib/Thelia/Action/Message.php index de9de9cbb..20c2084de 100644 --- a/core/lib/Thelia/Action/Message.php +++ b/core/lib/Thelia/Action/Message.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Module.php b/core/lib/Thelia/Action/Module.php index 05e29020b..7cabcc2fa 100644 --- a/core/lib/Thelia/Action/Module.php +++ b/core/lib/Thelia/Action/Module.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; @@ -61,9 +50,8 @@ class Module extends BaseAction implements EventSubscriberInterface public function toggleActivation(ModuleToggleActivationEvent $event) { if (null !== $module = ModuleQuery::create()->findPk($event->getModuleId())) { - $moduleClass = new \ReflectionClass($module->getFullNamespace()); - $moduleInstance = $moduleClass->newInstance(); + $moduleInstance = $module->createInstance(); if ( method_exists($moduleInstance, 'setContainer')) { $moduleInstance->setContainer($this->container); @@ -96,12 +84,11 @@ class Module extends BaseAction implements EventSubscriberInterface } try { - $reflected = new \ReflectionClass($module->getFullNamespace()); + $instance = $module->createInstance(); - $instance = $reflected->newInstance(); $instance->setContainer($this->container); - $path = dirname($reflected->getFileName()); + $path = $module->getAbsoluteBaseDir(); $instance->destroy($con, $event->getDeleteData()); @@ -191,6 +178,8 @@ class Module extends BaseAction implements EventSubscriberInterface public function updatePosition(UpdatePositionEvent $event) { $this->genericUpdatePosition(ModuleQuery::create(), $event); + + $this->cacheClear($event->getDispatcher()); } protected function cacheClear(EventDispatcherInterface $dispatcher) diff --git a/core/lib/Thelia/Action/Newsletter.php b/core/lib/Thelia/Action/Newsletter.php index b43972620..4a4b7a3d4 100644 --- a/core/lib/Thelia/Action/Newsletter.php +++ b/core/lib/Thelia/Action/Newsletter.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Order.php b/core/lib/Thelia/Action/Order.php index 0e8293c4a..7d27167cc 100644 --- a/core/lib/Thelia/Action/Order.php +++ b/core/lib/Thelia/Action/Order.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; @@ -48,7 +37,6 @@ use Thelia\Model\Order as ModelOrder; use Thelia\Model\OrderAddress; use Thelia\Model\OrderProduct; use Thelia\Model\OrderProductAttributeCombination; -use Thelia\Model\OrderStatus; use Thelia\Model\OrderStatusQuery; use Thelia\Tools\I18n; @@ -106,7 +94,14 @@ class Order extends BaseAction implements EventSubscriberInterface { $order = $event->getOrder(); - $order->setDeliveryModuleId($event->getDeliveryModule()); + $deliveryModuleId = $event->getDeliveryModule(); + + $order->setDeliveryModuleId($deliveryModuleId); + + // Reset postage cost if the delivery module had been removed + if ($deliveryModuleId <= 0) { + $order->setPostage(0); + } $event->setOrder($order); } @@ -206,7 +201,7 @@ class Order extends BaseAction implements EventSubscriberInterface $placedOrder->setInvoiceOrderAddressId($invoiceOrderAddress->getId()); $placedOrder->setStatusId( - OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_NOT_PAID)->getId() + OrderStatusQuery::getNotPaidStatus()->getId() ); /* memorize discount */ @@ -266,6 +261,7 @@ class Order extends BaseAction implements EventSubscriberInterface ->setTaxRuleTitle($taxRuleI18n->getTitle()) ->setTaxRuleDescription($taxRuleI18n->getDescription()) ->setEanCode($pse->getEanCode()) + ->setCartIemId($cartItem->getId()) ->setDispatcher($dispatcher) ->save($con) ; diff --git a/core/lib/Thelia/Action/Pdf.php b/core/lib/Thelia/Action/Pdf.php index 2bdad9366..cda86a547 100644 --- a/core/lib/Thelia/Action/Pdf.php +++ b/core/lib/Thelia/Action/Pdf.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Product.php b/core/lib/Thelia/Action/Product.php index b0e443179..5d827be8e 100644 --- a/core/lib/Thelia/Action/Product.php +++ b/core/lib/Thelia/Action/Product.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; @@ -75,7 +64,7 @@ class Product extends BaseAction implements EventSubscriberInterface ->setRef($event->getRef()) ->setLocale($event->getLocale()) ->setTitle($event->getTitle()) - ->setVisible($event->getVisible()) + ->setVisible($event->getVisible() ? 1 : 0) // Set the default tax rule to this product ->setTaxRule(TaxRuleQuery::create()->findOneByIsDefault(true)) @@ -109,7 +98,7 @@ class Product extends BaseAction implements EventSubscriberInterface ->setDescription($event->getDescription()) ->setChapo($event->getChapo()) ->setPostscriptum($event->getPostscriptum()) - ->setVisible($event->getVisible()) + ->setVisible($event->getVisible() ? 1 : 0) ->save() ; diff --git a/core/lib/Thelia/Action/ProductSaleElement.php b/core/lib/Thelia/Action/ProductSaleElement.php index 56d033419..acecaad15 100644 --- a/core/lib/Thelia/Action/ProductSaleElement.php +++ b/core/lib/Thelia/Action/ProductSaleElement.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Profile.php b/core/lib/Thelia/Action/Profile.php index c264b1439..a309052af 100644 --- a/core/lib/Thelia/Action/Profile.php +++ b/core/lib/Thelia/Action/Profile.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/ShippingZone.php b/core/lib/Thelia/Action/ShippingZone.php index 0a58537da..3d654688b 100644 --- a/core/lib/Thelia/Action/ShippingZone.php +++ b/core/lib/Thelia/Action/ShippingZone.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Tax.php b/core/lib/Thelia/Action/Tax.php index 87c78fe6e..111a02ae7 100644 --- a/core/lib/Thelia/Action/Tax.php +++ b/core/lib/Thelia/Action/Tax.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/TaxRule.php b/core/lib/Thelia/Action/TaxRule.php index 992a8d1a1..af96dd706 100644 --- a/core/lib/Thelia/Action/TaxRule.php +++ b/core/lib/Thelia/Action/TaxRule.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Action/Template.php b/core/lib/Thelia/Action/Template.php index 16493e94c..671b9d681 100644 --- a/core/lib/Thelia/Action/Template.php +++ b/core/lib/Thelia/Action/Template.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Action; diff --git a/core/lib/Thelia/Cart/CartTrait.php b/core/lib/Thelia/Cart/CartTrait.php index dce726552..c3cb403c8 100644 --- a/core/lib/Thelia/Cart/CartTrait.php +++ b/core/lib/Thelia/Cart/CartTrait.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Cart; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -86,6 +76,7 @@ trait CartTrait //le cookie de panier n'existe pas, il va falloir le créer et faire un enregistrement en base. $cart = $this->createCart($session); } + $session->setCart($cart->getId()); return $cart; } @@ -97,7 +88,8 @@ trait CartTrait protected function createCart(Session $session) { $cart = new CartModel(); - $cart->setToken($this->generateCookie()); + $cart->setToken($this->generateCookie($session)); + $cart->setCurrency($session->getCurrency(true)); if (null !== $customer = $session->getCustomerUser()) { $cart->setCustomer($customer); @@ -120,7 +112,8 @@ trait CartTrait */ protected function duplicateCart(EventDispatcherInterface $dispatcher, CartModel $cart, Session $session, Customer $customer = null) { - $newCart = $cart->duplicate($this->generateCookie(), $customer); + $currency = $session->getCurrency(); + $newCart = $cart->duplicate($this->generateCookie($session), $customer, $currency, $dispatcher); $session->setCart($newCart->getId()); $cartEvent = new CartEvent($newCart); @@ -130,18 +123,12 @@ trait CartTrait return $cartEvent->getCart(); } - protected function generateCookie() + protected function generateCookie(Session $session) { $id = null; if (ConfigQuery::read("cart.session_only", 0) == 0) { $id = uniqid('', true); - setcookie( - "thelia_cart", - $id, - time()+ConfigQuery::read("cart.cookie_lifetime", 60*60*24*365), - '/' - ); - + $session->set('cart_use_cookie', $id); } return $id; diff --git a/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php b/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php index 690f4362b..b64c290f9 100644 --- a/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php +++ b/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; diff --git a/core/lib/Thelia/Command/BaseModuleGenerate.php b/core/lib/Thelia/Command/BaseModuleGenerate.php index b3286c874..06e25a077 100644 --- a/core/lib/Thelia/Command/BaseModuleGenerate.php +++ b/core/lib/Thelia/Command/BaseModuleGenerate.php @@ -1,27 +1,19 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Command; +use Thelia\Model\Module; + /** * base class for module commands * @@ -42,7 +34,11 @@ abstract class BaseModuleGenerate extends ContainerAwareCommand 'Config', 'Model', 'Loop', - 'AdminIncludes', + 'Command', + 'Controller', + 'EventListeners', + 'I18n', + Module::ADMIN_INCLUDES_DIRECTORY_NAME, 'templates', ); diff --git a/core/lib/Thelia/Command/CacheClear.php b/core/lib/Thelia/Command/CacheClear.php index f8a6063c8..8351d0573 100644 --- a/core/lib/Thelia/Command/CacheClear.php +++ b/core/lib/Thelia/Command/CacheClear.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; @@ -53,6 +42,12 @@ class CacheClear extends ContainerAwareCommand InputOption::VALUE_NONE, "do not clear the assets cache in the web space" ) + ->addOption( + 'with-images', + null, + InputOption::VALUE_NONE, + 'clear images generated in web/cache directory' + ) ; } @@ -62,10 +57,15 @@ class CacheClear extends ContainerAwareCommand $cacheDir = $this->getContainer()->getParameter("kernel.cache_dir"); $this->clearCache($cacheDir, $output); + if (!$input->getOption("without-assets")) { $this->clearCache(THELIA_WEB_DIR . "assets", $output); } + if ($input->getOption('with-images')) { + $this->clearCache(THELIA_CACHE_DIR, $output); + } + } protected function clearCache($dir, OutputInterface $output) diff --git a/core/lib/Thelia/Command/ClearImageCache.php b/core/lib/Thelia/Command/ClearImageCache.php index acd2cb02e..22330473c 100644 --- a/core/lib/Thelia/Command/ClearImageCache.php +++ b/core/lib/Thelia/Command/ClearImageCache.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; diff --git a/core/lib/Thelia/Command/ContainerAwareCommand.php b/core/lib/Thelia/Command/ContainerAwareCommand.php index da903f509..8d307ee51 100644 --- a/core/lib/Thelia/Command/ContainerAwareCommand.php +++ b/core/lib/Thelia/Command/ContainerAwareCommand.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; diff --git a/core/lib/Thelia/Command/CreateAdminUser.php b/core/lib/Thelia/Command/CreateAdminUser.php index a9b622419..02d814b60 100644 --- a/core/lib/Thelia/Command/CreateAdminUser.php +++ b/core/lib/Thelia/Command/CreateAdminUser.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; diff --git a/core/lib/Thelia/Command/GenerateResources.php b/core/lib/Thelia/Command/GenerateResources.php index 29a8b4acd..465b5e910 100644 --- a/core/lib/Thelia/Command/GenerateResources.php +++ b/core/lib/Thelia/Command/GenerateResources.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; diff --git a/core/lib/Thelia/Command/Install.php b/core/lib/Thelia/Command/Install.php index d1a83c215..c127206bb 100644 --- a/core/lib/Thelia/Command/Install.php +++ b/core/lib/Thelia/Command/Install.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; diff --git a/core/lib/Thelia/Command/ModuleActivateCommand.php b/core/lib/Thelia/Command/ModuleActivateCommand.php index 139f21e9e..e05426d23 100644 --- a/core/lib/Thelia/Command/ModuleActivateCommand.php +++ b/core/lib/Thelia/Command/ModuleActivateCommand.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; @@ -63,9 +52,7 @@ class ModuleActivateCommand extends BaseModuleGenerate } try { - $moduleReflection = new \ReflectionClass($module->getFullNamespace()); - - $moduleInstance = $moduleReflection->newInstance(); + $moduleInstance = $module->createInstance(); $moduleInstance->activate(); } catch (\Exception $e) { diff --git a/core/lib/Thelia/Command/ModuleDeactivateCommand.php b/core/lib/Thelia/Command/ModuleDeactivateCommand.php new file mode 100755 index 000000000..e62572486 --- /dev/null +++ b/core/lib/Thelia/Command/ModuleDeactivateCommand.php @@ -0,0 +1,71 @@ + + * + */ +class ModuleDeactivateCommand extends BaseModuleGenerate +{ + protected function configure() + { + $this + ->setName("module:deactivate") + ->setDescription("Deactivate a module") + ->addArgument( + "module" , + InputArgument::REQUIRED, + "module to deactivate" + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $moduleCode = $this->formatModuleName($input->getArgument("module")); + + $module = ModuleQuery::create()->findOneByCode($moduleCode); + + if (null === $module) { + throw new \RuntimeException(sprintf("module %s not found", $moduleCode)); + } + + try { + $moduleInstance = $module->createInstance(); + + $moduleInstance->deActivate(); + } catch (\Exception $e) { + throw new \RuntimeException(sprintf("Deactivation fail with Exception : [%d] %s", $e->getCode(), $e->getMessage())); + } + + //impossible to change output class in CommandTester... + if (method_exists($output, "renderBlock")) { + $output->renderBlock(array( + '', + sprintf("Deactivation succeed for module %s", $moduleCode), + '' + ), "bg=green;fg=black"); + } + } +} diff --git a/core/lib/Thelia/Command/ModuleGenerateCommand.php b/core/lib/Thelia/Command/ModuleGenerateCommand.php index 8a610b991..f5cae9487 100644 --- a/core/lib/Thelia/Command/ModuleGenerateCommand.php +++ b/core/lib/Thelia/Command/ModuleGenerateCommand.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Command; use Symfony\Component\Console\Input\InputArgument; @@ -88,6 +78,7 @@ class ModuleGenerateCommand extends BaseModuleGenerate try { $skeletonDir = str_replace("/", DIRECTORY_SEPARATOR, THELIA_ROOT . "/core/lib/Thelia/Command/Skeleton/Module/"); + // config.xml file $fs->copy($skeletonDir . "config.xml", $this->moduleDirectory . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "config.xml"); $moduleContent = file_get_contents($skeletonDir . "module.xml"); @@ -97,6 +88,7 @@ class ModuleGenerateCommand extends BaseModuleGenerate file_put_contents($this->moduleDirectory . DIRECTORY_SEPARATOR . "Config". DIRECTORY_SEPARATOR . "module.xml", $moduleContent); + // PHP Class template $classContent = file_get_contents($skeletonDir . "Class.php.template"); $classContent = str_replace("%%CLASSNAME%%", $this->module, $classContent); @@ -104,11 +96,31 @@ class ModuleGenerateCommand extends BaseModuleGenerate file_put_contents($this->moduleDirectory . DIRECTORY_SEPARATOR . $this->module.".php", $classContent); + // schema.xml file $schemaContent = file_get_contents($skeletonDir . "schema.xml"); $schemaContent = str_replace("%%NAMESPACE%%", $this->module, $schemaContent); file_put_contents($this->moduleDirectory . DIRECTORY_SEPARATOR . "Config". DIRECTORY_SEPARATOR . "schema.xml", $schemaContent); + + // routing.xml file + $routingContent = file_get_contents($skeletonDir . "routing.xml"); + + $routingContent = str_replace("%%NAMESPACE%%", $this->module, $routingContent); + $routingContent = str_replace("%%CLASSNAME_LOWER%%", strtolower($this->module), $routingContent); + + file_put_contents($this->moduleDirectory . DIRECTORY_SEPARATOR . "Config". DIRECTORY_SEPARATOR . "routing.xml", $routingContent); + + // I18n sample files + $fs->copy( + $skeletonDir . DIRECTORY_SEPARATOR . "I18n" . DIRECTORY_SEPARATOR . "fr_FR.php", + $this->moduleDirectory . DIRECTORY_SEPARATOR . "I18n" . DIRECTORY_SEPARATOR . "fr_FR.php" + ); + + $fs->copy( + $skeletonDir . DIRECTORY_SEPARATOR . "I18n" . DIRECTORY_SEPARATOR . "en_US.php", + $this->moduleDirectory . DIRECTORY_SEPARATOR . "I18n" . DIRECTORY_SEPARATOR . "en_US.php" + ); } catch (\Exception $ex) { $fs->remove($this->moduleDirectory); diff --git a/core/lib/Thelia/Command/ModuleGenerateModelCommand.php b/core/lib/Thelia/Command/ModuleGenerateModelCommand.php index fbbe9be6c..66e3eeb9c 100644 --- a/core/lib/Thelia/Command/ModuleGenerateModelCommand.php +++ b/core/lib/Thelia/Command/ModuleGenerateModelCommand.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; diff --git a/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php b/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php index 2c6b310a5..c8cbd1165 100644 --- a/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php +++ b/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; diff --git a/core/lib/Thelia/Command/Output/TheliaConsoleOutput.php b/core/lib/Thelia/Command/Output/TheliaConsoleOutput.php index f13ef4d9b..4440b69e6 100644 --- a/core/lib/Thelia/Command/Output/TheliaConsoleOutput.php +++ b/core/lib/Thelia/Command/Output/TheliaConsoleOutput.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command\Output; diff --git a/core/lib/Thelia/Command/ReloadDatabaseCommand.php b/core/lib/Thelia/Command/ReloadDatabaseCommand.php index 0bd76c9e5..57870c634 100644 --- a/core/lib/Thelia/Command/ReloadDatabaseCommand.php +++ b/core/lib/Thelia/Command/ReloadDatabaseCommand.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; diff --git a/core/lib/Thelia/Command/Skeleton/Module/Class.php.template b/core/lib/Thelia/Command/Skeleton/Module/Class.php.template index 41fcfadbb..a11e247e7 100644 --- a/core/lib/Thelia/Command/Skeleton/Module/Class.php.template +++ b/core/lib/Thelia/Command/Skeleton/Module/Class.php.template @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace %%NAMESPACE%%; diff --git a/core/lib/Thelia/Command/Skeleton/Module/I18n/en_US.php b/core/lib/Thelia/Command/Skeleton/Module/I18n/en_US.php new file mode 100644 index 000000000..0b4fa142b --- /dev/null +++ b/core/lib/Thelia/Command/Skeleton/Module/I18n/en_US.php @@ -0,0 +1,4 @@ + 'The displayed english string', +); diff --git a/core/lib/Thelia/Command/Skeleton/Module/I18n/fr_FR.php b/core/lib/Thelia/Command/Skeleton/Module/I18n/fr_FR.php new file mode 100644 index 000000000..370862450 --- /dev/null +++ b/core/lib/Thelia/Command/Skeleton/Module/I18n/fr_FR.php @@ -0,0 +1,4 @@ + 'La traduction française de la chaine', +); diff --git a/core/lib/Thelia/Command/Skeleton/Module/routing.xml b/core/lib/Thelia/Command/Skeleton/Module/routing.xml new file mode 100644 index 000000000..12c942d0b --- /dev/null +++ b/core/lib/Thelia/Command/Skeleton/Module/routing.xml @@ -0,0 +1,31 @@ + + + + + + + diff --git a/core/lib/Thelia/Command/UpdateCommand.php b/core/lib/Thelia/Command/UpdateCommand.php index ecfc8277b..1ccb62b1c 100644 --- a/core/lib/Thelia/Command/UpdateCommand.php +++ b/core/lib/Thelia/Command/UpdateCommand.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Command; diff --git a/core/lib/Thelia/Condition/ConditionCollection.php b/core/lib/Thelia/Condition/ConditionCollection.php index 0298e510d..d820edfe1 100644 --- a/core/lib/Thelia/Condition/ConditionCollection.php +++ b/core/lib/Thelia/Condition/ConditionCollection.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition; @@ -38,7 +27,7 @@ use Thelia\Condition\Implementation\ConditionInterface; class ConditionCollection implements Iterator, Countable, ArrayAccess { /** @var array Array of ConditionInterface */ - protected $conditions = array(); + protected $conditions = []; /** * (PHP 5 >= 5.0.0) @@ -191,7 +180,7 @@ class ConditionCollection implements Iterator, Countable, ArrayAccess */ public function __toString() { - $arrayToSerialize = array(); + $arrayToSerialize = []; /** @var ConditionInterface $condition */ foreach ($this as $condition) { $arrayToSerialize[] = $condition->getSerializableCondition(); diff --git a/core/lib/Thelia/Condition/ConditionEvaluator.php b/core/lib/Thelia/Condition/ConditionEvaluator.php index 8e00cfcdb..455537ee8 100644 --- a/core/lib/Thelia/Condition/ConditionEvaluator.php +++ b/core/lib/Thelia/Condition/ConditionEvaluator.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition; diff --git a/core/lib/Thelia/Condition/ConditionFactory.php b/core/lib/Thelia/Condition/ConditionFactory.php index 932815110..8fd9647b6 100644 --- a/core/lib/Thelia/Condition/ConditionFactory.php +++ b/core/lib/Thelia/Condition/ConditionFactory.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition; @@ -72,7 +61,7 @@ class ConditionFactory ); $collection[] = $conditionNone; } - $serializableConditions = array(); + $serializableConditions = []; /** @var $condition ConditionInterface */ foreach ($collection as $condition) { $serializableConditions[] = $condition->getSerializableCondition(); diff --git a/core/lib/Thelia/Condition/ConditionOrganizer.php b/core/lib/Thelia/Condition/ConditionOrganizer.php index 6dab6e92c..15cfa7b19 100644 --- a/core/lib/Thelia/Condition/ConditionOrganizer.php +++ b/core/lib/Thelia/Condition/ConditionOrganizer.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition; diff --git a/core/lib/Thelia/Condition/ConditionOrganizerInterface.php b/core/lib/Thelia/Condition/ConditionOrganizerInterface.php index ab5a9dff7..8d056d5e0 100644 --- a/core/lib/Thelia/Condition/ConditionOrganizerInterface.php +++ b/core/lib/Thelia/Condition/ConditionOrganizerInterface.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition; diff --git a/core/lib/Thelia/Condition/Implementation/ConditionAbstract.php b/core/lib/Thelia/Condition/Implementation/ConditionAbstract.php index c5f7ebb91..bae7fcf31 100644 --- a/core/lib/Thelia/Condition/Implementation/ConditionAbstract.php +++ b/core/lib/Thelia/Condition/Implementation/ConditionAbstract.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition\Implementation; @@ -29,6 +18,7 @@ use Thelia\Condition\SerializableCondition; use Thelia\Core\Translation\Translator; use Thelia\Coupon\FacadeInterface; use Thelia\Exception\InvalidConditionValueException; +use Thelia\Model\Base\CurrencyQuery; use Thelia\Model\Currency; use Thelia\Type\FloatType; @@ -46,10 +36,10 @@ abstract class ConditionAbstract implements ConditionInterface protected $serviceId = null; /** @var array Available Operators (Operators::CONST) */ - protected $availableOperators = array(); + protected $availableOperators = []; /** @var array Parameters validating parameters against */ - protected $validators = array(); + protected $validators = []; /** @var FacadeInterface Provide necessary value from Thelia */ protected $facade = null; @@ -58,10 +48,10 @@ abstract class ConditionAbstract implements ConditionInterface protected $translator = null; /** @var array Operators set by Admin in BackOffice */ - protected $operators = array(); + protected $operators = []; /** @var array Values set by Admin in BackOffice */ - protected $values = array(); + protected $values = []; /** @var ConditionEvaluator Conditions validator */ protected $conditionValidator = null; @@ -97,9 +87,9 @@ abstract class ConditionAbstract implements ConditionInterface { $this->validators = $this->generateInputs(); - $translatedInputs = array(); + $translatedInputs = []; foreach ($this->validators as $key => $validator) { - $translatedOperators = array(); + $translatedOperators = []; foreach ($validator['availableOperators'] as $availableOperators) { $translatedOperators[$availableOperators] = Operators::getI18n( $this->translator, @@ -110,7 +100,7 @@ abstract class ConditionAbstract implements ConditionInterface $validator['availableOperators'] = $translatedOperators; $translatedInputs[$key] = $validator; } - $validators = array(); + $validators = []; $validators['inputs'] = $translatedInputs; $validators['setOperators'] = $this->operators; $validators['setValues'] = $this->values; @@ -227,27 +217,21 @@ abstract class ConditionAbstract implements ConditionInterface */ protected function drawBackOfficeInputOperators($inputKey) { - $selectHtml = ''; - $optionHtml = ''; - $inputs = $this->getValidators(); - if (isset($inputs['inputs'][$inputKey])) { - $operators = $inputs['inputs'][$inputKey]['availableOperators']; - foreach ($operators as $key => $operator) { - $selected = ''; - if (isset($this->operators) && isset($this->operators[$inputKey]) && $this->operators[$inputKey] == $key) { - $selected = ' selected="selected"'; - } - $optionHtml .= ''; - } + $html = ''; - $selectHtml .= ' - - '; + $inputs = $this->getValidators(); + + if (isset($inputs['inputs'][$inputKey])) { + + $html = $this->facade->getParser()->render('coupon/condition-fragments/condition-selector.html', [ + 'operators' => $inputs['inputs'][$inputKey]['availableOperators'], + 'value' => isset($this->operators[$inputKey]) ? $this->operators[$inputKey] : '', + 'inputKey' => $inputKey + ] + ); } - return $selectHtml; + return $html; } /** @@ -262,26 +246,19 @@ abstract class ConditionAbstract implements ConditionInterface protected function drawBackOfficeBaseInputsText($label, $inputKey) { $operatorSelectHtml = $this->drawBackOfficeInputOperators($inputKey); + $currentValue = ''; if (isset($this->values) && isset($this->values[$inputKey])) { $currentValue = $this->values[$inputKey]; } - $html = ' -
- -
-
- ' . $operatorSelectHtml . ' -
-
- -
-
-
- '; - - return $html; + return $this->facade->getParser()->render('coupon/conditions-fragments/base-input-text.html', [ + 'label' => $label, + 'inputKey' => $inputKey, + 'currentValue' => $currentValue, + 'operatorSelectHtml' => $operatorSelectHtml + ] + ); } /** @@ -296,23 +273,39 @@ abstract class ConditionAbstract implements ConditionInterface */ protected function drawBackOfficeInputQuantityValues($inputKey, $max = 10, $min = 0) { - $selectHtml = ''; - $optionHtml = ''; - for ($i = $min; $i <= $max; $i++) { - $selected = ''; - if (isset($this->values) && isset($this->values[$inputKey]) && $this->values[$inputKey] == $i) { - $selected = ' selected="selected"'; - } - $optionHtml .= ''; - } - - $selectHtml .= ' - - '; - - return $selectHtml; + return $this->facade->getParser()->render('coupon/condition-fragments/quantity-selector.html', [ + 'min' => $min, + 'max' => $max, + 'value' => isset($this->values[$inputKey]) ? $this->values[$inputKey] : '', + 'inputKey' => $inputKey + ] + ); } -} + /** + * Draw the currency input displayed in the BackOffice + * allowing Admin to set its Coupon Conditions + * + * @param string $inputKey Input key (ex: self::INPUT1) + * + * @return string HTML string + */ + protected function drawBackOfficeCurrencyInput($inputKey) + { + $currencies = CurrencyQuery::create()->find(); + + $cleanedCurrencies = []; + + /** @var Currency $currency */ + foreach ($currencies as $currency) { + $cleanedCurrencies[$currency->getCode()] = $currency->getSymbol(); + } + + return $this->facade->getParser()->render('coupon/condition-fragments/currency-selector.html', [ + 'currencies' => $cleanedCurrencies, + 'value' => isset($this->values[$inputKey]) ? $this->values[$inputKey] : '', + 'inputKey' => $inputKey + ] + ); + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Condition/Implementation/ConditionInterface.php b/core/lib/Thelia/Condition/Implementation/ConditionInterface.php index 0b4f3efe0..209a403f9 100644 --- a/core/lib/Thelia/Condition/Implementation/ConditionInterface.php +++ b/core/lib/Thelia/Condition/Implementation/ConditionInterface.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition\Implementation; diff --git a/core/lib/Thelia/Condition/Implementation/MatchForEveryone.php b/core/lib/Thelia/Condition/Implementation/MatchForEveryone.php index 92edec3ba..5049470a2 100644 --- a/core/lib/Thelia/Condition/Implementation/MatchForEveryone.php +++ b/core/lib/Thelia/Condition/Implementation/MatchForEveryone.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition\Implementation; @@ -36,7 +25,7 @@ class MatchForEveryone extends ConditionAbstract protected $serviceId = 'thelia.condition.match_for_everyone'; /** @var array Available Operators (Operators::CONST) */ - protected $availableOperators = array(); + protected $availableOperators = []; /** * Check validators relevancy and store them @@ -62,8 +51,8 @@ class MatchForEveryone extends ConditionAbstract */ protected function setValidators() { - $this->operators = array(); - $this->values = array(); + $this->operators = []; + $this->values = []; return $this; } @@ -86,8 +75,8 @@ class MatchForEveryone extends ConditionAbstract public function getName() { return $this->translator->trans( - 'Everybody can use it (no condition)', - array(), + 'Unconditional usage', + [], 'condition' ); } @@ -101,8 +90,8 @@ class MatchForEveryone extends ConditionAbstract public function getToolTip() { $toolTip = $this->translator->trans( - 'Will return always true', - array(), + 'This condition is always true', + [], 'condition' ); @@ -118,8 +107,8 @@ class MatchForEveryone extends ConditionAbstract public function getSummary() { $toolTip = $this->translator->trans( - 'Will return always true', - array(), + 'Unconditionnal usage', + [], 'condition' ); @@ -133,7 +122,7 @@ class MatchForEveryone extends ConditionAbstract */ protected function generateInputs() { - return array(); + return []; } /** diff --git a/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php b/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php index 272ec0a84..6b4b48f15 100644 --- a/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php +++ b/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition\Implementation; @@ -164,7 +153,7 @@ class MatchForTotalAmount extends ConditionAbstract { return $this->translator->trans( 'By cart total amount', - array(), + [], 'condition' ); } @@ -179,7 +168,7 @@ class MatchForTotalAmount extends ConditionAbstract { $toolTip = $this->translator->trans( 'Check the total Cart amount in the given currency', - array(), + [], 'condition' ); @@ -219,7 +208,7 @@ class MatchForTotalAmount extends ConditionAbstract protected function generateInputs() { $currencies = CurrencyQuery::create()->find(); - $cleanedCurrencies = array(); + $cleanedCurrencies = []; /** @var Currency $currency */ foreach ($currencies as $currency) { $cleanedCurrencies[$currency->getCode()] = $currency->getSymbol(); @@ -251,7 +240,7 @@ class MatchForTotalAmount extends ConditionAbstract { $labelPrice = $this->facade ->getTranslator() - ->trans('Price', array(), 'condition'); + ->trans('Cart total amount is', [], 'condition'); $html = $this->drawBackOfficeBaseInputsText($labelPrice, self::INPUT1); @@ -269,66 +258,17 @@ class MatchForTotalAmount extends ConditionAbstract */ protected function drawBackOfficeBaseInputsText($label, $inputKey) { - $operatorSelectHtml = $this->drawBackOfficeInputOperators(self::INPUT1); - $currencySelectHtml = $this->drawBackOfficeCurrencyInput(self::INPUT2); - $selectedAmount = ''; - if (isset($this->values) && isset($this->values[$inputKey])) { - $selectedAmount = $this->values[$inputKey]; - } + return $this->facade->getParser()->render('coupon/condition-fragments/cart-total-amount-condition.html', [ + 'label' => $label, + 'inputKey' => $inputKey, + 'value' => isset($this->values[$inputKey]) ? $this->values[$inputKey] : '', - $html = ' - -
-
- ' . $operatorSelectHtml . ' -
-
- -
-
- - ' . $currencySelectHtml . ' -
-
- '; + 'field_1_name' => self::INPUT1, + 'field_2_name' => self::INPUT2, - return $html; + 'operatorSelectHtml' => $this->drawBackOfficeInputOperators(self::INPUT1), + 'currencySelectHtml' => $this->drawBackOfficeCurrencyInput(self::INPUT2), + ] + ); } - - /** - * Draw the currency input displayed in the BackOffice - * allowing Admin to set its Coupon Conditions - * - * @param string $inputKey Input key (ex: self::INPUT1) - * - * @return string HTML string - */ - protected function drawBackOfficeCurrencyInput($inputKey) - { - $optionHtml = ''; - - $currencies = CurrencyQuery::create()->find(); - $cleanedCurrencies = array(); - /** @var Currency $currency */ - foreach ($currencies as $currency) { - $cleanedCurrencies[$currency->getCode()] = $currency->getSymbol(); - } - - foreach ($cleanedCurrencies as $key => $cleanedCurrency) { - $selected = ''; - if (isset($this->values) && isset($this->values[$inputKey]) && $this->values[$inputKey] == $key) { - $selected = ' selected="selected"'; - } - $optionHtml .= ''; - } - - $selectHtml = ' - - '; - - return $selectHtml; - } - -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Condition/Implementation/MatchForXArticles.php b/core/lib/Thelia/Condition/Implementation/MatchForXArticles.php index 8eeeec1c2..0e7c9d832 100644 --- a/core/lib/Thelia/Condition/Implementation/MatchForXArticles.php +++ b/core/lib/Thelia/Condition/Implementation/MatchForXArticles.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition\Implementation; @@ -138,8 +127,8 @@ class MatchForXArticles extends ConditionAbstract public function getName() { return $this->translator->trans( - 'By number of articles in cart', - array(), + 'Cart item count condition', + [], 'condition' ); } @@ -153,8 +142,8 @@ class MatchForXArticles extends ConditionAbstract public function getToolTip() { $toolTip = $this->translator->trans( - 'Check the amount of product in the Cart', - array(), + 'The cart item count should match the condition', + [], 'condition' ); @@ -174,7 +163,7 @@ class MatchForXArticles extends ConditionAbstract ); $toolTip = $this->translator->trans( - 'If cart products quantity is %operator% %quantity%', + 'If cart item count is %operator% %quantity%', array( '%operator%' => $i18nOperator, '%quantity%' => $this->values[self::INPUT1] @@ -211,7 +200,7 @@ class MatchForXArticles extends ConditionAbstract { $labelQuantity = $this->facade ->getTranslator() - ->trans('Quantity', array(), 'condition'); + ->trans('Cart item count is', [], 'condition'); $html = $this->drawBackOfficeBaseInputsText($labelQuantity, self::INPUT1); @@ -229,24 +218,11 @@ class MatchForXArticles extends ConditionAbstract */ protected function drawBackOfficeBaseInputsText($label, $inputKey) { - $operatorSelectHtml = $this->drawBackOfficeInputOperators($inputKey); - $quantitySelectHtml = $this->drawBackOfficeInputQuantityValues($inputKey, 20, 1); - - $html = ' -
- -
-
- ' . $operatorSelectHtml . ' -
-
- ' . $quantitySelectHtml . ' -
-
-
- '; - - return $html; + return $this->facade->getParser()->render('coupon/condition-fragments/cart-item-count-condition.html', [ + 'label' => $label, + 'operatorSelectHtml' => $this->drawBackOfficeInputOperators($inputKey), + 'quantitySelectHtml' => $this->drawBackOfficeInputQuantityValues($inputKey, 20, 1) + ] + ); } - -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Condition/Operators.php b/core/lib/Thelia/Condition/Operators.php index b6a8816ba..0d0600967 100644 --- a/core/lib/Thelia/Condition/Operators.php +++ b/core/lib/Thelia/Condition/Operators.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition; @@ -65,57 +54,57 @@ abstract class Operators switch ($operator) { case self::INFERIOR: $ret = $translator->trans( - 'inferior to', - array(), + 'Less than', + [], 'condition' ); break; case self::INFERIOR_OR_EQUAL: $ret = $translator->trans( - 'inferior or equal to', - array(), + 'Less than or equals', + [], 'condition' ); break; case self::EQUAL: $ret = $translator->trans( - 'equal to', - array(), + 'Equals', + [], 'condition' ); break; case self::SUPERIOR_OR_EQUAL: $ret = $translator->trans( - 'superior or equal to', - array(), + 'Greater than or equals', + [], 'condition' ); break; case self::SUPERIOR: $ret = $translator->trans( - 'superior to', - array(), + 'Greater than', + [], 'condition' ); break; case self::DIFFERENT: $ret = $translator->trans( - 'different from', - array(), + 'Not equals', + [], 'condition' ); break; case self::IN: $ret = $translator->trans( - 'in', - array(), + 'In', + [], 'condition' ); break; case self::OUT: $ret = $translator->trans( - 'not in', - array(), + 'Not in', + [], 'condition' ); break; @@ -124,4 +113,4 @@ abstract class Operators return $ret; } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Condition/SerializableCondition.php b/core/lib/Thelia/Condition/SerializableCondition.php index d147adbd2..8d8cf4a7d 100644 --- a/core/lib/Thelia/Condition/SerializableCondition.php +++ b/core/lib/Thelia/Condition/SerializableCondition.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition; @@ -36,9 +25,9 @@ class SerializableCondition public $conditionServiceId = null; /** @var array Operators set by Admin for this Condition */ - public $operators = array(); + public $operators = []; /** @var array Values set by Admin for this Condition */ - public $values = array(); + public $values = []; } diff --git a/core/lib/Thelia/Config/DatabaseConfiguration.php b/core/lib/Thelia/Config/DatabaseConfiguration.php index 6d74a03fb..9e5f50aa7 100644 --- a/core/lib/Thelia/Config/DatabaseConfiguration.php +++ b/core/lib/Thelia/Config/DatabaseConfiguration.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Config; diff --git a/core/lib/Thelia/Config/DefinePropel.php b/core/lib/Thelia/Config/DefinePropel.php index cd057ea20..063b490d8 100644 --- a/core/lib/Thelia/Config/DefinePropel.php +++ b/core/lib/Thelia/Config/DefinePropel.php @@ -1,26 +1,14 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ - namespace Thelia\Config; use Symfony\Component\Config\Definition\Processor; diff --git a/core/lib/Thelia/Config/I18n/cs_CZ.php b/core/lib/Thelia/Config/I18n/cs_CZ.php new file mode 100644 index 000000000..634c0e768 --- /dev/null +++ b/core/lib/Thelia/Config/I18n/cs_CZ.php @@ -0,0 +1,4 @@ + '"%param" parameter cannot be empty in loop type: %type, name: %name', + '"%param" parameter is missing in loop type: %type, name: %name' => '"%param" parameter is missing in loop type: %type, name: %name', '%obj SEO modification' => '%obj SEO modification', '%obj creation' => '%obj creation', '%obj modification' => '%obj modification', + '\'%type\' loop class should extends Thelia\Core\Template\Element\BaseLoop' => '\'%type\' loop class should extends Thelia\Core\Template\Element\BaseLoop', 'A currency with code "%name" already exists.' => 'A currency with code "%name" already exists.', + 'A loop named \'%name\' already exists in the current scope.' => 'A loop named \'%name\' already exists in the current scope.', 'A message with name "%name" already exists.' => 'A message with name "%name" already exists.', + 'A product with reference %ref already exists. Please choose another reference.' => 'A product with reference %ref already exists. Please choose another reference.', + 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.' => 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.', + 'A value for attribute "%name" is already present in the combination' => 'A value for attribute "%name" is already present in the combination', 'A variable with name "%name" already exists.' => 'A variable with name "%name" already exists.', 'Activate logs only for these IP Addresses' => 'Activate logs only for these IP Addresses', 'Activate logs only for these files' => 'Activate logs only for these files', 'Add to all product templates' => 'Add to all product templates', 'Additional address' => 'Additional address', + 'Address ID not found' => 'Address ID not found', 'Address Line 2' => 'Address Line 2', 'Address Line 3' => 'Address Line 3', 'Address label' => 'Address label', + 'Administrator ID not found' => 'Administrator ID not found', 'Advertise this product as new' => 'Advertise this product as new', 'Alerts' => 'Alerts', 'Alpha code 2 *' => 'Alpha code 2 *', 'Alpha code 3 *' => 'Alpha code 3 *', - 'Amount removed from the cart' => 'Amount removed from the cart', 'Apply exchange rates on price in %sym' => 'Apply exchange rates on price in %sym', - 'Area' => 'Area', 'Attribute ID:Attribute AV ID' => 'Attribute ID:Attribute AV ID', 'Auth mode' => 'Auth mode', 'Available quantity' => 'Available quantity', 'Available quantity *' => 'Available quantity *', + 'Available shipping zones' => 'Available shipping zones', + 'Bad tax list JSON' => 'Bad tax list JSON', 'Business ID' => 'Business ID', + 'By cart total amount' => 'By cart total amount', 'Cannot find a default country. Please define one.' => 'Cannot find a default country. Please define one.', 'Cannot find the shop country. Please select a shop country.' => 'Cannot find the shop country. Please select a shop country.', + 'Cannot instanciante module "%name%": the namespace is null. Maybe the model is not loaded ?' => 'Cannot instanciante module "%name%": the namespace is null. Maybe the model is not loaded ?', + 'Cart item count condition' => 'Cart item count condition', + 'Cart item count is' => 'Cart item count is', + 'Cart total amount is' => 'Cart total amount is', 'Category title *' => 'Category title *', 'Cellphone' => 'Cellphone', 'Chapo' => 'Chapo', + 'Check the total Cart amount in the given currency' => 'Check the total Cart amount in the given currency', 'City' => 'City', 'Combination builder' => 'Combination builder', 'Compagny' => 'Compagny', @@ -41,31 +56,53 @@ return array( 'Constant amount found in one of the product\'s feature' => 'Constant amount found in one of the product\'s feature', 'Content title *' => 'Content title *', 'Country' => 'Country', + 'Country ID not found' => 'Country ID not found', 'Country area' => 'Country area', 'Country title *' => 'Country title *', 'Critical' => 'Critical', 'Current Password' => 'Current Password', + 'Date \'%date\' is invalid, please enter a valid date using %fmt format' => 'Date \'%date\' is invalid, please enter a valid date using %fmt format', 'Debug' => 'Debug', 'Default folder *' => 'Default folder *', 'Default product category *' => 'Default product category *', 'Default product sale element' => 'Default product sale element', + 'Deleting document for %id% with parent id %parentId%' => 'Deleting document for %id% with parent id %parentId%', + 'Deleting image for %id% with parent id %parentId%' => 'Deleting image for %id% with parent id %parentId%', + 'Delivery module ID not found' => 'Delivery module ID not found', 'Description' => 'Description', 'Detailed description' => 'Detailed description', 'Disabled' => 'Disabled', + 'Discount amount' => 'Discount amount', + 'Document deleted successfully' => 'Document deleted successfully', + 'Document position updated' => 'Document position updated', 'EAN Code' => 'EAN Code', 'Email Address' => 'Email Address', 'Email address' => 'Email address', 'Emergency' => 'Emergency', 'Enable remote SMTP use' => 'Enable remote SMTP use', 'Encryption' => 'Encryption', + 'Equals' => 'Equals', + 'Error during %action process : %error. Exception was %exc' => 'Error during %action process : %error. Exception was %exc', + 'Error occured while processing order ref. %ref, ID %id: %err' => 'Error occured while processing order ref. %ref, ID %id: %err', 'Errors' => 'Errors', + 'Fail to delete document for %id% with parent id %parentId% (Exception : %e%)' => 'Fail to delete document for %id% with parent id %parentId% (Exception : %e%)', + 'Fail to delete image for %id% with parent id %parentId% (Exception : %e%)' => 'Fail to delete image for %id% with parent id %parentId% (Exception : %e%)', + 'Fail to update document position' => 'Fail to update document position', + 'Fail to update image position' => 'Fail to update image position', + 'Failed to create instance of module "%name%" when trying to delete module. Module directory has probably been deleted' => 'Failed to create instance of module "%name%" when trying to delete module. Module directory has probably been deleted', + 'Failed to find a payment Module with ID=%mid for order ID=%oid' => 'Failed to find a payment Module with ID=%mid for order ID=%oid', + 'Failed to open translation file %file. Please be sure that this file is writable by your Web server' => 'Failed to open translation file %file. Please be sure that this file is writable by your Web server', 'Failed to update language definition: %ex' => 'Failed to update language definition: %ex', 'Fax' => 'Fax', 'Feature value does not match FLOAT format' => 'Feature value does not match FLOAT format', + 'File is too heavy, please retry with a file having a size less than %size%.' => 'File is too Large, please retry with a file having a size less than %size%.', 'First Name' => 'First Name', 'Firstname' => 'Firstname', + 'Fixed Amount Discount' => 'Fixed Amount Discount', 'Folder title *' => 'Folder title *', 'Full Name' => 'Full Name', + 'Greater than' => 'Greater than', + 'Greater than or equals' => 'Greater than or equals', 'HTML Message' => 'HTML Message', 'Host' => 'Host', 'I would like to receive the newsletter or the latest news.' => 'I would like to receive the newsletter or the latest news.', @@ -73,21 +110,41 @@ return array( 'ISO 639-1 Code' => 'ISO 639-1 Code', 'ISO Code *' => 'ISO Code *', 'If a translation is missing or incomplete :' => 'If a translation is missing or incomplete :', + 'If cart item count is %operator% %quantity%' => 'If cart item count is %operator% %quantity%', + 'If cart total amount is %operator% %amount% %currency%' => 'If cart total amount is %operator% %amount% %currency%', + 'Image position updated' => 'Image position updated', + 'Images deleted successfully' => 'Images deleted successfully', + 'Impossible to delete a customer who already have orders' => 'Impossible to delete a customer who already have orders', + 'In' => 'In', 'Information' => 'Information', 'Invalid product_sale_elements' => 'Invalid product_sale_elements', + 'Invalid value "%value" for "%param" parameter in loop type: %type, name: %name' => 'Invalid value "%value" for "%param" parameter in loop type: %type, name: %name', 'Invalid value for walkMode parameter: %value' => 'Invalid value for walkMode parameter: %value', 'Is it the default product sale element ?' => 'Is it the default product sale element ?', 'Language name' => 'Language name', 'Last Name' => 'Last Name', 'Lastname' => 'Lastname', + 'Less than' => 'Less than', + 'Less than or equals' => 'Less than or equals', 'Log format *' => 'Log format *', 'Log level *' => 'Log level *', 'Login' => 'Login', 'Login failed. Please check your username and password.' => 'Login failed. Please check your username and password.', + 'Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`' => 'Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', + 'Loop must implements \'PropelSearchLoopInterface\' to be timestampable' => 'Loop must implements \'PropelSearchLoopInterface\' to be timestampable', + 'Loop must implements \'PropelSearchLoopInterface\' to be versionable' => 'Loop must implements \'PropelSearchLoopInterface\' to be versionable', + 'Loop must implements one of the following interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`' => 'Loop must implements one of the following interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', + 'Loop type \'%type\' is not defined.' => 'Loop type \'%type\' is not defined.', 'Make this address as my primary address' => 'Make this address as my primary address', 'Message subject' => 'Message subject', 'Meta Description' => 'Meta Description', 'Meta Keywords' => 'Meta Keywords', + 'Missing \'name\' parameter in loop arguments' => 'Missing \'name\' parameter in loop arguments', + 'Missing \'rel\' parameter in ifloop/elseloop arguments' => 'Missing \'rel\' parameter in ifloop/elseloop arguments', + 'Missing \'rel\' parameter in page loop' => 'Missing \'rel\' parameter in page loop', + 'Missing \'type\' parameter in loop arguments' => 'Missing \'type\' parameter in loop arguments', + 'Missing \'type\' parameter in {count} loop arguments' => 'Missing \'type\' parameter in {count} loop arguments', + 'Module ID not found' => 'Module ID not found', 'Name' => 'Name', 'Name *' => 'Name *', 'Name of the HTML layout file' => 'Name of the HTML layout file', @@ -97,17 +154,27 @@ return array( 'New Password' => 'New Password', 'No %obj was created.' => 'No %obj was created.', 'No %obj was updated.' => 'No %obj was updated.', + 'No module found for code \'%item\'' => 'No module found for code \'%item\'', + 'No pagination currently defined for loop name \'%name\'' => 'No pagination currently defined for loop name \'%name\'', 'No, I am a new customer.' => 'No, I am a new customer.', + 'Not equals' => 'Not equals', + 'Not found' => 'Not found', + 'Not in' => 'Not in', 'Notices' => 'Notices', + 'Order address ID not found' => 'Order address ID not found', + 'Order ref. %ref is now unpaid.' => 'Order ref. %ref is now unpaid.', + 'Order ref. %ref, ID %id has been successfully paid.' => 'Order ref. %ref, ID %id has been successfully paid.', 'Page Title' => 'Page Title', 'Parent category *' => 'Parent category *', 'Parent folder *' => 'Parent folder *', 'Password' => 'Password', 'Password *' => 'Password *', 'Password confirmation' => 'Password confirmation', + 'Percent Discount' => 'Percent Discount', 'Percentage of the product price' => 'Percentage of the product price', - 'Percentage removed from the cart' => 'Percentage removed from the cart', 'Phone' => 'Phone', + 'Please accept the Terms and conditions in order to register.' => 'Please accept the Terms and conditions in order to register.', + 'Please check your input: %error' => 'Please check your input: %error', 'Please enter your email address' => 'Please enter your email address', 'Please enter your password' => 'Please enter your password', 'Please specify either \'path\' or \'file\' parameter in {url} function.' => 'Please specify either \'path\' or \'file\' parameter in {url} function.', @@ -117,12 +184,14 @@ return array( 'Preferred locale' => 'Preferred locale', 'Prevent mailing template modification or deletion, except for super-admin' => 'Prevent mailing template modification or deletion, except for super-admin', 'Prevent variable modification or deletion, except for super-admin' => 'Prevent variable modification or deletion, except for super-admin', - 'Price' => 'Price', 'Price currency *' => 'Price currency *', + 'Processing cancelation of payment for order ref. %ref' => 'Processing cancelation of payment for order ref. %ref', + 'Processing confirmation of order ref. %ref, ID %id' => 'Processing confirmation of order ref. %ref, ID %id', 'Prodcut ID *' => 'Prodcut ID *', 'Product ID' => 'Product ID', 'Product ID *' => 'Product ID *', 'Product base price excluding taxes *' => 'Product base price excluding taxes *', + 'Product base price with taxes' => 'Product base price with taxes', 'Product price excluding taxes' => 'Product price excluding taxes', 'Product price excluding taxes *' => 'Product price excluding taxes *', 'Product price including taxes' => 'Product price including taxes', @@ -133,6 +202,8 @@ return array( 'ProductSaleElement modification' => 'ProductSaleElement modification', 'Profile' => 'Profile', 'Profile Code' => 'Profile Code', + 'Profile ID not found' => 'Profile ID not found', + 'Profile `code` already exists' => 'Profile `code` already exists', 'Purpose *' => 'Purpose *', 'Quantity' => 'Quantity', 'Rate from € *' => 'Rate from € *', @@ -140,8 +211,8 @@ return array( 'Redirecting to %url' => 'Redirecting to %url', 'Reference' => 'Reference', 'Reference *' => 'Reference *', + 'Related loop name \'%name\'\' is not defined.' => 'Related loop name \'%name\'\' is not defined.', 'Remember me ?' => 'Remember me ?', - 'Remove X amount to total cart' => 'Remove X amount to total cart', 'Remove X percent to total cart' => 'Remove X percent to total cart', 'Replace by the default language' => 'Replace by the default language', 'Replace current document by this file' => 'Replace current document by this file', @@ -150,11 +221,16 @@ return array( 'Rotated Text File' => 'Rotated Text File', 'Sale price excluding taxes' => 'Sale price excluding taxes', 'Sale price including taxes' => 'Sale price including taxes', + 'Saving documents for %parentName% parent id %parentId% (%parentType%)' => 'Saving documents for %parentName% parent id %parentId% (%parentType%)', + 'Saving images for %parentName% parent id %parentId% (%parentType%)' => 'Saving images for %parentName% parent id %parentId% (%parentType%)', + 'Shipping zone name' => 'Shipping zone name', 'Show redirections *' => 'Show redirections *', 'Sorry, an error occured: %msg' => 'Sorry, an error occured: %msg', + 'Sorry, an error occurred: %err' => 'Sorry, an error occurred: %err', 'Sorry, you are not allowed to perform this action.' => 'Sorry, you are not allowed to perform this action.', 'Sorry, you\'re not allowed to perform this action' => 'Sorry, you\'re not allowed to perform this action', 'Source IP' => 'Source IP', + 'Stats on %month/%year' => 'Stats on %month/%year', 'Store configuration failed.' => 'Store configuration failed.', 'Store email address' => 'Store email address', 'Store logs into text file' => 'Store logs into text file', @@ -167,65 +243,70 @@ return array( 'Summary' => 'Summary', 'Symbol *' => 'Symbol *', 'System log configuration failed.' => 'System log configuration failed.', + 'Tax ID not found in tax list JSON' => 'Tax ID not found in tax list JSON', + 'Tax list is not valid JSON' => 'Tax list is not valid JSON', + 'Tax rule ID not found' => 'Tax rule ID not found', 'Tax rule for this product *' => 'Tax rule for this product *', 'Template Name *' => 'Template Name *', 'Template file %file cannot be found.' => 'Template file %file cannot be found.', 'Text File' => 'Text File', 'Text Message' => 'Text Message', + 'The TaxEngine should be passed to this form before using it.' => 'The TaxEngine should be passed to this form before using it.', + 'The cart item count should match the condition' => 'The cart item count should match the condition', + 'The image which replaces an undefined country flag (%file) was not found. Please check unknown-flag-path configuration variable, and check that the image exists.' => 'The image which replaces an undefined country flag (%file) was not found. Please check unknown-flag-path configuration variable, and check that the image exists.', + 'The loop name \'%name\' is already defined in %className class' => 'The loop name \'%name\' is already defined in %className class', 'This category is online.' => 'This category is online.', + 'This condition is always true' => 'This condition is always true', 'This content is online.' => 'This content is online.', + 'This coupon does not exists' => 'This coupon does not exists', + 'This coupon will offert a flat percentage off a shopper\'s entire order (not applied to shipping costs or tax rates). If the discount is greater than the total order corst, the customer will only pay the shipping, or nothing if the coupon also provides free shipping.' => 'This coupon will offert a flat percentage off a shopper\'s entire order (not applied to shipping costs or tax rates). If the discount is greater than the total order corst, the customer will only pay the shipping, or nothing if the coupon also provides free shipping.', + 'This coupon will subtracts a set amount from the total cost of an order. If the discount is greater than the total order corst, the customer will only pay the shipping, or nothing if the coupon also provides free shipping.' => 'This coupon will subtracts a set amount from the total cost of an order. If the discount is greater than the total order corst, the customer will only pay the shipping, or nothing if the coupon also provides free shipping.', + 'This email already exists.' => 'This email already exists.', + 'This email does not exists' => 'This email does not exists', 'This extension must be installed and loaded' => 'This extension must be installed and loaded', 'This folder is online.' => 'This folder is online.', + 'This login already exists' => 'This login already exists', 'This product is on sale' => 'This product is on sale', 'This product is online' => 'This product is online', + 'This product_sale_elements_id does not exists for this product : %d' => 'This product_sale_elements_id does not exists for this product : %d', + 'This template is in use in some of your products, and cannot be deleted. Delete it from all your products and try again.' => 'This template is in use in some of your products, and cannot be deleted. Delete it from all your products and try again.', + 'This value should not be blank.' => 'This value should not be blank.', 'Timeout' => 'Timeout', 'Title' => 'Title', 'Title *' => 'Title *', + 'Title ID not found' => 'Title ID not found', 'Type' => 'Type', + 'Unable to process your request. Please try again (%err).' => 'Unable to process your request. Please try again (%err).', + 'Unavailable' => 'Unavailable', + 'Unconditional usage' => 'Unconditional usage', + 'Unconditionnal usage' => 'Unconditionnal usage', + 'Undefined loop argument "%name"' => 'Undefined loop argument "%name"', + 'Undefined search mode \'%mode\'' => 'Undefined search mode \'%mode\'', + 'Undefined translation type: %item' => 'Undefined translation type: %item', + 'Unknown order ID: %id' => 'Unknown order ID: %id', + 'Unsupported magic method %name. only getArgname() is supported.' => 'Unsupported magic method %name. only getArgname() is supported.', 'Username' => 'Username', 'Username *' => 'Username *', 'Value' => 'Value', 'Value *' => 'Value *', 'Warnings' => 'Warnings', 'Weight' => 'Weight', - 'Weight *' => 'Weight *', 'Yes, I have a password :' => 'Yes, I have a password :', + 'You are already registered!' => 'You are already registered!', + 'You can only upload images (.png, .jpg, .jpeg, .gif)' => 'You can only upload images (.png, .jpg, .jpeg, .gif)', 'Your Email Address' => 'Your Email Address', 'Your Message' => 'Your Message', + 'Your current password does not match.' => 'Your current password does not match.', 'Zip code' => 'Zip code', 'date format' => 'date format', + 'delivery module %s is not a Thelia\Module\DeliveryModuleInterface' => 'delivery module %s is not a Thelia\Module\DeliveryModuleInterface', 'language locale' => 'language locale', 'mailing system modification' => 'mailing system modification', - 'shipping area name' => 'shipping area name', - 'time format' => 'time format', - 'This value should not be blank.' => 'This value should not be blank.', - 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.' => 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.', - 'Administrator ID not found' => 'Administrator ID not found', - 'This login already exists' => 'This login already exists', 'password confirmation is not the same as password field' => 'password confirmation is not the same as password field', 'password must be composed of at least 4 characters' => 'password must be composed of at least 4 characters', - 'this product id does not exists : %d' => 'this product id does not exists : %d', - 'This product_sale_elements_id does not exists for this product : %d' => 'This product_sale_elements_id does not exists for this product : %d', + 'payment module %s is not a Thelia\Module\PaymentModuleInterface' => 'payment module %s is not a Thelia\Module\PaymentModuleInterface', + 'permanent discount (in percent)' => 'permanent discount (in percent)', 'quantity value is not valid' => 'quantity value is not valid', - 'Please accept the Terms and conditions in order to register.' => 'Please accept the Terms and conditions in order to register.', - 'This email already exists.' => 'This email already exists.', - 'This email does not exists' => 'This email does not exists', - 'Your current password does not match.' => 'Your current password does not match.', - 'Module ID not found' => 'Module ID not found', - 'You are already registered!' => 'You are already registered!', - 'Address ID not found' => 'Address ID not found', - 'Delivery module ID not found' => 'Delivery module ID not found', - 'delivery module %s is not a Thelia\Module\DeliveryModuleInterface' => 'delivery module %s is not a Thelia\Module\DeliveryModuleInterface', - 'Order address ID not found' => 'Order address ID not found', - 'Title ID not found' => 'Title ID not found', - 'Country ID not found' => 'Country ID not found', - 'Profile `code` already exists' => 'Profile `code` already exists', - 'Profile ID not found' => 'Profile ID not found', - 'The TaxEngine should be passed to this form before using it.' => 'The TaxEngine should be passed to this form before using it.', - 'Tax rule ID not found' => 'Tax rule ID not found', - 'Tax list is not valid JSON' => 'Tax list is not valid JSON', - 'Bad tax list JSON' => 'Bad tax list JSON', - 'Tax ID not found in tax list JSON' => 'Tax ID not found in tax list JSON', - 'Please check your input: %s' => 'Please check your input: %s', - 'Sorry, an error occured: %s' => 'Sorry, an error occured: %s', + 'this product id does not exists : %d' => 'this product id does not exists : %d', + 'time format' => 'time format', ); diff --git a/core/lib/Thelia/Config/I18n/fr_FR.php b/core/lib/Thelia/Config/I18n/fr_FR.php index ab7492dd6..bf413a362 100644 --- a/core/lib/Thelia/Config/I18n/fr_FR.php +++ b/core/lib/Thelia/Config/I18n/fr_FR.php @@ -1,36 +1,51 @@ 'Le paramètre "%param" ne peut être vide dans la boucle type: %type, nom: %name ', + '"%param" parameter is missing in loop type: %type, name: %name' => 'Le paramètre "%param" est absent dans la boucle type: %type, nom: %name ', '%obj SEO modification' => 'Modification SEO de %obj', '%obj creation' => 'Création de %obj', '%obj modification' => 'Modification de %obj', + '\'%type\' loop class should extends Thelia\Core\Template\Element\BaseLoop' => 'La classe de boucle \'%type\' doit hériter de Thelia\Core\Template\Element\BaseLoop ', 'A currency with code "%name" already exists.' => 'Une devise avec la code "%name" existe déjà', + 'A loop named \'%name\' already exists in the current scope.' => 'Une boucle nommée \'%name\' existe déjà dans le scope courant', 'A message with name "%name" already exists.' => 'Un message avec le nom "%name" existe déjà.', + 'A product with reference %ref already exists. Please choose another reference.' => 'Un produit portant la référfence %ref existe déja. Merci de choisir une autre référence.', + 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.' => 'Un utilisateur existe déjà avec cette adresse email. Connectez-vous ou demandez une réinitialisation de votre mot de passe.', + 'A value for attribute "%name" is already present in the combination' => 'Une valeur pour la déclinaison "%name" est déjà présente dans la combinaison', 'A variable with name "%name" already exists.' => 'Une variable avec le nom "%name" existe déjà.', 'Activate logs only for these IP Addresses' => 'Activer les logs uniquement pour ces adresses IP', 'Activate logs only for these files' => 'Activer les logs uniquement pour ces fichiers', 'Add to all product templates' => 'Ajouter à tous les templates produit', 'Additional address' => 'Adresse complémentaire', - 'Address Line 2' => 'Adresse 1', - 'Address Line 3' => 'Adresse 2', - 'Address label' => 'Adresse', + 'Address ID not found' => 'ID de l\'adresse non trouvé', + 'Address Line 2' => 'Adresse suite', + 'Address Line 3' => 'Adresse suite', + 'Address label' => 'Libellé', + 'Administrator ID not found' => 'ID de l\'administrateur not trouvé', 'Advertise this product as new' => 'Afficher ce produit comme nouveau', 'Alerts' => 'Alertes', 'Alpha code 2 *' => 'Code Alpha 2 *', 'Alpha code 3 *' => 'Code Alpha 3 *', - 'Amount removed from the cart' => 'Montant déduit du panier', 'Apply exchange rates on price in %sym' => 'Appliquer le taux de change sur le prix en %sym', - 'Area' => 'Zone', 'Attribute ID:Attribute AV ID' => 'Déclinaison ID : Valeur de déclinaison ID', 'Auth mode' => 'Mode d\'authentification', 'Available quantity' => 'Quantité disponible', 'Available quantity *' => 'Quantité disponible *', + 'Available shipping zones' => 'Zones de livraison disponibles', + 'Bad tax list JSON' => 'Mauvais JSON de la liste des taxes', 'Business ID' => 'ID du business', + 'By cart total amount' => 'Montant total du panier', 'Cannot find a default country. Please define one.' => 'Impossible de trouver un pays par défaut. Veuillez en définir un.', 'Cannot find the shop country. Please select a shop country.' => 'Impossible de trouver le pays du magasin. Veuillez en sélectionner un.', + 'Cannot instanciante module "%name%": the namespace is null. Maybe the model is not loaded ?' => 'Ne peut instancier le module "%name%": le namespace est null. Peut-être que le modèle n\'est pas chargé ?', + 'Cart item count condition' => 'Nombre d\'articles dans le panier', + 'Cart item count is' => 'Le nombre d\'articles dans le panier est', + 'Cart total amount is' => 'Le total du panier est', 'Category title *' => 'Titre de la catégorie *', 'Cellphone' => 'Numéro de portable', 'Chapo' => 'Chapeau', + 'Check the total Cart amount in the given currency' => 'Applique une condition sur le montant total du panier dans la devise indiquée.', 'City' => 'Ville', 'Combination builder' => 'générateur de combinaison', 'Compagny' => 'Société', @@ -41,31 +56,53 @@ return array( 'Constant amount found in one of the product\'s feature' => 'Montant fixe trouvé depuis une caractéristique produit', 'Content title *' => 'Titre du contenu *', 'Country' => 'Pays', + 'Country ID not found' => 'ID du pays non trouvé', 'Country area' => 'Zone du pays', 'Country title *' => 'Pays *', 'Critical' => 'Critique', 'Current Password' => 'Mot de passe actuel.', + 'Date \'%date\' is invalid, please enter a valid date using %fmt format' => 'La date \'%date\' est incorrecte, merci d\'indiquer une date au format %fmt', 'Debug' => 'Debug', 'Default folder *' => 'Dossier par défaut *', 'Default product category *' => 'Catégorie du produit par défaut *', 'Default product sale element' => 'Product Sale Element par défaut', + 'Deleting document for %id% with parent id %parentId%' => 'Suppression du document %id% avec l\'ID parent %parentId%', + 'Deleting image for %id% with parent id %parentId%' => 'Suppression de l\'image %id% avec l\'ID parent %parentId%', + 'Delivery module ID not found' => 'Id du module de livraison non trouvé', 'Description' => 'Description', 'Detailed description' => 'Description détaillée', 'Disabled' => 'Désactivé', + 'Discount amount' => 'Montant de la remise', + 'Document deleted successfully' => 'Le document a été supprimé.', + 'Document position updated' => 'La position du document a été modfiée', 'EAN Code' => 'Code EAN', 'Email Address' => 'Adresse mail', 'Email address' => 'Adresse e-mail', 'Emergency' => 'Urgence', 'Enable remote SMTP use' => 'Activer l\'utilisation d\'un serveur SMTP distant.', 'Encryption' => 'Chiffrement', + 'Equals' => 'Egal à', + 'Error during %action process : %error. Exception was %exc' => 'Erreur lors de %action: %error. Exception: %exc ', + 'Error occured while processing order ref. %ref, ID %id: %err' => 'Un erreur est survenue paedant le traitement de la commande ref. %ref, ID %id; %err', 'Errors' => 'Erreurs', + 'Fail to delete document for %id% with parent id %parentId% (Exception : %e%)' => 'Echec lors de la suppression du document %id% avec l\'ID parent %parentId% (Exception : %e%)', + 'Fail to delete image for %id% with parent id %parentId% (Exception : %e%)' => 'Echec lors de la suppression de l\'image %id% avec l\'ID parent %parentId% (Exception : %e%)', + 'Fail to update document position' => 'La position du document e n\'a pas pu être modfiée', + 'Fail to update image position' => 'La position de l\'image n\'a pas pu être modfiée', + 'Failed to create instance of module "%name%" when trying to delete module. Module directory has probably been deleted' => 'Ne peut créer une instance du module "%name%" lors de la suppression du module. Le répertoire du module à sans doute été supprimé manuellement.', + 'Failed to find a payment Module with ID=%mid for order ID=%oid' => 'Ne peut trouver le module de paiement ID=%mid pour la commande ID=%oid ', + 'Failed to open translation file %file. Please be sure that this file is writable by your Web server' => 'L\'ouverture du fichier %file a échoué. Merci de vérifier que ce fichier est accessible en écriture pour votre serveur Web.', 'Failed to update language definition: %ex' => 'Erreur lors de la mise à jour de la définition de la langue : %ex', 'Fax' => 'Fax', 'Feature value does not match FLOAT format' => 'valeur de caractéristique n\'est pas un FLOAT', + 'File is too heavy, please retry with a file having a size less than %size%.' => 'La taille du fichier est trop importante, et doit être inféreiure à %size%.', 'First Name' => 'Prénom', 'Firstname' => 'Prénom', + 'Fixed Amount Discount' => 'Remise d\'un montant fixe', 'Folder title *' => 'Titre du dossier *', 'Full Name' => 'Nom complet', + 'Greater than' => 'Supérieur à', + 'Greater than or equals' => 'Supérieur ou égal à', 'HTML Message' => 'Message au format HTML', 'Host' => 'Nom de l\'hôte', 'I would like to receive the newsletter or the latest news.' => 'Je souhaite recevoir la lettre d\'information ou les dernières actualités.', @@ -73,21 +110,41 @@ return array( 'ISO 639-1 Code' => 'Code ISO 639-1', 'ISO Code *' => 'Code ISO *', 'If a translation is missing or incomplete :' => 'Si une traduction est manquante ou incomplète :', + 'If cart item count is %operator% %quantity%' => 'Le nombre d\'articles dans le panier est %operator% %quantity% ', + 'If cart total amount is %operator% %amount% %currency%' => 'Si le total du panier est %operator% %amount% %currency% ', + 'Image position updated' => 'La position de l\'image a été modfiée', + 'Images deleted successfully' => 'L\'image a été supprimée.', + 'Impossible to delete a customer who already have orders' => 'Impossible de supprimer un client si celui-ci a déjà une commande', + 'In' => 'Compris dans', 'Information' => 'Information', 'Invalid product_sale_elements' => 'product_sale_elements invalide', + 'Invalid value "%value" for "%param" parameter in loop type: %type, name: %name' => 'La valeur "%value" est invalide pour le paramètre "%param" dans la boucle type: %type, nom: %name ', 'Invalid value for walkMode parameter: %value' => 'Valeur incorrecte pour le paramètre walkMode : %value', 'Is it the default product sale element ?' => 'Product Sale Element par défaut ?', 'Language name' => 'Nom de la langue', 'Last Name' => 'Nom', 'Lastname' => 'Nom', + 'Less than' => 'Inférieur à', + 'Less than or equals' => 'Inférieur ou égal à', 'Log format *' => 'Format des logs *', 'Log level *' => 'Niveau de log *', 'Login' => 'Connexion', 'Login failed. Please check your username and password.' => 'Erreur de login. Veuillez vérifier votre login et votre mot de passe.', + 'Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`' => 'Une boucle ne peut implémenter plusieurs Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', + 'Loop must implements \'PropelSearchLoopInterface\' to be timestampable' => 'Les classes \'boucle\' doivent implémenter \'PropelSearchLoopInterface\' pour être horodatables', + 'Loop must implements \'PropelSearchLoopInterface\' to be versionable' => 'Les classes \'boucle\' doivent implémenter \'PropelSearchLoopInterface\' pour être versonnables', + 'Loop must implements one of the following interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`' => 'Une boucle doit implémenter au moins une de ces interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', + 'Loop type \'%type\' is not defined.' => 'La boucle de type \'%type\' n\'existe pas.', 'Make this address as my primary address' => 'Choisir cette adresse comme adresse par défaut', 'Message subject' => 'Sujet', 'Meta Description' => 'Meta description', 'Meta Keywords' => 'Meta keywords', + 'Missing \'name\' parameter in loop arguments' => 'Le paramètre obligatoire \'name\' est absent des paramètre de la boucle', + 'Missing \'rel\' parameter in ifloop/elseloop arguments' => 'Le paramètre obligatoire \'rel\' est absent des paramètre de la boucle ifloop/elseloop', + 'Missing \'rel\' parameter in page loop' => 'Le paramètre obligatoire \'rel\' est absent des paramètre de la boucle \'page\'', + 'Missing \'type\' parameter in loop arguments' => 'Le paramètre obligatoire \'type\' est absent des paramètre de la boucle ', + 'Missing \'type\' parameter in {count} loop arguments' => 'Le paramètre obligatoire \'type\' est absent des paramètre de la boucle {count}', + 'Module ID not found' => 'Id du module non trouvé', 'Name' => 'Nom', 'Name *' => 'Nom *', 'Name of the HTML layout file' => 'Nom du layout HTML', @@ -97,17 +154,27 @@ return array( 'New Password' => 'Nouveau mot de passe.', 'No %obj was created.' => 'aucun %obj n\'a été créé.', 'No %obj was updated.' => 'Aucun %obj mis à jour', + 'No module found for code \'%item\'' => 'Aucun module trouvé pour \'%item\' ', + 'No pagination currently defined for loop name \'%name\'' => 'La pagination n\'est pas définie pour la boucle \'%name\'', 'No, I am a new customer.' => 'Non, je suis un nouveau client.', + 'Not equals' => 'Différent de', + 'Not found' => 'Non trouvé.', + 'Not in' => 'Non compris dans', 'Notices' => 'Notices', + 'Order address ID not found' => 'ID de l\'adresse de la commande non trouvé', + 'Order ref. %ref is now unpaid.' => 'La commande %ref, ID %id est désormais non payée', + 'Order ref. %ref, ID %id has been successfully paid.' => 'La commande ref. %ref, ID %id a été correctement payée', 'Page Title' => 'Titre de la page', 'Parent category *' => 'Catégorie parente *', 'Parent folder *' => 'Dossier parent *', 'Password' => 'Mot de passe', 'Password *' => 'Mot de passe *', 'Password confirmation' => 'Confirmation du mot de passe.', + 'Percent Discount' => 'Remise en pourcentage de la commande', 'Percentage of the product price' => 'Pourcentage du prix du produit', - 'Percentage removed from the cart' => 'Pourcentage déduit du panier', 'Phone' => 'Téléphone', + 'Please accept the Terms and conditions in order to register.' => 'Veuillez accepter les termes et conditions pour vous inscrire.', + 'Please check your input: %error' => 'Merci de vérifier votre saisie: %error', 'Please enter your email address' => 'Renseignez votre adresse mail', 'Please enter your password' => 'Entrez votre mot de passe.', 'Please specify either \'path\' or \'file\' parameter in {url} function.' => 'Veuillez spécifier soit le paramètre \'chemin\' ou \'fichier\' dans la fonction {url}', @@ -117,12 +184,14 @@ return array( 'Preferred locale' => 'locale souhaitée', 'Prevent mailing template modification or deletion, except for super-admin' => 'Prévenir la suppression ou la modification ds templates de mail, excepté pour les super-administrateurs.', 'Prevent variable modification or deletion, except for super-admin' => 'Prévenir la suppression ou la modification de variables, excepté pour les super-administrateurs.', - 'Price' => 'Prix', 'Price currency *' => 'Devise *', + 'Processing cancelation of payment for order ref. %ref' => 'Traitement de l\'annulation du paiement de la commande %ref, ID %id', + 'Processing confirmation of order ref. %ref, ID %id' => 'Traitement de la confirmation de la commande %ref, ID %id', 'Prodcut ID *' => 'ID du produit *', 'Product ID' => 'ID produit', 'Product ID *' => 'ID produit *', 'Product base price excluding taxes *' => 'Prix du produit Hors Taxe *', + 'Product base price with taxes' => 'Prix du produit TTC', 'Product price excluding taxes' => 'Prix du produit Hors Taxes', 'Product price excluding taxes *' => 'prix HT', 'Product price including taxes' => 'Prix du produit taxes incluses', @@ -133,14 +202,17 @@ return array( 'ProductSaleElement modification' => 'Modification de ProductSaleElement.', 'Profile' => 'Profil', 'Profile Code' => 'Profil', + 'Profile ID not found' => 'ID du profil non trouvé', + 'Profile `code` already exists' => 'Le `code` du profil existe déjà', 'Purpose *' => 'Objet', + 'Quantity' => 'Quantité', 'Rate from € *' => 'Taux à partie de l\'€ *', 'Redirecting ...' => 'Redirection ...', 'Redirecting to %url' => 'Redirection vers %url', 'Reference' => 'Référence', 'Reference *' => 'Référence *', + 'Related loop name \'%name\'\' is not defined.' => 'La boucle \'%name\' n\'est pas définie.', 'Remember me ?' => 'Se souvenir de moi ?', - 'Remove X amount to total cart' => 'Enlève un montant fixe du total du panier', 'Remove X percent to total cart' => 'Enlève un pourcentage du panier total', 'Replace by the default language' => 'Remplacer par la langue par défaut', 'Replace current document by this file' => 'Remplacer le document courant par ce fichier', @@ -149,11 +221,16 @@ return array( 'Rotated Text File' => 'Rotation du fichier texte', 'Sale price excluding taxes' => 'Prix de vente Hors Taxes', 'Sale price including taxes' => 'Prix de vente Toutes Taxes Comprises', + 'Saving documents for %parentName% parent id %parentId% (%parentType%)' => 'Enregistrement des documents pour %parentName% ID parent %parentId% (%parentType%)', + 'Saving images for %parentName% parent id %parentId% (%parentType%)' => 'Enregistrement des images pour %parentName% ID parent %parentId% (%parentType%)', + 'Shipping zone name' => 'Nom de la zone de livraison', 'Show redirections *' => 'Montrer les redirections *', 'Sorry, an error occured: %msg' => 'Désolé, une erreur est survenue : %msg', + 'Sorry, an error occurred: %err' => 'Désolé, une erreur est survenue: %err', 'Sorry, you are not allowed to perform this action.' => 'Désolé, vous n\'êtes pas autorisé à réaliser cette action.', 'Sorry, you\'re not allowed to perform this action' => 'Désolé, vous n\'êtes pas autorisé à réaliser cette action.', 'Source IP' => 'IP source', + 'Stats on %month/%year' => 'Statistiques pour %month/%year ', 'Store configuration failed.' => 'Erreur de configuration du magasin.', 'Store email address' => 'Adresse mail du magasin', 'Store logs into text file' => 'Conserver les logs dans des fichiers texte', @@ -166,65 +243,70 @@ return array( 'Summary' => 'Résumé', 'Symbol *' => 'Symbole *', 'System log configuration failed.' => 'Erreur du configurateur de log system.', + 'Tax ID not found in tax list JSON' => 'ID de la taxe non trouvé dans le JSON de la liste des taxes', + 'Tax list is not valid JSON' => 'Le JSON de la liste des taxes n\'est pas valide', + 'Tax rule ID not found' => 'ID de la règle de taxe non trouvé', 'Tax rule for this product *' => 'Règle de taxe pour ce produit *', 'Template Name *' => 'Nom du template *', 'Template file %file cannot be found.' => 'Le fichier %file n\'a pas été trouvé dans le template. ', 'Text File' => 'Fichier texte', 'Text Message' => 'Message au format texte', + 'The TaxEngine should be passed to this form before using it.' => 'Le moteur de taxe doit être passé au formulaire avant d\'être utilisé.', + 'The cart item count should match the condition' => 'Le nombre d\'articles dans le panier doit vérifier la condition', + 'The image which replaces an undefined country flag (%file) was not found. Please check unknown-flag-path configuration variable, and check that the image exists.' => 'L\'image qui remplace un drapeau de pays manquant (%file) n\'a pas été trouvée. Merci de vérifier la variable de configuration unknown-flag-path.', + 'The loop name \'%name\' is already defined in %className class' => 'La boucle \'%name\' est déjà définir dans la classe %className', 'This category is online.' => 'Cette catégorie est en ligne.', + 'This condition is always true' => 'Cette condition est troujours vérifiée', 'This content is online.' => 'Ce contenu est en ligne.', + 'This coupon does not exists' => 'Ce code promo n\'existe pas', + 'This coupon will offert a flat percentage off a shopper\'s entire order (not applied to shipping costs or tax rates). If the discount is greater than the total order corst, the customer will only pay the shipping, or nothing if the coupon also provides free shipping.' => 'Ce code promo retire le pourcentage indiqué du total de la commande, hors frais de port et taxes. Si la remise est supérieur au total de la commande, seul le port sera facturé, à moins que le code promo n\'offre aussi les frais port.', + 'This coupon will subtracts a set amount from the total cost of an order. If the discount is greater than the total order corst, the customer will only pay the shipping, or nothing if the coupon also provides free shipping.' => 'Ce code promo retire le montant indiqué du total de la commande, hors frais de port et taxes. Si la remise est supérieur au total de la commande, seul le port sera facturé, à moins que le code promo n\'offre aussi les frais port.', + 'This email already exists.' => 'Cette adresse email existe déjà', + 'This email does not exists' => 'Cette adresse email n\'existe pas', 'This extension must be installed and loaded' => 'Cette extension doit être installée et chargée.', 'This folder is online.' => 'Ce dossier est en ligne.', + 'This login already exists' => 'Cet identifiant existe déjà', 'This product is on sale' => 'Ce produit est en promo', 'This product is online' => 'Ce produit est en ligne', + 'This product_sale_elements_id does not exists for this product : %d' => 'Le product_sale_elements_id n\'existe pas pour ce produit : %d', + 'This template is in use in some of your products, and cannot be deleted. Delete it from all your products and try again.' => 'Ce template est utilisé par des produits, et ne peut être supprimé. Retirez-le de tous vos produits, et ré-essayez.', + 'This value should not be blank.' => 'Cette valeur ne doit pas être vide.', 'Timeout' => 'Délai d\'attente expiré', 'Title' => 'Titre', 'Title *' => 'Titre *', + 'Title ID not found' => 'ID de la civilité non trouvé', 'Type' => 'Type', + 'Unable to process your request. Please try again (%err).' => 'Echec lors du traitement de votre requête. Merci de ré-essayer (%err).', + 'Unavailable' => 'Non disponible.', + 'Unconditional usage' => 'Utilisable sans conditions', + 'Unconditionnal usage' => 'Utilisable sans conditions', + 'Undefined loop argument "%name"' => 'Argument de boucle invalide: "%name" ', + 'Undefined search mode \'%mode\'' => 'Mode de recherche \'%mode\' invalide', + 'Undefined translation type: %item' => 'Type de traduction inconnu:%item ', + 'Unknown order ID: %id' => 'La commande ID %id est inconnue.', + 'Unsupported magic method %name. only getArgname() is supported.' => 'La méthode magique %name n\'est pas supportée. Seule get() est supporté..', 'Username' => 'Nom d\'utilisateur', 'Username *' => 'Nom d\'utilisateur *', 'Value' => 'Valeur', 'Value *' => 'Valeur *', 'Warnings' => 'Avertissements', 'Weight' => 'Poids', - 'Weight *' => 'Poids *', 'Yes, I have a password :' => 'Oui, j\'ai un mot de passe :', + 'You are already registered!' => 'Vous êtes déjà enregistré !', + 'You can only upload images (.png, .jpg, .jpeg, .gif)' => 'Seules les images sont autorisées (.png, .jpg, .jpeg, .gif)', 'Your Email Address' => 'Votre adresse mail', 'Your Message' => 'Votre message', + 'Your current password does not match.' => 'Votre mot de passe actuel ne correspond pas', 'Zip code' => 'Code postal', 'date format' => 'Format de date', + 'delivery module %s is not a Thelia\Module\DeliveryModuleInterface' => 'le module de livraison %s n\'est pas un Thelia\Module\DeliveryModuleInterface', 'language locale' => 'Langue locale', 'mailing system modification' => 'Modification du système d\'envoi de mail.', - 'shipping area name' => 'Nom de la zone de livraison', - 'time format' => 'Format d\'heure', - 'This value should not be blank.' => 'Cette valeur ne doit pas être vide.', - 'A user already exists with this email address. Please login or if you\'ve forgotten your password, go to Reset Your Password.' => 'Un utilisateur existe déjà avec cette adresse email. Connectez-vous ou demandez une réinitialisation de votre mot de passe.', - 'Administrator ID not found' => 'ID de l\'administrateur not trouvé', - 'This login already exists' => 'Cet identifiant existe déjà', 'password confirmation is not the same as password field' => 'le mot de passe de confirmation n\'est pas le même que le champ mot de passe', 'password must be composed of at least 4 characters' => 'le mot de passe doit être composé d\'au moins 4 caractères', - 'this product id does not exists : %d' => 'l\'id du produit %d n\'existe pas', - 'This product_sale_elements_id does not exists for this product : %d' => 'Le product_sale_elements_id n\'existe pas pour ce produit : %d', + 'payment module %s is not a Thelia\Module\PaymentModuleInterface' => 'Le module de paiement %s n\'est pas une instance de Thelia\Module\PaymentModuleInterface ', + 'permanent discount (in percent)' => 'Remise permanente (en pourcentage)', 'quantity value is not valid' => 'la valeur de la quantité n\'est pas valide', - 'Please accept the Terms and conditions in order to register.' => 'Veuillez accepter les termes et conditions pour vous inscrire.', - 'This email already exists.' => 'Cette adresse email existe déjà', - 'This email does not exists' => 'Cette adresse email n\'existe pas', - 'Your current password does not match.' => 'Votre mot de passe actuel ne correspond pas', - 'Module ID not found' => 'Id du module non trouvé', - 'You are already registered!' => 'Vous êtes déjà enregistré !', - 'Address ID not found' => 'ID de l\'adresse non trouvé', - 'Delivery module ID not found' => 'Id du module de livraison non trouvé', - 'delivery module %s is not a Thelia\Module\DeliveryModuleInterface' => 'le module de livraison %s n\'est pas un Thelia\Module\DeliveryModuleInterface', - 'Order address ID not found' => 'ID de l\'adresse de la commande non trouvé', - 'Title ID not found' => 'ID de la civilité non trouvé', - 'Country ID not found' => 'ID du pays non trouvé', - 'Profile `code` already exists' => 'Le `code` du profil existe déjà', - 'Profile ID not found' => 'ID du profil non trouvé', - 'The TaxEngine should be passed to this form before using it.' => 'Le moteur de taxe doit être passé au formulaire avant d\'être utilisé.', - 'Tax rule ID not found' => 'ID de la règle de taxe non trouvé', - 'Tax list is not valid JSON' => 'Le JSON de la liste des taxes n\'est pas valide', - 'Bad tax list JSON' => 'Mauvais JSON de la liste des taxes', - 'Tax ID not found in tax list JSON' => 'ID de la taxe non trouvé dans le JSON de la liste des taxes', - 'Please check your input: %s' => 'Veuillez vérifier votre saisie: %s', - 'Sorry, an error occured: %s' => 'Désolé, une erreur est survenue: %s', + 'this product id does not exists : %d' => 'l\'id du produit %d n\'existe pas', + 'time format' => 'Format d\'heure', ); diff --git a/core/lib/Thelia/Config/I18n/it_IT.php b/core/lib/Thelia/Config/I18n/it_IT.php index 188d6f90a..265f136eb 100644 --- a/core/lib/Thelia/Config/I18n/it_IT.php +++ b/core/lib/Thelia/Config/I18n/it_IT.php @@ -1,26 +1,201 @@ . */ -/* */ -/*************************************************************************************/ return array( - + '%obj SEO modification' => 'modifiche SEO %obj', + '%obj creation' => 'creazione di %obj ', + '%obj modification' => 'modifica %obj', + 'A currency with code "%name" already exists.' => 'Una moneta con il codice "%name" esiste già.', + 'A message with name "%name" already exists.' => 'Un messaggio con il nome "%name" esiste già.', + 'A variable with name "%name" already exists.' => 'Una variabile con il nome "%name" esiste già.', + 'Activate logs only for these IP Addresses' => 'Attivare log solo per questi indirizzi IP', + 'Activate logs only for these files' => 'Attivare log solo per questi file', + 'Add to all product templates' => 'Aggiungere a tutti i template di prodotto', + 'Additional address' => 'Indirizzo addizionale', + 'Address Line 2' => 'Indirizzo linea 2', + 'Address Line 3' => 'Indirizzo linea 3', + 'Address label' => 'Etichetta dell\'indirizzo', + 'Advertise this product as new' => 'Pubblicizzare questo prodotto come nuovo', + 'Alerts' => 'Avvisi', + 'Alpha code 2 *' => 'Alpha code 2 *', + 'Alpha code 3 *' => 'Alpha code 3 *', + 'Amount removed from the cart' => 'Importo rimosso dal carrello', + 'Apply exchange rates on price in %sym' => 'Applicare i tassi di cambio sui prezzi in %sym', + 'Area' => 'Zona', + 'Attribute ID:Attribute AV ID' => 'Attribute ID:Attribute AV ID', + 'Auth mode' => 'Auth mode', + 'Available quantity' => 'Quantità disponibile', + 'Available quantity *' => 'Quantità disponibile *', + 'Business ID' => 'Business ID', + 'Cannot find a default country. Please define one.' => 'Non riusciamo a trovare un paese predefinito. Per favore, definirne uno.', + 'Cannot find the shop country. Please select a shop country.' => 'Non riusciamo a trovare il paese di negozio. Si prega di selezionare un paese per il negozio.', + 'Category title *' => 'Titolo della categoria *', + 'Cellphone' => 'Cellulare', + 'Chapo' => 'Chapo', + 'City' => 'Città', + 'Combination builder' => 'Generatore di combinazione', + 'Compagny' => 'Azienda', + 'Company' => 'Azienda', + 'Company Name' => 'Nome della società', + 'Conclusion' => 'Conclusione', + 'Constant amount' => 'Importo costante', + 'Constant amount found in one of the product\'s feature' => 'Importo costante trovato in una delle caratteristiche del prodotto', + 'Content title *' => 'Titolo del contenuto *', + 'Country' => 'Paese', + 'Country area' => 'Zona del paese', + 'Country title *' => 'Titolo del paese *', + 'Critical' => 'Critico', + 'Current Password' => 'Password attuale', + 'Debug' => 'Eseguire il debug', + 'Default folder *' => 'Cartella predefinita *', + 'Default product category *' => 'Categoria di prodotto predefinita *', + 'Default product sale element' => 'Elemento predefinito di vendita per il prodotto', + 'Description' => 'Descrizione', + 'Detailed description' => 'Descrizione dettagliata', + 'Disabled' => 'Disattivato', + 'EAN Code' => 'Codice EAN', + 'Email Address' => 'Indirizzo email', + 'Email address' => 'Indirizzo email', + 'Emergency' => 'Emergenza', + 'Enable remote SMTP use' => 'Abilitare l\'utilizzo di un SMTP remoto', + 'Encryption' => 'Criptaggio', + 'Errors' => 'Errori', + 'Failed to update language definition: %ex' => 'Impossibile aggiornare la definizione del linguaggio: %ex', + 'Fax' => 'Fax', + 'Feature value does not match FLOAT format' => 'Il valore della caratteristica non corrisponde al formato FLOAT', + 'First Name' => 'Nome', + 'Firstname' => 'Nome', + 'Folder title *' => 'Titolo della cartella *', + 'Full Name' => 'Nome e cognome', + 'HTML Message' => 'Messaggio HTML', + 'Host' => 'Host', + 'I would like to receive the newsletter or the latest news.' => 'Vorrei ricevere la newsletter o le ultime notizie.', + 'ISO 4217 code *' => 'Codice ISO 4217 *', + 'ISO 639-1 Code' => 'Codice ISO 639-1', + 'ISO Code *' => 'Codice ISO *', + 'If a translation is missing or incomplete :' => 'Se una traduzione è incompleta o mancante :', + 'Information' => 'Informazioni', + 'Invalid product_sale_elements' => 'Product_sale_elements non valido', + 'Invalid value for walkMode parameter: %value' => 'Valore non valido per il parametro walkMode: %value', + 'Is it the default product sale element ?' => 'È l\'elemento predefinito di vendita del prodotto?', + 'Language name' => 'Nome della lingua', + 'Last Name' => 'Cognome', + 'Lastname' => 'Cognome', + 'Log format *' => 'Formato di registro *', + 'Log level *' => 'Livello del registro *', + 'Login' => 'Login', + 'Login failed. Please check your username and password.' => 'Accesso non riuscito. Si prega di controllare il nome dell\'utente e la password.', + 'Make this address as my primary address' => 'Fare questo indirizzo come mio indirizzo primario', + 'Message subject' => 'Oggetto del messaggio', + 'Meta Description' => 'Meta descrizione', + 'Meta Keywords' => 'Meta Keywords', + 'Name' => 'Nome', + 'Name *' => 'Nome *', + 'Name of the HTML layout file' => 'Nome del layout HTML', + 'Name of the HTML template file' => 'Nome del file del template HTML', + 'Name of the text layout file' => 'Nome del file del layout del testo', + 'Name of the text template file' => 'Nome del testo del file del template', + 'New Password' => 'Nuova Password', + 'No %obj was created.' => 'È stato creato nessuno %obj.', + 'No %obj was updated.' => 'Nessun %obj è stato aggiornato.', + 'No, I am a new customer.' => 'No, sono un nuovo cliente.', + 'Notices' => 'Avvisi', + 'Page Title' => 'Titolo della pagina', + 'Parent category *' => 'Categoria superiore *', + 'Parent folder *' => 'Cartella superiore *', + 'Password' => 'Password', + 'Password *' => 'Password *', + 'Password confirmation' => 'Conferma della password', + 'Percentage of the product price' => 'Percentuale del prezzo del prodotto', + 'Percentage removed from the cart' => 'Percentuale rimosso dal carrello', + 'Phone' => 'Telefono', + 'Please enter your email address' => 'Inserisci il tuo indirizzo email', + 'Please enter your password' => 'Per favore inserisci la password', + 'Please specify either \'path\' or \'file\' parameter in {url} function.' => 'Specificare il parametro \'percorso\' o \'file\' nella funzione {url}.', + 'Port' => 'Spedizione', + 'Post Scriptum' => 'Post Scriptum', + 'Postage' => 'Spese di spedizione', + 'Preferred locale' => 'Impostazioni internazionali preferite', + 'Prevent mailing template modification or deletion, except for super-admin' => 'Prevenire modifiche o cancellazione del template di mailing, ad eccezione del super-admin', + 'Prevent variable modification or deletion, except for super-admin' => 'Prevenire modifiche o cancellazione della variabile, ad eccezione del super-admin', + 'Price' => 'Prezzo', + 'Price currency *' => 'Prezzo della moneta *', + 'Prodcut ID *' => 'ID prodotto *', + 'Product ID' => 'ID prodotto', + 'Product ID *' => 'ID Prodotto *', + 'Product base price excluding taxes *' => 'Prezzo di base del prodotto escluse le tasse *', + 'Product price excluding taxes' => 'Prezzo del prodotto escluse le tasse', + 'Product price excluding taxes *' => 'Prezzo del prodotto escluse le tasse *', + 'Product price including taxes' => 'Prezzo del prodotto tasse incluse', + 'Product reference *' => 'Riferimento del prodotto *', + 'Product sale element ID *' => 'ID del prodotto venduto *', + 'Product template' => 'Template del prodotto', + 'Product title *' => 'Titolo del prodotto *', + 'ProductSaleElement modification' => 'modifica del ProductSaleElement', + 'Profile' => 'Profilo', + 'Profile Code' => 'Codice del profilo', + 'Purpose *' => 'Scopo *', + 'Quantity' => 'Quantità', + 'Rate from € *' => 'Tasso da € *', + 'Redirecting ...' => 'Reindirizzamento ...', + 'Redirecting to %url' => 'Reindirizzamento a %url', + 'Reference' => 'Riferimento', + 'Reference *' => 'Riferimento *', + 'Remember me ?' => 'Ricordati di me?', + 'Remove X amount to total cart' => 'Rimuovere una quantità di X al totale del carrello', + 'Remove X percent to total cart' => 'Rimuovi X percento al totale del carrello', + 'Replace by the default language' => 'Sostituire la lingua predefinita', + 'Replace current document by this file' => 'Sostituire l\'attuale documento da questo file', + 'Replace current image by this file' => 'Sostituire l\'immagine per questo file', + 'Rewriten URL' => 'URL riscritta', + 'Rotated Text File' => 'File di testo ruotato', + 'Sale price excluding taxes' => 'Prezzo di vendita escluse le tasse', + 'Sale price including taxes' => 'Prezzo di vendita tasse incluse', + 'Show redirections *' => 'Visualizza redirezioni *', + 'Sorry, an error occured: %msg' => 'Siamo spiacenti, errore: %msg', + 'Sorry, you are not allowed to perform this action.' => 'Siamo spiacenti, non è consentito eseguire questa azione.', + 'Sorry, you\'re not allowed to perform this action' => 'Siamo spiacenti, non sei autorizzato ad eseguire questa azione', + 'Source IP' => 'IP di origine', + 'Store configuration failed.' => 'La registrazione della configurazione è fallita.', + 'Store email address' => 'Indirizzo email del negozio', + 'Store logs into text file' => 'Archiviare i log in un file di testo', + 'Store logs into text file, up to a certian size, then a new file is created' => 'Archiviare i log in un file di testo, fino ad una certa dimensione, dopo viene creato un nuovo file', + 'Store name' => 'Nome del negozio', + 'Street Address' => 'Indirizzo', + 'Street Address ' => 'Indirizzo ', + 'Strictly use the requested language' => 'Utilizzare rigorosamente la lingua richiesta', + 'Subject' => 'Oggetto', + 'Summary' => 'Riassunto', + 'Symbol *' => 'Simbolo *', + 'System log configuration failed.' => 'Non e riuscito la configurazione del registro di sistema.', + 'Tax rule for this product *' => 'Regola fiscale per questo prodotto *', + 'Template Name *' => 'Nome del template *', + 'Template file %file cannot be found.' => 'File del template %file non vengono trovati.', + 'Text File' => 'File di testo', + 'Text Message' => 'Messaggio di testo', + 'This category is online.' => 'Questa categoria è online.', + 'This content is online.' => 'Questo contenuto è online.', + 'This extension must be installed and loaded' => 'Questa estensione deve essere installata e caricata', + 'This folder is online.' => 'Questa cartella è online.', + 'This product is on sale' => 'Questo prodotto è in vendita', + 'This product is online' => 'Questo prodotto è online', + 'Timeout' => 'Timeout', + 'Title' => 'Titolo', + 'Title *' => 'Titolo *', + 'Type' => 'Tipo', + 'Username' => 'Nome dell\'utente', + 'Username *' => 'Nome dell\'utente *', + 'Value' => 'Valore', + 'Value *' => 'Valore *', + 'Warnings' => 'Avvertenze', + 'Weight' => 'Peso', + 'Weight *' => 'Peso *', + 'Yes, I have a password :' => 'Sì, ho una password :', + 'Your Email Address' => 'Indirizzo Email', + 'Your Message' => 'Il tuo messaggio', + 'Zip code' => 'Codice postale', + 'date format' => 'Formato della data', + 'language locale' => 'Impostazione regionale della lingua', + 'mailing system modification' => 'modifica del sistema di mailing', + 'shipping area name' => 'nome dell\'area di spedizione', + 'time format' => 'Formato dell\'ora', ); diff --git a/core/lib/Thelia/Config/I18n/ru_RU.php b/core/lib/Thelia/Config/I18n/ru_RU.php new file mode 100644 index 000000000..634c0e768 --- /dev/null +++ b/core/lib/Thelia/Config/I18n/ru_RU.php @@ -0,0 +1,4 @@ + + diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index 9657f80e0..614364294 100644 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -96,6 +96,10 @@ + + + + diff --git a/core/lib/Thelia/Config/Resources/form.xml b/core/lib/Thelia/Config/Resources/form.xml index ec281266e..27e169b7c 100644 --- a/core/lib/Thelia/Config/Resources/form.xml +++ b/core/lib/Thelia/Config/Resources/form.xml @@ -122,6 +122,11 @@
+ + + + + diff --git a/core/lib/Thelia/Config/Resources/routing/admin.xml b/core/lib/Thelia/Config/Resources/routing/admin.xml index 703dcb33b..348c1d7ec 100644 --- a/core/lib/Thelia/Config/Resources/routing/admin.xml +++ b/core/lib/Thelia/Config/Resources/routing/admin.xml @@ -16,10 +16,20 @@ Thelia\Controller\Admin\HomeController::defaultAction + + Thelia\Controller\Admin\HomeController::getLatestTheliaVersion + + Thelia\Controller\Admin\HomeController::loadStatsAjaxAction + + Thelia\Controller\Admin\AdminController::processTemplateAction + ajax/thelia_news_feed + 1 + + @@ -340,6 +350,10 @@ Thelia\Controller\Admin\ProductController::priceCaclulator + + Thelia\Controller\Admin\ProductController::calculatePrice + + Thelia\Controller\Admin\ProductController::loadConvertedPrices @@ -498,10 +512,6 @@ Thelia\Controller\Admin\CouponController::updateAction \d+ - - Thelia\Controller\Admin\CouponController::readAction - \d+ - Thelia\Controller\Admin\CouponController::getBackOfficeInputsAjaxAction .* @@ -535,6 +545,10 @@ + + Thelia\Controller\Admin\ConfigurationController::indexAction + + Thelia\Controller\Admin\ConfigController::defaultAction @@ -763,9 +777,9 @@ Thelia\Controller\Admin\ShippingZoneController::indexAction - + Thelia\Controller\Admin\ShippingZoneController::updateAction - \d+ + \d+ @@ -977,6 +991,25 @@ + + + Thelia\Controller\Admin\AdvancedConfigurationController::defaultAction + + + + Thelia\Controller\Admin\AdvancedConfigurationController::flushCacheAction + + + + Thelia\Controller\Admin\AdvancedConfigurationController::flushAssetsAction + + + + Thelia\Controller\Admin\AdvancedConfigurationController::flushImagesAndDocumentsAction + + + + @@ -1125,6 +1158,16 @@ Thelia\Controller\Admin\TranslationsController::updateAction + + + + Thelia\Controller\Admin\ExportController::indexAction + + + + Thelia\Controller\Admin\CustomerExportController::NewsletterExportAction + + diff --git a/core/lib/Thelia/Config/Resources/smarty-plugin.xml b/core/lib/Thelia/Config/Resources/smarty-plugin.xml index 903bb114e..222874903 100644 --- a/core/lib/Thelia/Config/Resources/smarty-plugin.xml +++ b/core/lib/Thelia/Config/Resources/smarty-plugin.xml @@ -38,6 +38,11 @@ + + + + + diff --git a/core/lib/Thelia/Controller/Admin/AbstractCrudController.php b/core/lib/Thelia/Controller/Admin/AbstractCrudController.php index eeafe6a6c..8fd720c64 100644 --- a/core/lib/Thelia/Controller/Admin/AbstractCrudController.php +++ b/core/lib/Thelia/Controller/Admin/AbstractCrudController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; @@ -335,15 +324,17 @@ abstract class AbstractCrudController extends BaseAdminController $error_msg = $ex->getMessage(); } - $this->setupFormErrorContext( - $this->getTranslator()->trans("%obj creation", array('%obj' => $this->objectName)), - $error_msg, - $creationForm, - $ex - ); + if (false !== $error_msg) { + $this->setupFormErrorContext( + $this->getTranslator()->trans("%obj creation", array('%obj' => $this->objectName)), + $error_msg, + $creationForm, + $ex + ); - // At this point, the form has error, and should be redisplayed. - return $this->renderList(); + // At this point, the form has error, and should be redisplayed. + return $this->renderList(); + } } /** @@ -435,15 +426,17 @@ abstract class AbstractCrudController extends BaseAdminController $error_msg = $ex->getMessage();*/ } - // At this point, the form has errors, and should be redisplayed. - $this->setupFormErrorContext( - $this->getTranslator()->trans("%obj modification", array('%obj' => $this->objectName)), - $error_msg, - $changeForm, - $ex - ); + if (false !== $error_msg) { + // At this point, the form has errors, and should be redisplayed. + $this->setupFormErrorContext( + $this->getTranslator()->trans("%obj modification", array('%obj' => $this->objectName)), + $error_msg, + $changeForm, + $ex + ); - return $this->renderEditionTemplate(); + return $this->renderEditionTemplate(); + } } /** diff --git a/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php b/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php index 52c4bbda4..f4e59c4e8 100644 --- a/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php +++ b/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; @@ -157,13 +146,14 @@ abstract class AbstractSeoCrudController extends AbstractCrudController /** * Update SEO modification, and either go back to the object list, or stay on the edition page. * - * @return Thelia\Core\HttpFoundation\Response the response + * @return \Thelia\Core\HttpFoundation\Response the response */ public function processUpdateSeoAction() { // Check current user authorization - if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) + if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) { return $response; + } // Error (Default: false) $error_msg = false; @@ -221,14 +211,16 @@ abstract class AbstractSeoCrudController extends AbstractCrudController $this->getParserContext()->addForm($changeForm); } - $this->setupFormErrorContext( - $this->getTranslator()->trans("%obj SEO modification", array('%obj' => $this->objectName)), - $error_msg, - $updateSeoForm, - $ex - ); + if (false !== $error_msg) { + $this->setupFormErrorContext( + $this->getTranslator()->trans("%obj SEO modification", array('%obj' => $this->objectName)), + $error_msg, + $updateSeoForm, + $ex + ); - // At this point, the form has errors, and should be redisplayed. - return $this->renderEditionTemplate(); + // At this point, the form has errors, and should be redisplayed. + return $this->renderEditionTemplate(); + } } } diff --git a/core/lib/Thelia/Controller/Admin/AddressController.php b/core/lib/Thelia/Controller/Admin/AddressController.php index c818ba492..658db4293 100644 --- a/core/lib/Thelia/Controller/Admin/AddressController.php +++ b/core/lib/Thelia/Controller/Admin/AddressController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/AdminController.php b/core/lib/Thelia/Controller/Admin/AdminController.php index 0b76c79ff..ddffbb960 100644 --- a/core/lib/Thelia/Controller/Admin/AdminController.php +++ b/core/lib/Thelia/Controller/Admin/AdminController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/AdminLogsController.php b/core/lib/Thelia/Controller/Admin/AdminLogsController.php index 5f3fadb0f..afd2cf910 100644 --- a/core/lib/Thelia/Controller/Admin/AdminLogsController.php +++ b/core/lib/Thelia/Controller/Admin/AdminLogsController.php @@ -1,38 +1,26 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; use Thelia\Core\Security\AccessManager; +use Thelia\Core\Security\Resource\AdminResources; use Thelia\Model\AdminLogQuery; class AdminLogsController extends BaseAdminController { - const RESOURCE_CODE = "admin.admin-logs"; - public function defaultAction() { - if (null !== $response = $this->checkAuth(self::RESOURCE_CODE, array(), AccessManager::VIEW)) return $response; + if (null !== $response = $this->checkAuth(AdminResources::ADMIN_LOG, array(), AccessManager::VIEW)) return $response; // Render the edition template. return $this->render('admin-logs'); diff --git a/core/lib/Thelia/Controller/Admin/AdministratorController.php b/core/lib/Thelia/Controller/Admin/AdministratorController.php index eabc62c13..03458a91f 100644 --- a/core/lib/Thelia/Controller/Admin/AdministratorController.php +++ b/core/lib/Thelia/Controller/Admin/AdministratorController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/AdvancedConfigurationController.php b/core/lib/Thelia/Controller/Admin/AdvancedConfigurationController.php new file mode 100644 index 000000000..32dee27fe --- /dev/null +++ b/core/lib/Thelia/Controller/Admin/AdvancedConfigurationController.php @@ -0,0 +1,104 @@ + + */ +class AdvancedConfigurationController extends BaseAdminController +{ + + public function defaultAction() + { + if (null !== $result = $this->checkAuth(AdminResources::ADVANCED_CONFIGURATION, [], AccessManager::VIEW)) { + return $result; + } + + return $this->render('advanced-configuration'); + } + + public function flushCacheAction() + { + if (null !== $result = $this->checkAuth(AdminResources::ADVANCED_CONFIGURATION, [], AccessManager::UPDATE)) { + return $result; + } + + $form = new CacheFlushForm($this->getRequest()); + try { + $this->validateForm($form); + + $event = new CacheEvent($this->container->getParameter("kernel.cache_dir")); + $this->dispatch(TheliaEvents::CACHE_CLEAR, $event); + + } catch (\Exception $e) { + Tlog::getInstance()->addError(sprintf("Flush cache error: %s", $e->getMessage())); + } + + $this->redirectToRoute('admin.configuration.advanced'); + } + + public function flushAssetsAction() + { + if (null !== $result = $this->checkAuth(AdminResources::ADVANCED_CONFIGURATION, [], AccessManager::UPDATE)) { + return $result; + } + + $form = new AssetsFlushForm($this->getRequest()); + try { + $this->validateForm($form); + + $event = new CacheEvent(THELIA_WEB_DIR . "assets"); + $this->dispatch(TheliaEvents::CACHE_CLEAR, $event); + + } catch (\Exception $e) { + Tlog::getInstance()->addError(sprintf("Flush assets error: %s", $e->getMessage())); + } + + $this->redirectToRoute('admin.configuration.advanced'); + } + + public function flushImagesAndDocumentsAction() + { + if (null !== $result = $this->checkAuth(AdminResources::ADVANCED_CONFIGURATION, [], AccessManager::UPDATE)) { + return $result; + } + + $form = new ImagesAndDocumentsCacheFlushForm($this->getRequest()); + try { + $this->validateForm($form); + + $event = new CacheEvent(THELIA_WEB_DIR . ConfigQuery::read('image_cache_dir_from_web_root', 'cache')); + $this->dispatch(TheliaEvents::CACHE_CLEAR, $event); + + $event = new CacheEvent(THELIA_WEB_DIR . ConfigQuery::read('document_cache_dir_from_web_root', 'cache')); + $this->dispatch(TheliaEvents::CACHE_CLEAR, $event); + + } catch (\Exception $e) { + Tlog::getInstance()->addError(sprintf("Flush images and document error: %s", $e->getMessage())); + } + + $this->redirectToRoute('admin.configuration.advanced'); + } +} diff --git a/core/lib/Thelia/Controller/Admin/AreaController.php b/core/lib/Thelia/Controller/Admin/AreaController.php index 2464ad0cb..af0045f7c 100644 --- a/core/lib/Thelia/Controller/Admin/AreaController.php +++ b/core/lib/Thelia/Controller/Admin/AreaController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; @@ -275,7 +264,7 @@ class AreaController extends AbstractCrudController // Check current user authorization if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) return $response; $request = $this->getRequest(); - $removeCountryEvent = new AreaRemoveCountryEvent($request->request->get('areai_id', 0), $request->request->get('country_id', 0)); + $removeCountryEvent = new AreaRemoveCountryEvent($request->request->get('area_id', 0), $request->request->get('country_id', 0)); $this->dispatch(TheliaEvents::AREA_REMOVE_COUNTRY, $removeCountryEvent); diff --git a/core/lib/Thelia/Controller/Admin/AttributeAvController.php b/core/lib/Thelia/Controller/Admin/AttributeAvController.php index 4ddf439a2..abf8cb5e0 100644 --- a/core/lib/Thelia/Controller/Admin/AttributeAvController.php +++ b/core/lib/Thelia/Controller/Admin/AttributeAvController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; @@ -141,7 +130,7 @@ class AttributeAvController extends AbstractCrudController ->findOneById($this->getRequest()->get('attributeav_id', 0)); if (null !== $attributeAv) { - $attribute->setLocale($this->getCurrentEditionLocale()); + $attributeAv->setLocale($this->getCurrentEditionLocale()); } return $attributeAv; diff --git a/core/lib/Thelia/Controller/Admin/AttributeController.php b/core/lib/Thelia/Controller/Admin/AttributeController.php index 75da59ec3..71c479360 100644 --- a/core/lib/Thelia/Controller/Admin/AttributeController.php +++ b/core/lib/Thelia/Controller/Admin/AttributeController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/BaseAdminController.php b/core/lib/Thelia/Controller/Admin/BaseAdminController.php index 30ee37104..deba32d56 100644 --- a/core/lib/Thelia/Controller/Admin/BaseAdminController.php +++ b/core/lib/Thelia/Controller/Admin/BaseAdminController.php @@ -1,27 +1,18 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Controller\Admin; +use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Routing\Exception\InvalidParameterException; use Symfony\Component\Routing\Exception\MissingMandatoryParametersException; use Symfony\Component\Routing\Exception\RouteNotFoundException; @@ -266,9 +257,9 @@ class BaseAdminController extends BaseController /** * Redirect to à route ID related URL * - * @param unknown $routeId the route ID, as found in Config/Resources/routing/admin.xml - * @param array|\Thelia\Controller\Admin\unknown $urlParameters the URL parametrs, as a var/value pair array - * @param array $routeParameters + * @param string $routeId the route ID, as found in Config/Resources/routing/admin.xml + * @param array $urlParameters the URL parameters, as a var/value pair array + * @param array $routeParameters */ public function redirectToRoute($routeId, array $urlParameters = array(), array $routeParameters = array()) { @@ -405,14 +396,20 @@ class BaseAdminController extends BaseController /** * Render the given template, and returns the result as an Http Response. * - * @param $templateName the complete template name, with extension - * @param array $args the template arguments - * @param int $status http code status + * @param string $templateName the complete template name, with extension + * @param array $args the template arguments + * @param int $status http code status * @return \Thelia\Core\HttpFoundation\Response */ protected function render($templateName, $args = array(), $status = 200) { - return Response::create($this->renderRaw($templateName, $args), $status); + $response = $this->renderRaw($templateName, $args); + + if (!$response instanceof \Symfony\Component\HttpFoundation\Response) { + $response = Response::create($response, $status); + } + + return $response; } /** @@ -422,7 +419,7 @@ class BaseAdminController extends BaseController * @param array $args the template arguments * @param null $templateDir * - * @return \Thelia\Core\HttpFoundation\Response + * @return string|\Symfony\Component\HttpFoundation\RedirectResponse */ protected function renderRaw($templateName, $args = array(), $templateDir = null) { @@ -460,16 +457,17 @@ class BaseAdminController extends BaseController // Render the template. try { - $data = $this->getParser($templateDir)->render($templateName, $args); + $content = $this->getParser($templateDir)->render($templateName, $args); - return $data; } catch (AuthenticationException $ex) { // User is not authenticated, and templates requires authentication -> redirect to login page // We user login_tpl as a path, not a template. - Redirect::exec(URL::getInstance()->absoluteUrl($ex->getLoginTemplate())); + $content = RedirectResponse::create(URL::getInstance()->absoluteUrl($ex->getLoginTemplate())); } catch (AuthorizationException $ex) { // User is not allowed to perform the required action. Return the error page instead of the requested page. - return $this->errorPage($this->getTranslator()->trans("Sorry, you are not allowed to perform this action."), 403); + $content = $this->errorPage($this->getTranslator()->trans("Sorry, you are not allowed to perform this action."), 403); } + + return $content; } } diff --git a/core/lib/Thelia/Controller/Admin/CategoryController.php b/core/lib/Thelia/Controller/Admin/CategoryController.php index 3557c5075..ad5b2bd36 100644 --- a/core/lib/Thelia/Controller/Admin/CategoryController.php +++ b/core/lib/Thelia/Controller/Admin/CategoryController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/ConfigController.php b/core/lib/Thelia/Controller/Admin/ConfigController.php index 8e4e0d43c..fbd97a283 100644 --- a/core/lib/Thelia/Controller/Admin/ConfigController.php +++ b/core/lib/Thelia/Controller/Admin/ConfigController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php index ff339ded9..e76959864 100644 --- a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php +++ b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/ConfigurationController.php b/core/lib/Thelia/Controller/Admin/ConfigurationController.php new file mode 100644 index 000000000..88c828561 --- /dev/null +++ b/core/lib/Thelia/Controller/Admin/ConfigurationController.php @@ -0,0 +1,33 @@ + + */ +class ConfigurationController extends BaseAdminController +{ + public function indexAction() + { + if (null !== $response = $this->checkAuth([AdminResources::CONFIG], [], [AccessManager::VIEW])) { + return $response; + } + + return $this->render('configuration'); + } +} diff --git a/core/lib/Thelia/Controller/Admin/ContentController.php b/core/lib/Thelia/Controller/Admin/ContentController.php index f6fd4b7a1..209d4ea19 100644 --- a/core/lib/Thelia/Controller/Admin/ContentController.php +++ b/core/lib/Thelia/Controller/Admin/ContentController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/CountryController.php b/core/lib/Thelia/Controller/Admin/CountryController.php index 43959b909..888e8943a 100644 --- a/core/lib/Thelia/Controller/Admin/CountryController.php +++ b/core/lib/Thelia/Controller/Admin/CountryController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/CouponController.php b/core/lib/Thelia/Controller/Admin/CouponController.php index 62bbff786..16771b78b 100644 --- a/core/lib/Thelia/Controller/Admin/CouponController.php +++ b/core/lib/Thelia/Controller/Admin/CouponController.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Controller\Admin; @@ -45,6 +34,7 @@ use Thelia\Log\Tlog; use Thelia\Model\Coupon; use Thelia\Model\CouponQuery; use Thelia\Model\Lang; +use Thelia\Model\LangQuery; use Thelia\Tools\I18n; use Thelia\Tools\Rest\ResponseRest; @@ -64,54 +54,13 @@ class CouponController extends BaseAdminController */ public function browseAction() { - $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW); - - $args['urlReadCoupon'] = $this->getRoute( - 'admin.coupon.read', - array('couponId' => 0), - Router::ABSOLUTE_URL - ); - - $args['urlEditCoupon'] = $this->getRoute( - 'admin.coupon.update', - array('couponId' => 0), - Router::ABSOLUTE_URL - ); - - $args['urlCreateCoupon'] = $this->getRoute( - 'admin.coupon.create', - array(), - Router::ABSOLUTE_URL - ); - - return $this->render('coupon-list', $args); - } - - /** - * Manage Coupons read display - * - * @param int $couponId Coupon Id - * - * @return \Thelia\Core\HttpFoundation\Response - */ - public function readAction($couponId) - { - $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW); - - $coupon = CouponQuery::create()->findPk($couponId); - - if ($coupon === null) { - return $this->pageNotFound(); + if (null !== $response = $this->checkAuth(AdminResources::COUPON, [], AccessManager::VIEW)) { + return $response; } - $args['couponId'] = $couponId; - $args['urlEditCoupon'] = $this->getRoute( - 'admin.coupon.update', - array('couponId' => $couponId), - Router::ABSOLUTE_URL - ); + $args['coupon_order'] = $this->getListOrderFromSession('coupon', 'coupon_order', 'code'); - return $this->render('coupon-read', $args); + return $this->render('coupon-list', $args); } /** @@ -121,24 +70,17 @@ class CouponController extends BaseAdminController */ public function createAction() { - // Check current user authorization - $response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::CREATE); - if ($response !== null) { + if (null !== $response = $this->checkAuth(AdminResources::COUPON, [], AccessManager::CREATE)) { return $response; } // Parameters given to the template - $args = array(); + $args = []; - $i18n = new I18n(); - /** @var Lang $lang */ - $lang = $this->getSession()->getLang(); $eventToDispatch = TheliaEvents::COUPON_CREATE; if ($this->getRequest()->isMethod('POST')) { $this->validateCreateOrUpdateForm( - $i18n, - $lang, $eventToDispatch, 'created', 'creation' @@ -146,15 +88,14 @@ class CouponController extends BaseAdminController } else { // If no input for expirationDate, now + 2 months $defaultDate = new \DateTime(); - $args['defaultDate'] = $defaultDate->modify('+2 month') - ->format('Y-m-d'); + $args['defaultDate'] = $defaultDate->modify('+2 month')->format($this->getDefaultDateFormat()); } - $args['dateFormat'] = $this->getSession()->getLang()->getDateFormat(); + $args['dateFormat'] = $this->getDefaultDateFormat(); $args['availableCoupons'] = $this->getAvailableCoupons(); $args['urlAjaxAdminCouponDrawInputs'] = $this->getRoute( 'admin.coupon.draw.inputs.ajax', - array('couponServiceId' => 'couponServiceId'), + ['couponServiceId' => 'couponServiceId'], Router::ABSOLUTE_URL ); $args['formAction'] = 'admin/coupon/create'; @@ -174,9 +115,7 @@ class CouponController extends BaseAdminController */ public function updateAction($couponId) { - // Check current user authorization - $response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::UPDATE); - if ($response !== null) { + if (null !== $response = $this->checkAuth(AdminResources::COUPON, [], AccessManager::UPDATE)) { return $response; } @@ -194,18 +133,13 @@ class CouponController extends BaseAdminController $couponManager = $couponFactory->buildCouponFromModel($coupon); // Parameters given to the template - $args = array(); + $args = []; - $i18n = new I18n(); - /** @var Lang $lang */ - $lang = $this->getSession()->getLang(); $eventToDispatch = TheliaEvents::COUPON_UPDATE; // Update if ($this->getRequest()->isMethod('POST')) { $this->validateCreateOrUpdateForm( - $i18n, - $lang, $eventToDispatch, 'updated', 'update', @@ -220,7 +154,7 @@ class CouponController extends BaseAdminController $coupon->getSerializedConditions() ); - $data = array( + $data = [ 'code' => $coupon->getCode(), 'title' => $coupon->getTitle(), 'amount' => $coupon->getAmount(), @@ -228,14 +162,14 @@ class CouponController extends BaseAdminController 'shortDescription' => $coupon->getShortDescription(), 'description' => $coupon->getDescription(), 'isEnabled' => $coupon->getIsEnabled(), - 'expirationDate' => $coupon->getExpirationDate('Y-m-d'), + 'expirationDate' => $coupon->getExpirationDate($this->getDefaultDateFormat()), 'isAvailableOnSpecialOffers' => $coupon->getIsAvailableOnSpecialOffers(), 'isCumulative' => $coupon->getIsCumulative(), 'isRemovingPostage' => $coupon->getIsRemovingPostage(), 'maxUsage' => $coupon->getMaxUsage(), 'conditions' => $conditions, 'locale' => $this->getCurrentEditionLocale(), - ); + ]; $args['conditions'] = $this->cleanConditionForTemplate($conditions); @@ -245,50 +179,53 @@ class CouponController extends BaseAdminController // Pass it to the parser $this->getParserContext()->addForm($changeForm); } + $args['couponCode'] = $coupon->getCode(); $args['availableCoupons'] = $this->getAvailableCoupons(); $args['couponInputsHtml'] = $couponManager->drawBackOfficeInputs(); $args['urlAjaxAdminCouponDrawInputs'] = $this->getRoute( 'admin.coupon.draw.inputs.ajax', - array('couponServiceId' => 'couponServiceId'), + ['couponServiceId' => 'couponServiceId'], Router::ABSOLUTE_URL ); $args['availableConditions'] = $this->getAvailableConditions(); $args['urlAjaxGetConditionInputFromServiceId'] = $this->getRoute( 'admin.coupon.draw.condition.read.inputs.ajax', - array('conditionId' => 'conditionId'), + ['conditionId' => 'conditionId'], Router::ABSOLUTE_URL ); $args['urlAjaxGetConditionInputFromConditionInterface'] = $this->getRoute( 'admin.coupon.draw.condition.update.inputs.ajax', - array( + [ 'couponId' => $couponId, 'conditionIndex' => 8888888 - ), + ], Router::ABSOLUTE_URL ); $args['urlAjaxSaveConditions'] = $this->getRoute( 'admin.coupon.condition.save', - array('couponId' => $couponId), + ['couponId' => $couponId], Router::ABSOLUTE_URL ); $args['urlAjaxDeleteConditions'] = $this->getRoute( 'admin.coupon.condition.delete', - array( + [ 'couponId' => $couponId, 'conditionIndex' => 8888888 - ), + ], Router::ABSOLUTE_URL ); $args['urlAjaxGetConditionSummaries'] = $this->getRoute( 'admin.coupon.draw.condition.summaries.ajax', - array('couponId' => $couponId), + ['couponId' => $couponId], Router::ABSOLUTE_URL ); $args['formAction'] = 'admin/coupon/update/' . $couponId; + $args['dateFormat'] = $this->getDefaultDateFormat(); + return $this->render('coupon-update', $args); } @@ -301,31 +238,44 @@ class CouponController extends BaseAdminController */ public function getConditionEmptyInputAjaxAction($conditionId) { - $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW); + if (null !== $response = $this->checkAuth(AdminResources::COUPON, [], AccessManager::VIEW)) { + return $response; + } $this->checkXmlHttpRequest(); - /** @var ConditionFactory $conditionFactory */ - $conditionFactory = $this->container->get('thelia.condition.factory'); - $inputs = $conditionFactory->getInputsFromServiceId($conditionId); - if (!$this->container->has($conditionId)) { - return false; + if (! empty($conditionId)) { + + /** @var ConditionFactory $conditionFactory */ + $conditionFactory = $this->container->get('thelia.condition.factory'); + $inputs = $conditionFactory->getInputsFromServiceId($conditionId); + + if (!$this->container->has($conditionId)) { + return false; + } + + if ($inputs === null) { + return $this->pageNotFound(); + } + + /** @var ConditionInterface $condition */ + $condition = $this->container->get($conditionId); + + $html = $condition->drawBackOfficeInputs(); + $serviceId = $condition->getServiceId(); } - - /** @var ConditionInterface $condition */ - $condition = $this->container->get($conditionId); - - if ($inputs === null) { - return $this->pageNotFound(); + else { + $html = ''; + $serviceId = ''; } return $this->render( 'coupon/condition-input-ajax', - array( - 'inputsDrawn' => $condition->drawBackOfficeInputs(), - 'conditionServiceId' => $condition->getServiceId(), - 'conditionIndex' => -1, - ) + [ + 'inputsDrawn' => $html, + 'conditionServiceId' => $serviceId, + 'conditionIndex' => '' + ] ); } @@ -339,7 +289,9 @@ class CouponController extends BaseAdminController */ public function getConditionToUpdateInputAjaxAction($couponId, $conditionIndex) { - $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW); + if (null !== $response = $this->checkAuth(AdminResources::COUPON, [], AccessManager::VIEW)) { + return $response; + } $this->checkXmlHttpRequest(); @@ -374,13 +326,11 @@ class CouponController extends BaseAdminController } return $this->render( - 'coupon/condition-input-ajax', - array( + 'coupon/condition-input-ajax', [ 'inputsDrawn' => $condition->drawBackOfficeInputs(), 'conditionServiceId' => $condition->getServiceId(), 'conditionIndex' => $conditionIndex, - - ) + ] ); } @@ -393,7 +343,9 @@ class CouponController extends BaseAdminController */ public function saveConditionsAction($couponId) { - $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW); + if (null !== $response = $this->checkAuth(AdminResources::COUPON, [], AccessManager::UPDATE)) { + return $response; + } $this->checkXmlHttpRequest(); @@ -440,7 +392,9 @@ class CouponController extends BaseAdminController */ public function deleteConditionsAction($couponId, $conditionIndex) { - $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW); + if (null !== $response = $this->checkAuth(AdminResources::COUPON, [], AccessManager::UPDATE)) { + return $response; + } $this->checkXmlHttpRequest(); @@ -468,41 +422,6 @@ class CouponController extends BaseAdminController return new Response(); } - /** - * Build a Coupon from its form - * - * @param array $data Form data - * - * @return Coupon - */ - protected function buildCouponFromForm(array $data) - { - $couponBeingCreated = new Coupon(); - $couponBeingCreated->setCode($data['code']); - $couponBeingCreated->setType($data['type']); - $couponBeingCreated->setTitle($data['title']); - $couponBeingCreated->setShortDescription($data['shortDescription']); - $couponBeingCreated->setDescription($data['description']); - $couponBeingCreated->setAmount($data['amount']); - $couponBeingCreated->setIsEnabled($data['isEnabled']); - $couponBeingCreated->setExpirationDate($data['expirationDate']); - $couponBeingCreated->setSerializedConditions( - new ConditionCollection( - array() - ) - ); - $couponBeingCreated->setIsCumulative($data['isCumulative']); - $couponBeingCreated->setIsRemovingPostage( - $data['isRemovingPostage'] - ); - $couponBeingCreated->setMaxUsage($data['maxUsage']); - $couponBeingCreated->setIsAvailableOnSpecialOffers( - $data['isAvailableOnSpecialOffers'] - ); - - return $couponBeingCreated; - } - /** * Log error message * @@ -528,8 +447,6 @@ class CouponController extends BaseAdminController /** * Validate the CreateOrUpdate form * - * @param I18n $i18n Local code (fr_FR) - * @param Lang $lang Local variables container * @param string $eventToDispatch Event which will activate actions * @param string $log created|edited * @param string $action creation|edition @@ -537,15 +454,15 @@ class CouponController extends BaseAdminController * * @return $this */ - protected function validateCreateOrUpdateForm(I18n $i18n, Lang $lang, $eventToDispatch, $log, $action, Coupon $model = null) + protected function validateCreateOrUpdateForm($eventToDispatch, $log, $action, Coupon $model = null) { // Create the form from the request - $creationForm = new CouponCreationForm($this->getRequest()); + $couponForm = new CouponCreationForm($this->getRequest()); $message = false; try { // Check the form against conditions violations - $form = $this->validateForm($creationForm, 'POST'); + $form = $this->validateForm($couponForm, 'POST'); $couponEvent = $this->feedCouponCreateOrUpdateEvent($form, $model); @@ -564,31 +481,39 @@ class CouponController extends BaseAdminController ) ); - $this->redirect( - str_replace( - '{id}', - $couponEvent->getCouponModel()->getId(), - $creationForm->getSuccessUrl() - ) - ); + if ($this->getRequest()->get('save_mode') == 'stay') { + $this->redirect( + str_replace( + '{id}', + $couponEvent->getCouponModel()->getId(), + $couponForm->getSuccessUrl() + ) + ); - } catch (FormValidationException $e) { + exit(); + } + + // Redirect to the success URL + $this->redirectToRoute('admin.coupon.list'); + + } catch (FormValidationException $ex) { // Invalid data entered - $message = 'Please check your input:'; + $message = $this->createStandardFormValidationErrorMessage($ex); - } catch (\Exception $e) { + } catch (\Exception $ex) { // Any other error - $message = 'Sorry, an error occurred:'; - $this->logError($action, $message, $e); + $message = $this->getTranslator()->trans('Sorry, an error occurred: %err', ['%err' => $ex->getMessage()]); + + $this->logError($action, $message, $ex); } if ($message !== false) { // Mark the form as with error - $creationForm->setErrorMessage($message); + $couponForm->setErrorMessage($message); // Send the form and the error to the parser $this->getParserContext() - ->addForm($creationForm) + ->addForm($couponForm) ->setGeneralError($message); } @@ -605,10 +530,10 @@ class CouponController extends BaseAdminController /** @var CouponManager $couponManager */ $couponManager = $this->container->get('thelia.coupon.manager'); $availableConditions = $couponManager->getAvailableConditions(); - $cleanedConditions = array(); + $cleanedConditions = []; /** @var ConditionInterface $availableCondition */ foreach ($availableConditions as $availableCondition) { - $condition = array(); + $condition = []; $condition['serviceId'] = $availableCondition->getServiceId(); $condition['name'] = $availableCondition->getName(); $condition['toolTip'] = $availableCondition->getToolTip(); @@ -628,10 +553,10 @@ class CouponController extends BaseAdminController /** @var CouponManager $couponManager */ $couponManager = $this->container->get('thelia.coupon.manager'); $availableCoupons = $couponManager->getAvailableCoupons(); - $cleanedCoupons = array(); + $cleanedCoupons = []; /** @var CouponInterface $availableCoupon */ foreach ($availableCoupons as $availableCoupon) { - $condition = array(); + $condition = []; $condition['serviceId'] = $availableCoupon->getServiceId(); $condition['name'] = $availableCoupon->getName(); $condition['toolTip'] = $availableCoupon->getToolTip(); @@ -651,17 +576,17 @@ class CouponController extends BaseAdminController */ protected function cleanConditionForTemplate(ConditionCollection $conditions) { - $cleanedConditions = array(); + $cleanedConditions = []; /** @var $condition ConditionInterface */ foreach ($conditions as $index => $condition) { - $temp = array( + $temp = [ 'serviceId' => $condition->getServiceId(), 'index' => $index, 'name' => $condition->getName(), 'toolTip' => $condition->getToolTip(), 'summary' => $condition->getSummary(), 'validators' => $condition->getValidators() - ); + ]; $cleanedConditions[] = $temp; } @@ -678,7 +603,10 @@ class CouponController extends BaseAdminController */ public function getBackOfficeInputsAjaxAction($couponServiceId) { - $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW); + if (null !== $response = $this->checkAuth(AdminResources::COUPON, [], AccessManager::VIEW)) { + return $response; + } + $this->checkXmlHttpRequest(); /** @var CouponInterface $coupon */ @@ -703,7 +631,10 @@ class CouponController extends BaseAdminController */ public function getBackOfficeConditionSummariesAjaxAction($couponId) { - $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW); + if (null !== $response = $this->checkAuth(AdminResources::COUPON, [], AccessManager::VIEW)) { + return $response; + } + $this->checkXmlHttpRequest(); /** @var Coupon $coupon */ @@ -721,7 +652,7 @@ class CouponController extends BaseAdminController return $this->pageNotFound(); } - $args = array(); + $args = []; $args['conditions'] = $this->cleanConditionForTemplate($couponManager->getConditions()); return $this->render('coupon/conditions', $args); @@ -772,7 +703,7 @@ class CouponController extends BaseAdminController $serviceId = $data['type']; /** @var CouponInterface $couponManager */ $couponManager = $this->container->get($serviceId); - $effects = array(CouponAbstract::INPUT_AMOUNT_NAME => $data[CouponAbstract::INPUT_AMOUNT_NAME]); + $effects = [CouponAbstract::INPUT_AMOUNT_NAME => $data[CouponAbstract::INPUT_AMOUNT_NAME]]; $effects = $this->addExtendedLogic($effects, $couponManager->getExtendedInputs()); $couponEvent = new CouponCreateOrUpdateEvent( @@ -783,7 +714,7 @@ class CouponController extends BaseAdminController $data['shortDescription'], $data['description'], $data['isEnabled'], - \DateTime::createFromFormat('Y-m-d', $data['expirationDate']), + \DateTime::createFromFormat($this->getDefaultDateFormat(), $data['expirationDate']), $data['isAvailableOnSpecialOffers'], $data['isCumulative'], $data['isRemovingPostage'], @@ -809,8 +740,8 @@ class CouponController extends BaseAdminController $request = $this->getRequest(); $post = $request->request->getIterator(); $serviceId = $request->request->get('categoryCondition'); - $operators = array(); - $values = array(); + $operators = []; + $values = []; foreach ($post as $key => $input) { if (isset($input['operator']) && isset($input['value'])) { $operators[$key] = $input['operator']; @@ -868,4 +799,8 @@ class CouponController extends BaseAdminController ); } + protected function getDefaultDateFormat() + { + return LangQuery::create()->findOneByByDefault(true)->getDateFormat(); + } } diff --git a/core/lib/Thelia/Controller/Admin/CurrencyController.php b/core/lib/Thelia/Controller/Admin/CurrencyController.php index a9212c0d4..158d8f2b5 100644 --- a/core/lib/Thelia/Controller/Admin/CurrencyController.php +++ b/core/lib/Thelia/Controller/Admin/CurrencyController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/CustomerController.php b/core/lib/Thelia/Controller/Admin/CustomerController.php index cf655a30e..895490cb2 100644 --- a/core/lib/Thelia/Controller/Admin/CustomerController.php +++ b/core/lib/Thelia/Controller/Admin/CustomerController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; @@ -101,6 +90,7 @@ class CustomerController extends AbstractCrudController 'lastname' => $object->getLastname(), 'email' => $object->getEmail(), 'title' => $object->getTitleId(), + 'discount' => $object->getDiscount(), ); if ($address !== null) { @@ -182,7 +172,6 @@ class CustomerController extends AbstractCrudController { return $this->render('customers', array_merge(array( 'customer_order' => $currentOrder, - 'display_customer' => 20, 'page' => $this->getRequest()->get('page', 1) ), $customParams) ); diff --git a/core/lib/Thelia/Controller/Admin/CustomerExportController.php b/core/lib/Thelia/Controller/Admin/CustomerExportController.php new file mode 100644 index 000000000..5e9900dba --- /dev/null +++ b/core/lib/Thelia/Controller/Admin/CustomerExportController.php @@ -0,0 +1,66 @@ + + */ +class CustomerExportController extends BaseAdminController +{ + + public function NewsletterExportAction() + { + if (null !== $response = $this->checkAuth([AdminResources::EXPORT_CUSTOMER_NEWSLETTER], [], [AccessManager::VIEW])) { + return $response; + } + + $data = NewsletterQuery::create() + ->select([ + 'email', + 'firstname', + 'lastname', + 'locale' + ]) + ->find(); + + $handle = fopen('php://memory', 'r+'); + + fputcsv($handle, ['email','firstname','lastname','locale'], ';', '"'); + + foreach ($data->toArray() as $customer) { + fputcsv($handle, $customer, ';', '"'); + } + + rewind($handle); + $content = stream_get_contents($handle); + fclose($handle); + + return Response::create( + $content, + 200, + array( + "Content-Type"=>"application/csv-tab-delimited-table", + "Content-disposition"=>"filename=export_customer_newsletter.csv" + ) + ); + + } + +} diff --git a/core/lib/Thelia/Controller/Admin/ExportController.php b/core/lib/Thelia/Controller/Admin/ExportController.php new file mode 100644 index 000000000..279ed8b4c --- /dev/null +++ b/core/lib/Thelia/Controller/Admin/ExportController.php @@ -0,0 +1,34 @@ + + */ +class ExportController extends BaseAdminController +{ + + public function indexAction() + { + if (null !== $response = $this->checkAuth([AdminResources::EXPORT], [], [AccessManager::VIEW])) { + return $response; + } + + return $this->render('export'); + } +} diff --git a/core/lib/Thelia/Controller/Admin/FeatureAvController.php b/core/lib/Thelia/Controller/Admin/FeatureAvController.php index 9eea87b32..22dbbedcd 100644 --- a/core/lib/Thelia/Controller/Admin/FeatureAvController.php +++ b/core/lib/Thelia/Controller/Admin/FeatureAvController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/FeatureController.php b/core/lib/Thelia/Controller/Admin/FeatureController.php index 1a149e248..a923e0803 100644 --- a/core/lib/Thelia/Controller/Admin/FeatureController.php +++ b/core/lib/Thelia/Controller/Admin/FeatureController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/FileController.php b/core/lib/Thelia/Controller/Admin/FileController.php index 4e8fb6403..8494d833a 100644 --- a/core/lib/Thelia/Controller/Admin/FileController.php +++ b/core/lib/Thelia/Controller/Admin/FileController.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Controller\Admin; @@ -88,8 +77,8 @@ class FileController extends BaseAdminController $message = $this->getTranslator() ->trans( 'File is too heavy, please retry with a file having a size less than %size%.', - array('%size%' => ini_get('post_max_size')), - 'image' + array('%size%' => ini_get('upload_max_filesize')), + 'core' ); return new ResponseRest($message, 'text', 403); diff --git a/core/lib/Thelia/Controller/Admin/FolderController.php b/core/lib/Thelia/Controller/Admin/FolderController.php index 9ae826173..a4d64ebfe 100644 --- a/core/lib/Thelia/Controller/Admin/FolderController.php +++ b/core/lib/Thelia/Controller/Admin/FolderController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/HomeController.php b/core/lib/Thelia/Controller/Admin/HomeController.php index d4458843d..d30d8000c 100644 --- a/core/lib/Thelia/Controller/Admin/HomeController.php +++ b/core/lib/Thelia/Controller/Admin/HomeController.php @@ -1,28 +1,18 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; +use Thelia\Core\HttpFoundation\Response; use Thelia\Core\Security\AccessManager; use Thelia\Model\CustomerQuery; use Thelia\Model\OrderQuery; @@ -39,13 +29,33 @@ class HomeController extends BaseAdminController return $this->render('home'); } + /** + * Get the latest available Thelia version from the Thelia web site. + * + * @return Thelia\Core\HttpFoundation\Response the response + */ + public function getLatestTheliaVersion() + { + if (null !== $response = $this->checkAuth(self::RESOURCE_CODE, array(), AccessManager::VIEW)) return $response; + + // get the latest version + $version = @file_get_contents("http://thelia.net/version.php"); + + if ($version === false) + $version = $this->getTranslator()->trans("Not found"); + else if (! preg_match("/^[0-9.]*$/", $version)) + $version = $this->getTranslator()->trans("Unavailable"); + + return Response::create($version); + } + public function loadStatsAjaxAction() { if (null !== $response = $this->checkAuth(self::RESOURCE_CODE, array(), AccessManager::VIEW)) return $response; $data = new \stdClass(); - $data->title = "Stats on " . $this->getRequest()->query->get('month', date('m')) . "/" . $this->getRequest()->query->get('year', date('Y')); + $data->title = $this->getTranslator()->trans("Stats on %month/%year", array('%month' => $this->getRequest()->query->get('month', date('m')), '%year' => $this->getRequest()->query->get('year', date('Y')))); /* sales */ $saleSeries = new \stdClass(); diff --git a/core/lib/Thelia/Controller/Admin/LangController.php b/core/lib/Thelia/Controller/Admin/LangController.php index 543f09047..a3957b6e0 100644 --- a/core/lib/Thelia/Controller/Admin/LangController.php +++ b/core/lib/Thelia/Controller/Admin/LangController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; @@ -85,7 +74,10 @@ class LangController extends BaseAdminController 'code' => $lang->getCode(), 'locale' => $lang->getLocale(), 'date_format' => $lang->getDateFormat(), - 'time_format' => $lang->getTimeFormat() + 'time_format' => $lang->getTimeFormat(), + 'decimal_separator' => $lang->getDecimalSeparator(), + 'thousands_separator' => $lang->getThousandsSeparator(), + 'decimals' => $lang->getDecimals(), )); $this->getParserContext()->addForm($langForm); @@ -135,6 +127,9 @@ class LangController extends BaseAdminController ->setLocale($form->get('locale')->getData()) ->setDateFormat($form->get('date_format')->getData()) ->setTimeFormat($form->get('time_format')->getData()) + ->setDecimalSeparator($form->get('decimal_separator')->getData()) + ->setThousandsSeparator($form->get('thousands_separator')->getData()) + ->setDecimals($form->get('decimals')->getData()) ; } diff --git a/core/lib/Thelia/Controller/Admin/LanguageController.php b/core/lib/Thelia/Controller/Admin/LanguageController.php index b91124277..f9c8ef865 100644 --- a/core/lib/Thelia/Controller/Admin/LanguageController.php +++ b/core/lib/Thelia/Controller/Admin/LanguageController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/MailingSystemController.php b/core/lib/Thelia/Controller/Admin/MailingSystemController.php index 1fe79c353..420cfada8 100644 --- a/core/lib/Thelia/Controller/Admin/MailingSystemController.php +++ b/core/lib/Thelia/Controller/Admin/MailingSystemController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/MessageController.php b/core/lib/Thelia/Controller/Admin/MessageController.php index e6b50c96d..80a1dd669 100644 --- a/core/lib/Thelia/Controller/Admin/MessageController.php +++ b/core/lib/Thelia/Controller/Admin/MessageController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/ModuleController.php b/core/lib/Thelia/Controller/Admin/ModuleController.php index 2eedc8f44..d9225b01b 100644 --- a/core/lib/Thelia/Controller/Admin/ModuleController.php +++ b/core/lib/Thelia/Controller/Admin/ModuleController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/OrderController.php b/core/lib/Thelia/Controller/Admin/OrderController.php index b532ae102..4c1c48b5b 100644 --- a/core/lib/Thelia/Controller/Admin/OrderController.php +++ b/core/lib/Thelia/Controller/Admin/OrderController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/ProductController.php b/core/lib/Thelia/Controller/Admin/ProductController.php index 38cd917ea..7ca94d73f 100644 --- a/core/lib/Thelia/Controller/Admin/ProductController.php +++ b/core/lib/Thelia/Controller/Admin/ProductController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; @@ -73,6 +62,7 @@ use Thelia\Form\ProductSaleElementUpdateForm; use Thelia\Form\ProductDefaultSaleElementUpdateForm; use Thelia\Form\ProductCombinationGenerationForm; +use Thelia\Model\TaxRuleQuery; use Thelia\TaxEngine\Calculator; use Thelia\Tools\NumberFormat; @@ -1155,10 +1145,10 @@ class ProductController extends AbstractSeoCrudController { $return_price = 0; - $price = floatval($this->getRequest()->get('price', 0)); - $product_id = intval($this->getRequest()->get('product_id', 0)); - $action = $this->getRequest()->get('action', ''); // With ot without tax - $convert = intval($this->getRequest()->get('convert_from_default_currency', 0)); + $price = floatval($this->getRequest()->query->get('price', 0)); + $product_id = intval($this->getRequest()->query->get('product_id', 0)); + $action = $this->getRequest()->query->get('action', ''); // With ot without tax + $convert = intval($this->getRequest()->query->get('convert_from_default_currency', 0)); if (null !== $product = ProductQuery::create()->findPk($product_id)) { @@ -1171,7 +1161,46 @@ class ProductController extends AbstractSeoCrudController } if ($convert != 0) { - $return_price = $prix * Currency::getDefaultCurrency()->getRate(); + $return_price = $price * Currency::getDefaultCurrency()->getRate(); + } + } + + return new JsonResponse(array('result' => $return_price)); + } + + /** + * + * Calculate tax or untax price for a non existing product. + * + * For an existing product, use self::priceCaclulator + * + * @return JsonResponse + */ + public function calculatePrice() + { + $return_price = 0; + + $price = floatval($this->getRequest()->query->get('price')); + $tax_rule_id = intval($this->getRequest()->query->get('tax_rule')); + $action = $this->getRequest()->query->get('action'); // With ot without tax + + $taxRule = TaxRuleQuery::create()->findPk($tax_rule_id); + + if (null !== $price && null !== $taxRule) { + + $calculator = new Calculator(); + + $calculator->loadTaxRuleWithoutProduct( + $taxRule, + Country::getShopLocation() + ); + + if ($action == 'to_tax') { + $return_price = $calculator->getTaxedPrice($price); + } elseif ($action == 'from_tax') { + $return_price = $calculator->getUntaxedPrice($price); + } else { + $return_price = $price; } } @@ -1251,7 +1280,7 @@ class ProductController extends AbstractSeoCrudController } if ($convert != 0) { - $return_price = $prix * Currency::getDefaultCurrency()->getRate(); + $return_price = $price * Currency::getDefaultCurrency()->getRate(); } // Format the number using '.', to perform further calculation diff --git a/core/lib/Thelia/Controller/Admin/ProfileController.php b/core/lib/Thelia/Controller/Admin/ProfileController.php index 22794789f..261376f21 100644 --- a/core/lib/Thelia/Controller/Admin/ProfileController.php +++ b/core/lib/Thelia/Controller/Admin/ProfileController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/SessionController.php b/core/lib/Thelia/Controller/Admin/SessionController.php index b896e9a7b..07e716354 100644 --- a/core/lib/Thelia/Controller/Admin/SessionController.php +++ b/core/lib/Thelia/Controller/Admin/SessionController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/ShippingZoneController.php b/core/lib/Thelia/Controller/Admin/ShippingZoneController.php index 82b630398..b0de2b79a 100644 --- a/core/lib/Thelia/Controller/Admin/ShippingZoneController.php +++ b/core/lib/Thelia/Controller/Admin/ShippingZoneController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; @@ -46,11 +35,11 @@ class ShippingZoneController extends BaseAdminController return $this->render("shipping-zones", array("display_shipping_zone" => 20)); } - public function updateAction($shipping_zones_id) + public function updateAction($delivery_module_id) { if (null !== $response = $this->checkAuth(AdminResources::SHIPPING_ZONE, array(), AccessManager::VIEW)) return $response; return $this->render("shipping-zones-edit", array( - "shipping_zones_id" => $shipping_zones_id + "delivery_module_id" => $delivery_module_id )); } @@ -133,13 +122,13 @@ class ShippingZoneController extends BaseAdminController protected function renderEditionTemplate() { return $this->render("shipping-zones-edit", array( - "shipping_zones_id" => $this->getShippingZoneId() + "delivery_module_id" => $this->getDeliveryModuleId() )); } - protected function getShippingZoneId() + protected function getDeliveryModuleId() { - return $this->getRequest()->get('shipping_zone_id', 0); + return $this->getRequest()->get('delivery_module_id', 0); } } diff --git a/core/lib/Thelia/Controller/Admin/SystemLogController.php b/core/lib/Thelia/Controller/Admin/SystemLogController.php index 37d27a7be..9dc45f3c9 100644 --- a/core/lib/Thelia/Controller/Admin/SystemLogController.php +++ b/core/lib/Thelia/Controller/Admin/SystemLogController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/TaxController.php b/core/lib/Thelia/Controller/Admin/TaxController.php index e89ffba9c..19670b15b 100644 --- a/core/lib/Thelia/Controller/Admin/TaxController.php +++ b/core/lib/Thelia/Controller/Admin/TaxController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/TaxRuleController.php b/core/lib/Thelia/Controller/Admin/TaxRuleController.php index 5ae75c8ec..dbbbd3eb8 100644 --- a/core/lib/Thelia/Controller/Admin/TaxRuleController.php +++ b/core/lib/Thelia/Controller/Admin/TaxRuleController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/TemplateController.php b/core/lib/Thelia/Controller/Admin/TemplateController.php index bd2d9bf9c..82f22f241 100644 --- a/core/lib/Thelia/Controller/Admin/TemplateController.php +++ b/core/lib/Thelia/Controller/Admin/TemplateController.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; diff --git a/core/lib/Thelia/Controller/Admin/ToolsController.php b/core/lib/Thelia/Controller/Admin/ToolsController.php new file mode 100644 index 000000000..9d19cccd9 --- /dev/null +++ b/core/lib/Thelia/Controller/Admin/ToolsController.php @@ -0,0 +1,33 @@ + + */ +class ToolsController extends BaseAdminController +{ + public function indexAction() + { + if (null !== $response = $this->checkAuth([AdminResources::TOOLS], [], [AccessManager::VIEW])) { + return $response; + } + + return $this->render('tools'); + } +} diff --git a/core/lib/Thelia/Controller/Admin/TranslationsController.php b/core/lib/Thelia/Controller/Admin/TranslationsController.php index 453e32485..93aab31cb 100644 --- a/core/lib/Thelia/Controller/Admin/TranslationsController.php +++ b/core/lib/Thelia/Controller/Admin/TranslationsController.php @@ -1,30 +1,22 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Controller\Admin; +use Symfony\Component\Finder\Finder; use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\AccessManager; +use Thelia\Core\Translation\Translator; +use Thelia\Model\Module; use Thelia\Model\ModuleQuery; use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateDefinition; @@ -36,13 +28,47 @@ use Thelia\Tools\URL; */ class TranslationsController extends BaseAdminController { + /** + * @param string $item_name the modume code + * @return Module the module object + * @throws \InvalidArgumentException if module was not found + */ + protected function getModule($item_name) + { + if (null !== $module = ModuleQuery::create()->findPk($item_name)) + return $module; + + throw new \InvalidArgumentException( + $this->getTranslator()->trans("No module found for code '%item'", ['%item' => $item_name]) + ); + } + + protected function getModuleTemplateNames(Module $module, $template_type) + { + $templates = + TemplateHelper::getInstance()->getList( + $template_type, + $module->getAbsoluteTemplateBasePath() + ); + + $names = []; + + foreach($templates as $template) $names[] = $template->getName(); + + return $names; + } + protected function renderTemplate() { - // Get related strings, if all input data are here $item_to_translate = $this->getRequest()->get('item_to_translate'); - $item_id = $this->getRequest()->get('item_id', ''); + $item_name = $this->getRequest()->get('item_name', ''); + + if ($item_to_translate == 'mo' && ! empty($item_name)) + $module_part = $this->getRequest()->get('module_part', ''); + else + $module_part = false; $all_strings = array(); @@ -52,55 +78,134 @@ class TranslationsController extends BaseAdminController $templateArguments = array( 'item_to_translate' => $item_to_translate, - 'item_id' => $item_id, + 'item_name' => $item_name, + 'module_part' => $module_part, 'view_missing_traductions_only' => $this->getRequest()->get('view_missing_traductions_only', 0), 'max_input_vars_warning' => false, ); // Find the i18n directory, and the directory to examine. - if (! empty($item_id) || $item_to_translate == 'co') { + if (! empty($item_name) || $item_to_translate == 'co') { switch ($item_to_translate) { + // Module core case 'mo' : - if (null !== $module = ModuleQuery::create()->findPk($item_id)) { + $module = $this->getModule($item_name); + + if ($module_part == 'core') { $directory = $module->getAbsoluteBaseDir(); + $domain = $module->getTranslationDomain(); $i18n_directory = $module->getAbsoluteI18nPath(); $walkMode = TemplateHelper::WALK_MODE_PHP; + } elseif ($module_part == 'admin-includes') { + $directory = $module->getAbsoluteAdminIncludesPath(); + $domain = $module->getAdminIncludesTranslationDomain(); + $i18n_directory = $module->getAbsoluteAdminIncludesI18nPath(); + $walkMode = TemplateHelper::WALK_MODE_TEMPLATE; + } elseif (! empty($module_part)) { + // Front or back office template, form of $module_part is [bo|fo].subdir-name + list($type, $subdir) = explode('.', $module_part); + + if ($type == 'bo') { + $directory = $module->getAbsoluteBackOfficeTemplatePath($subdir); + $domain = $module->getBackOfficeTemplateTranslationDomain($subdir); + $i18n_directory = $module->getAbsoluteBackOfficeI18nTemplatePath($subdir); + } elseif ($type == 'fo') { + $directory = $module->getAbsoluteFrontOfficeTemplatePath($subdir); + $domain = $module->getFrontOfficeTemplateTranslationDomain($subdir); + $i18n_directory = $module->getAbsoluteFrontOfficeI18nTemplatePath($subdir); + } else { + throw new \InvalidArgumentException("Undefined module template type: '$type'."); + } + + $walkMode = TemplateHelper::WALK_MODE_TEMPLATE; } + + // If the module is not active, load the translation file, + // as it is not already loaded in Thelia.php + if (! empty ($domain) && ! $module->getActivate()) { + $this->loadTranslation($i18n_directory, $domain); + } + + // List front and back office templates defined by this module + $templateArguments['back_office_templates'] = + implode(',', $this->getModuleTemplateNames($module, TemplateDefinition::BACK_OFFICE)); + + $templateArguments['front_office_templates'] = + implode(',', $this->getModuleTemplateNames($module, TemplateDefinition::FRONT_OFFICE)); + + // Check if we have admin-include files + try { + $finder = Finder::create() + ->files() + ->depth(0) + ->in($module->getAbsoluteAdminIncludesPath()) + ->name('/\.html$/i') + ; + + $hasAdminIncludes = $finder->count() > 0; + } catch (\InvalidArgumentException $ex) { + $hasAdminIncludes = false; + } + + $templateArguments['has_admin_includes'] = $hasAdminIncludes; + break; + // Thelia Core case 'co' : $directory = THELIA_ROOT . 'core/lib/Thelia'; + $domain = 'core'; $i18n_directory = THELIA_ROOT . 'core/lib/Thelia/Config/I18n'; $walkMode = TemplateHelper::WALK_MODE_PHP; break; + // Front-office template case 'fo' : - $template = new TemplateDefinition($item_id, TemplateDefinition::FRONT_OFFICE); + $template = new TemplateDefinition($item_name, TemplateDefinition::FRONT_OFFICE); break; + // Back-office template case 'bo' : - $template = new TemplateDefinition($item_id, TemplateDefinition::BACK_OFFICE); + $template = new TemplateDefinition($item_name, TemplateDefinition::BACK_OFFICE); break; + // PDF templates case 'pf' : - $template = new TemplateDefinition($item_id, TemplateDefinition::PDF); + $template = new TemplateDefinition($item_name, TemplateDefinition::PDF); break; + // Email templates case 'ma' : - $template = new TemplateDefinition($item_id, TemplateDefinition::EMAIL); + $template = new TemplateDefinition($item_name, TemplateDefinition::EMAIL); break; + + default: + /* + throw new \InvalidArgumentException( + $this->getTranslator()->trans("Undefined translation type: %item", ['%item' => $item_to_translate]) + ); + */ } if ($template) { $directory = $template->getAbsolutePath(); + $i18n_directory = $template->getAbsoluteI18nPath(); + + $domain = $template->getTranslationDomain(); + + // Load translations files is this template is not the current template + // as it is not loaded in Thelia.php + if (! TemplateHelper::getInstance()->isActive($template)) { + $this->loadTranslation($i18n_directory, $domain); + } } // Load strings to translate - if ($directory) { + if ($directory && ! empty($domain)) { // Save the string set, if the form was submitted if ($i18n_directory) { @@ -113,11 +218,11 @@ class TranslationsController extends BaseAdminController if (! empty($texts)) { - $file = sprintf("%s/%s.php", $i18n_directory, $this->getCurrentEditionLocale()); + $file = sprintf("%s".DS."%s.php", $i18n_directory, $this->getCurrentEditionLocale()); $translations = $this->getRequest()->get('translation', array()); - TemplateHelper::getInstance()->writeTranslation($file, $texts, $translations); + TemplateHelper::getInstance()->writeTranslation($file, $texts, $translations, true); if ($save_mode == 'stay') $this->redirectToRoute("admin.configuration.translations", $templateArguments); @@ -133,6 +238,7 @@ class TranslationsController extends BaseAdminController $walkMode, $this->getTranslator(), $this->getCurrentEditionLocale(), + $domain, $all_strings ); @@ -163,4 +269,24 @@ class TranslationsController extends BaseAdminController if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE, array(), AccessManager::UPDATE)) return $response; return $this->renderTemplate(); } + + private function loadTranslation($directory, $domain) + { + try { + $finder = Finder::create() + ->files() + ->depth(0) + ->in($directory); + + /** @var \DirectoryIterator $file */ + foreach ($finder as $file) { + list($locale, $format) = explode('.', $file->getBaseName(), 2); + + Translator::getInstance()->addResource($format, $file->getPathname(), $locale, $domain); + } + } catch (\InvalidArgumentException $ex) { + // Ignore missing I18n directories + } + } + } diff --git a/core/lib/Thelia/Controller/BaseController.php b/core/lib/Thelia/Controller/BaseController.php index e8243d0e4..162b5a814 100644 --- a/core/lib/Thelia/Controller/BaseController.php +++ b/core/lib/Thelia/Controller/BaseController.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Controller; use Thelia\Core\Event\PdfEvent; diff --git a/core/lib/Thelia/Controller/Front/BaseFrontController.php b/core/lib/Thelia/Controller/Front/BaseFrontController.php index 00ac8143d..e9bc4754b 100644 --- a/core/lib/Thelia/Controller/Front/BaseFrontController.php +++ b/core/lib/Thelia/Controller/Front/BaseFrontController.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Controller\Front; use Symfony\Component\Routing\Router; @@ -48,13 +38,13 @@ class BaseFrontController extends BaseController /** * Redirect to à route ID related URL * - * @param unknown $routeId the route ID, as found in Config/Resources/routing/admin.xml - * @param array|\Thelia\Controller\Front\unknown $urlParameters the URL parametrs, as a var/value pair array - * @param bool $referenceType + * @param string $routeId the route ID, as found in Config/Resources/routing/admin.xml + * @param array $urlParameters the URL parametrs, as a var/value pair array + * @param bool $referenceType */ - public function redirectToRoute($routeId, $urlParameters = array(), $referenceType = Router::ABSOLUTE_PATH) + public function redirectToRoute($routeId, array $urlParameters = [], array $routeParameters = [], $referenceType = Router::ABSOLUTE_PATH) { - $this->redirect(URL::getInstance()->absoluteUrl($this->getRoute($routeId, array(), $referenceType), $urlParameters)); + $this->redirect(URL::getInstance()->absoluteUrl($this->getRoute($routeId, $routeParameters, $referenceType), $urlParameters)); } public function checkAuth() @@ -104,9 +94,9 @@ class BaseFrontController extends BaseController /** * Render the given template, and returns the result as an Http Response. * - * @param $templateName the complete template name, with extension - * @param array $args the template arguments - * @param int $status http code status + * @param string $templateName the complete template name, with extension + * @param array $args the template arguments + * @param int $status http code status * @return \Thelia\Core\HttpFoundation\Response */ protected function render($templateName, $args = array(), $status = 200) diff --git a/core/lib/Thelia/Controller/Front/DefaultController.php b/core/lib/Thelia/Controller/Front/DefaultController.php index bd2b31fa5..a7ec4d999 100644 --- a/core/lib/Thelia/Controller/Front/DefaultController.php +++ b/core/lib/Thelia/Controller/Front/DefaultController.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Controller\Front; use Symfony\Component\HttpFoundation\Request; diff --git a/core/lib/Thelia/Core/Application.php b/core/lib/Thelia/Core/Application.php index bb0eec79a..be0e5c6e5 100644 --- a/core/lib/Thelia/Core/Application.php +++ b/core/lib/Thelia/Core/Application.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core; diff --git a/core/lib/Thelia/Core/Bundle/TheliaBundle.php b/core/lib/Thelia/Core/Bundle/TheliaBundle.php index 4678bae88..bb476c402 100644 --- a/core/lib/Thelia/Core/Bundle/TheliaBundle.php +++ b/core/lib/Thelia/Core/Bundle/TheliaBundle.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\Bundle; use Symfony\Component\DependencyInjection\Compiler\PassConfig; diff --git a/core/lib/Thelia/Core/Controller/ControllerResolver.php b/core/lib/Thelia/Core/Controller/ControllerResolver.php index c58961ebe..8a6174fd5 100644 --- a/core/lib/Thelia/Core/Controller/ControllerResolver.php +++ b/core/lib/Thelia/Core/Controller/ControllerResolver.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Controller; diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCouponConditionPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCouponConditionPass.php index 127d0e334..123a881b2 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCouponConditionPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCouponConditionPass.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Core\DependencyInjection\Compiler; diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCouponPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCouponPass.php index a499c8ed1..3da3a293d 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCouponPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCouponPass.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Core\DependencyInjection\Compiler; diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterListenersPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterListenersPass.php index 08fcd777b..5bfdca4de 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterListenersPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterListenersPass.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\DependencyInjection\Compiler; diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterParserPluginPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterParserPluginPass.php index 71d96ca40..621f5a7e0 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterParserPluginPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterParserPluginPass.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\DependencyInjection\Compiler; diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterRouterPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterRouterPass.php index 845a659d2..ccb52f9ee 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterRouterPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterRouterPass.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php index 43f84ebd5..9e53540e6 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\DependencyInjection\Compiler; diff --git a/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php b/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php index 294c9b671..a8808372d 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php +++ b/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\DependencyInjection\Loader; diff --git a/core/lib/Thelia/Core/Event/AccessoryEvent.php b/core/lib/Thelia/Core/Event/AccessoryEvent.php index afb0a9861..b47369526 100644 --- a/core/lib/Thelia/Core/Event/AccessoryEvent.php +++ b/core/lib/Thelia/Core/Event/AccessoryEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/ActionEvent.php b/core/lib/Thelia/Core/Event/ActionEvent.php index 41886fd82..3fefb3cd0 100644 --- a/core/lib/Thelia/Core/Event/ActionEvent.php +++ b/core/lib/Thelia/Core/Event/ActionEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/Address/AddressCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Address/AddressCreateOrUpdateEvent.php index 15ef944d7..08e05bf31 100644 --- a/core/lib/Thelia/Core/Event/Address/AddressCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Address/AddressCreateOrUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Address; diff --git a/core/lib/Thelia/Core/Event/Address/AddressEvent.php b/core/lib/Thelia/Core/Event/Address/AddressEvent.php index 2ef553326..c4d6f4c24 100644 --- a/core/lib/Thelia/Core/Event/Address/AddressEvent.php +++ b/core/lib/Thelia/Core/Event/Address/AddressEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Address; diff --git a/core/lib/Thelia/Core/Event/Administrator/AdministratorEvent.php b/core/lib/Thelia/Core/Event/Administrator/AdministratorEvent.php index 54716aada..23faa0187 100644 --- a/core/lib/Thelia/Core/Event/Administrator/AdministratorEvent.php +++ b/core/lib/Thelia/Core/Event/Administrator/AdministratorEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Administrator; diff --git a/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php b/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php index 5c310d7cb..081c87d91 100644 --- a/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php +++ b/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Administrator; diff --git a/core/lib/Thelia/Core/Event/Area/AreaAddCountryEvent.php b/core/lib/Thelia/Core/Event/Area/AreaAddCountryEvent.php index 5c98c071c..29d71897b 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaAddCountryEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaAddCountryEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Area; diff --git a/core/lib/Thelia/Core/Event/Area/AreaCreateEvent.php b/core/lib/Thelia/Core/Event/Area/AreaCreateEvent.php index d833b4128..636208317 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Area; diff --git a/core/lib/Thelia/Core/Event/Area/AreaDeleteEvent.php b/core/lib/Thelia/Core/Event/Area/AreaDeleteEvent.php index 2a83c98a4..f06143bb1 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Area; diff --git a/core/lib/Thelia/Core/Event/Area/AreaEvent.php b/core/lib/Thelia/Core/Event/Area/AreaEvent.php index 6c951335a..be4919a18 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Area; diff --git a/core/lib/Thelia/Core/Event/Area/AreaRemoveCountryEvent.php b/core/lib/Thelia/Core/Event/Area/AreaRemoveCountryEvent.php index 92cfd57d3..8cfa11b4e 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaRemoveCountryEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaRemoveCountryEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Area; diff --git a/core/lib/Thelia/Core/Event/Area/AreaUpdateEvent.php b/core/lib/Thelia/Core/Event/Area/AreaUpdateEvent.php index 361607f42..f9b6cb89f 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Area; diff --git a/core/lib/Thelia/Core/Event/Area/AreaUpdatePostageEvent.php b/core/lib/Thelia/Core/Event/Area/AreaUpdatePostageEvent.php index b9cb825c4..c3181467b 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaUpdatePostageEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaUpdatePostageEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Area; diff --git a/core/lib/Thelia/Core/Event/Attribute/AttributeAvCreateEvent.php b/core/lib/Thelia/Core/Event/Attribute/AttributeAvCreateEvent.php index d61299142..4481f19ff 100644 --- a/core/lib/Thelia/Core/Event/Attribute/AttributeAvCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Attribute/AttributeAvCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Attribute; diff --git a/core/lib/Thelia/Core/Event/Attribute/AttributeAvDeleteEvent.php b/core/lib/Thelia/Core/Event/Attribute/AttributeAvDeleteEvent.php index 574446f80..6dc341e72 100644 --- a/core/lib/Thelia/Core/Event/Attribute/AttributeAvDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Attribute/AttributeAvDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Attribute; diff --git a/core/lib/Thelia/Core/Event/Attribute/AttributeAvEvent.php b/core/lib/Thelia/Core/Event/Attribute/AttributeAvEvent.php index 3dcf1e889..8779f833e 100644 --- a/core/lib/Thelia/Core/Event/Attribute/AttributeAvEvent.php +++ b/core/lib/Thelia/Core/Event/Attribute/AttributeAvEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Attribute; diff --git a/core/lib/Thelia/Core/Event/Attribute/AttributeAvUpdateEvent.php b/core/lib/Thelia/Core/Event/Attribute/AttributeAvUpdateEvent.php index 70f85e1e5..4a4cecfb6 100644 --- a/core/lib/Thelia/Core/Event/Attribute/AttributeAvUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Attribute/AttributeAvUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Attribute; diff --git a/core/lib/Thelia/Core/Event/Attribute/AttributeCreateEvent.php b/core/lib/Thelia/Core/Event/Attribute/AttributeCreateEvent.php index cbbab5f1a..ad3b420c4 100644 --- a/core/lib/Thelia/Core/Event/Attribute/AttributeCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Attribute/AttributeCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Attribute; diff --git a/core/lib/Thelia/Core/Event/Attribute/AttributeDeleteEvent.php b/core/lib/Thelia/Core/Event/Attribute/AttributeDeleteEvent.php index 30b1e8941..00cabb939 100644 --- a/core/lib/Thelia/Core/Event/Attribute/AttributeDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Attribute/AttributeDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Attribute; diff --git a/core/lib/Thelia/Core/Event/Attribute/AttributeEvent.php b/core/lib/Thelia/Core/Event/Attribute/AttributeEvent.php index 471505270..ce4dfb070 100644 --- a/core/lib/Thelia/Core/Event/Attribute/AttributeEvent.php +++ b/core/lib/Thelia/Core/Event/Attribute/AttributeEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Attribute; diff --git a/core/lib/Thelia/Core/Event/Attribute/AttributeUpdateEvent.php b/core/lib/Thelia/Core/Event/Attribute/AttributeUpdateEvent.php index 636cf6784..41089e203 100644 --- a/core/lib/Thelia/Core/Event/Attribute/AttributeUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Attribute/AttributeUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Attribute; diff --git a/core/lib/Thelia/Core/Event/Cache/CacheEvent.php b/core/lib/Thelia/Core/Event/Cache/CacheEvent.php index 7b21db53d..f4b821a8c 100644 --- a/core/lib/Thelia/Core/Event/Cache/CacheEvent.php +++ b/core/lib/Thelia/Core/Event/Cache/CacheEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Cache; diff --git a/core/lib/Thelia/Core/Event/CachedFileEvent.php b/core/lib/Thelia/Core/Event/CachedFileEvent.php index 8f3a026d9..fc7f52c15 100644 --- a/core/lib/Thelia/Core/Event/CachedFileEvent.php +++ b/core/lib/Thelia/Core/Event/CachedFileEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/Cart/CartEvent.php b/core/lib/Thelia/Core/Event/Cart/CartEvent.php index d7b8705be..1c719c0ae 100644 --- a/core/lib/Thelia/Core/Event/Cart/CartEvent.php +++ b/core/lib/Thelia/Core/Event/Cart/CartEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Cart; diff --git a/core/lib/Thelia/Core/Event/Cart/CartItemDuplicationItem.php b/core/lib/Thelia/Core/Event/Cart/CartItemDuplicationItem.php new file mode 100644 index 000000000..c33a484d7 --- /dev/null +++ b/core/lib/Thelia/Core/Event/Cart/CartItemDuplicationItem.php @@ -0,0 +1,57 @@ + + */ +class CartItemDuplicationItem extends ActionEvent +{ + /** + * @var \Thelia\Model\CartItem + */ + protected $oldItem; + + /** + * @var \Thelia\Model\CartItem + */ + protected $newItem; + + public function __construct(CartItem $newItem, CartItem $oldItem) + { + $this->newItem = $newItem; + $this->oldItem = $oldItem; + } + + /** + * @return \Thelia\Model\CartItem + */ + public function getNewItem() + { + return $this->newItem; + } + + /** + * @return \Thelia\Model\CartItem + */ + public function getOldItem() + { + return $this->oldItem; + } + +} diff --git a/core/lib/Thelia/Core/Event/Cart/CartItemEvent.php b/core/lib/Thelia/Core/Event/Cart/CartItemEvent.php index 83cbd17c0..f6222659e 100644 --- a/core/lib/Thelia/Core/Event/Cart/CartItemEvent.php +++ b/core/lib/Thelia/Core/Event/Cart/CartItemEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Cart; diff --git a/core/lib/Thelia/Core/Event/Category/CategoryAddContentEvent.php b/core/lib/Thelia/Core/Event/Category/CategoryAddContentEvent.php index 87b912f99..92085affc 100644 --- a/core/lib/Thelia/Core/Event/Category/CategoryAddContentEvent.php +++ b/core/lib/Thelia/Core/Event/Category/CategoryAddContentEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Category; diff --git a/core/lib/Thelia/Core/Event/Category/CategoryAssociatedContentEvent.php b/core/lib/Thelia/Core/Event/Category/CategoryAssociatedContentEvent.php index 6593419ef..6efd75173 100644 --- a/core/lib/Thelia/Core/Event/Category/CategoryAssociatedContentEvent.php +++ b/core/lib/Thelia/Core/Event/Category/CategoryAssociatedContentEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Category; diff --git a/core/lib/Thelia/Core/Event/Category/CategoryCreateEvent.php b/core/lib/Thelia/Core/Event/Category/CategoryCreateEvent.php index d574c8cf1..b55104e9c 100644 --- a/core/lib/Thelia/Core/Event/Category/CategoryCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Category/CategoryCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Category; diff --git a/core/lib/Thelia/Core/Event/Category/CategoryDeleteContentEvent.php b/core/lib/Thelia/Core/Event/Category/CategoryDeleteContentEvent.php index 5b723cf4f..7b2f77c12 100644 --- a/core/lib/Thelia/Core/Event/Category/CategoryDeleteContentEvent.php +++ b/core/lib/Thelia/Core/Event/Category/CategoryDeleteContentEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Category; diff --git a/core/lib/Thelia/Core/Event/Category/CategoryDeleteEvent.php b/core/lib/Thelia/Core/Event/Category/CategoryDeleteEvent.php index 013e2aef5..7a96e82a6 100644 --- a/core/lib/Thelia/Core/Event/Category/CategoryDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Category/CategoryDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Category; diff --git a/core/lib/Thelia/Core/Event/Category/CategoryEvent.php b/core/lib/Thelia/Core/Event/Category/CategoryEvent.php index ae0cb3b4a..f7685c124 100644 --- a/core/lib/Thelia/Core/Event/Category/CategoryEvent.php +++ b/core/lib/Thelia/Core/Event/Category/CategoryEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Category; diff --git a/core/lib/Thelia/Core/Event/Category/CategoryToggleVisibilityEvent.php b/core/lib/Thelia/Core/Event/Category/CategoryToggleVisibilityEvent.php index dc644b4f9..17f2ce6d2 100644 --- a/core/lib/Thelia/Core/Event/Category/CategoryToggleVisibilityEvent.php +++ b/core/lib/Thelia/Core/Event/Category/CategoryToggleVisibilityEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Category; diff --git a/core/lib/Thelia/Core/Event/Category/CategoryUpdateEvent.php b/core/lib/Thelia/Core/Event/Category/CategoryUpdateEvent.php index 120c41bc2..6166046f2 100644 --- a/core/lib/Thelia/Core/Event/Category/CategoryUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Category/CategoryUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Category; diff --git a/core/lib/Thelia/Core/Event/Config/ConfigCreateEvent.php b/core/lib/Thelia/Core/Event/Config/ConfigCreateEvent.php index cca6c59cd..7b17582e4 100644 --- a/core/lib/Thelia/Core/Event/Config/ConfigCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Config/ConfigCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Config; diff --git a/core/lib/Thelia/Core/Event/Config/ConfigDeleteEvent.php b/core/lib/Thelia/Core/Event/Config/ConfigDeleteEvent.php index 285df3cfd..a681a7e5c 100644 --- a/core/lib/Thelia/Core/Event/Config/ConfigDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Config/ConfigDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Config; diff --git a/core/lib/Thelia/Core/Event/Config/ConfigEvent.php b/core/lib/Thelia/Core/Event/Config/ConfigEvent.php index d2dab3f87..3145117af 100644 --- a/core/lib/Thelia/Core/Event/Config/ConfigEvent.php +++ b/core/lib/Thelia/Core/Event/Config/ConfigEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Config; diff --git a/core/lib/Thelia/Core/Event/Config/ConfigUpdateEvent.php b/core/lib/Thelia/Core/Event/Config/ConfigUpdateEvent.php index 71feba6ed..5ea436718 100644 --- a/core/lib/Thelia/Core/Event/Config/ConfigUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Config/ConfigUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Config; diff --git a/core/lib/Thelia/Core/Event/Content/ContentAddFolderEvent.php b/core/lib/Thelia/Core/Event/Content/ContentAddFolderEvent.php index dac4317ba..7bdc8bdc7 100644 --- a/core/lib/Thelia/Core/Event/Content/ContentAddFolderEvent.php +++ b/core/lib/Thelia/Core/Event/Content/ContentAddFolderEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Content; diff --git a/core/lib/Thelia/Core/Event/Content/ContentCreateEvent.php b/core/lib/Thelia/Core/Event/Content/ContentCreateEvent.php index 7763fd359..17434989d 100644 --- a/core/lib/Thelia/Core/Event/Content/ContentCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Content/ContentCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Content; diff --git a/core/lib/Thelia/Core/Event/Content/ContentDeleteEvent.php b/core/lib/Thelia/Core/Event/Content/ContentDeleteEvent.php index 8ad5b1c6f..828cb5f26 100644 --- a/core/lib/Thelia/Core/Event/Content/ContentDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Content/ContentDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Content; diff --git a/core/lib/Thelia/Core/Event/Content/ContentEvent.php b/core/lib/Thelia/Core/Event/Content/ContentEvent.php index aebda8d28..e1902ad7d 100644 --- a/core/lib/Thelia/Core/Event/Content/ContentEvent.php +++ b/core/lib/Thelia/Core/Event/Content/ContentEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Content; diff --git a/core/lib/Thelia/Core/Event/Content/ContentRemoveFolderEvent.php b/core/lib/Thelia/Core/Event/Content/ContentRemoveFolderEvent.php index 1733ec893..41d7df445 100644 --- a/core/lib/Thelia/Core/Event/Content/ContentRemoveFolderEvent.php +++ b/core/lib/Thelia/Core/Event/Content/ContentRemoveFolderEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Content; diff --git a/core/lib/Thelia/Core/Event/Content/ContentToggleVisibilityEvent.php b/core/lib/Thelia/Core/Event/Content/ContentToggleVisibilityEvent.php index b2b7e46e9..8630de5d7 100644 --- a/core/lib/Thelia/Core/Event/Content/ContentToggleVisibilityEvent.php +++ b/core/lib/Thelia/Core/Event/Content/ContentToggleVisibilityEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Content; diff --git a/core/lib/Thelia/Core/Event/Content/ContentUpdateEvent.php b/core/lib/Thelia/Core/Event/Content/ContentUpdateEvent.php index 3cab32425..95f3d413b 100644 --- a/core/lib/Thelia/Core/Event/Content/ContentUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Content/ContentUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Content; diff --git a/core/lib/Thelia/Core/Event/Country/CountryCreateEvent.php b/core/lib/Thelia/Core/Event/Country/CountryCreateEvent.php index 92d6632ae..8bc0b7195 100644 --- a/core/lib/Thelia/Core/Event/Country/CountryCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Country/CountryCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Country; diff --git a/core/lib/Thelia/Core/Event/Country/CountryDeleteEvent.php b/core/lib/Thelia/Core/Event/Country/CountryDeleteEvent.php index 5d658ebc0..be95c34da 100644 --- a/core/lib/Thelia/Core/Event/Country/CountryDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Country/CountryDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Country; diff --git a/core/lib/Thelia/Core/Event/Country/CountryEvent.php b/core/lib/Thelia/Core/Event/Country/CountryEvent.php index 505ead8ec..42be6096a 100644 --- a/core/lib/Thelia/Core/Event/Country/CountryEvent.php +++ b/core/lib/Thelia/Core/Event/Country/CountryEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Country; diff --git a/core/lib/Thelia/Core/Event/Country/CountryToggleDefaultEvent.php b/core/lib/Thelia/Core/Event/Country/CountryToggleDefaultEvent.php index a414c70e8..56b08d43b 100644 --- a/core/lib/Thelia/Core/Event/Country/CountryToggleDefaultEvent.php +++ b/core/lib/Thelia/Core/Event/Country/CountryToggleDefaultEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Country; diff --git a/core/lib/Thelia/Core/Event/Country/CountryUpdateEvent.php b/core/lib/Thelia/Core/Event/Country/CountryUpdateEvent.php index 2f82b17d0..8854a67b4 100644 --- a/core/lib/Thelia/Core/Event/Country/CountryUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Country/CountryUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Country; diff --git a/core/lib/Thelia/Core/Event/Coupon/CouponConsumeEvent.php b/core/lib/Thelia/Core/Event/Coupon/CouponConsumeEvent.php index 70b656b92..a6875105a 100644 --- a/core/lib/Thelia/Core/Event/Coupon/CouponConsumeEvent.php +++ b/core/lib/Thelia/Core/Event/Coupon/CouponConsumeEvent.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Core\Event\Coupon; use Thelia\Core\Event\ActionEvent; diff --git a/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php index f50a9264d..b5a79ba36 100644 --- a/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Core\Event\Coupon; use Thelia\Core\Event\ActionEvent; diff --git a/core/lib/Thelia/Core/Event/Currency/CurrencyChangeEvent.php b/core/lib/Thelia/Core/Event/Currency/CurrencyChangeEvent.php new file mode 100644 index 000000000..75058d45a --- /dev/null +++ b/core/lib/Thelia/Core/Event/Currency/CurrencyChangeEvent.php @@ -0,0 +1,52 @@ + + */ +class CurrencyChangeEvent extends CurrencyEvent +{ + /** @var Request $request */ + protected $request; + + public function __construct(Currency $currency = null, Request $request = null) + { + parent::__construct($currency); + $this->setRequest($request); + } + + /** + * @param Request $request + */ + public function setRequest(Request $request) + { + $this->request = $request; + + return $this; + } + + /** + * @return Request + */ + public function getRequest() + { + return $this->request; + } + +} diff --git a/core/lib/Thelia/Core/Event/Currency/CurrencyCreateEvent.php b/core/lib/Thelia/Core/Event/Currency/CurrencyCreateEvent.php index e28f88ec2..56163f1af 100644 --- a/core/lib/Thelia/Core/Event/Currency/CurrencyCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Currency/CurrencyCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Currency; diff --git a/core/lib/Thelia/Core/Event/Currency/CurrencyDeleteEvent.php b/core/lib/Thelia/Core/Event/Currency/CurrencyDeleteEvent.php index 7ae1e44e1..df44c8469 100644 --- a/core/lib/Thelia/Core/Event/Currency/CurrencyDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Currency/CurrencyDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Currency; diff --git a/core/lib/Thelia/Core/Event/Currency/CurrencyEvent.php b/core/lib/Thelia/Core/Event/Currency/CurrencyEvent.php index 47f91b81d..7333de6e4 100644 --- a/core/lib/Thelia/Core/Event/Currency/CurrencyEvent.php +++ b/core/lib/Thelia/Core/Event/Currency/CurrencyEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Currency; diff --git a/core/lib/Thelia/Core/Event/Currency/CurrencyUpdateEvent.php b/core/lib/Thelia/Core/Event/Currency/CurrencyUpdateEvent.php index 75011adfa..f88bcc8b6 100644 --- a/core/lib/Thelia/Core/Event/Currency/CurrencyUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Currency/CurrencyUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Currency; diff --git a/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php index 86d42e2f4..3865b8a25 100644 --- a/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\Event\Customer; /** diff --git a/core/lib/Thelia/Core/Event/Customer/CustomerEvent.php b/core/lib/Thelia/Core/Event/Customer/CustomerEvent.php index e76f23955..da83a4c62 100644 --- a/core/lib/Thelia/Core/Event/Customer/CustomerEvent.php +++ b/core/lib/Thelia/Core/Event/Customer/CustomerEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Customer; diff --git a/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php b/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php index 654039435..ea0e6f49e 100644 --- a/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php +++ b/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Customer; diff --git a/core/lib/Thelia/Core/Event/DefaultActionEvent.php b/core/lib/Thelia/Core/Event/DefaultActionEvent.php index 51e507a56..a4d4af46a 100644 --- a/core/lib/Thelia/Core/Event/DefaultActionEvent.php +++ b/core/lib/Thelia/Core/Event/DefaultActionEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/Document/DocumentCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Document/DocumentCreateOrUpdateEvent.php index a374bd43a..0e639b069 100644 --- a/core/lib/Thelia/Core/Event/Document/DocumentCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Document/DocumentCreateOrUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Document; diff --git a/core/lib/Thelia/Core/Event/Document/DocumentDeleteEvent.php b/core/lib/Thelia/Core/Event/Document/DocumentDeleteEvent.php index 28a51a208..493fb0432 100644 --- a/core/lib/Thelia/Core/Event/Document/DocumentDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Document/DocumentDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Document; diff --git a/core/lib/Thelia/Core/Event/Document/DocumentEvent.php b/core/lib/Thelia/Core/Event/Document/DocumentEvent.php index dd3fe86b1..8ba6dd3cc 100644 --- a/core/lib/Thelia/Core/Event/Document/DocumentEvent.php +++ b/core/lib/Thelia/Core/Event/Document/DocumentEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Document; diff --git a/core/lib/Thelia/Core/Event/Feature/FeatureAvCreateEvent.php b/core/lib/Thelia/Core/Event/Feature/FeatureAvCreateEvent.php index 4a515f8ef..af8e4a4b7 100644 --- a/core/lib/Thelia/Core/Event/Feature/FeatureAvCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Feature/FeatureAvCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Feature; diff --git a/core/lib/Thelia/Core/Event/Feature/FeatureAvDeleteEvent.php b/core/lib/Thelia/Core/Event/Feature/FeatureAvDeleteEvent.php index 06bafc2ec..57881e495 100644 --- a/core/lib/Thelia/Core/Event/Feature/FeatureAvDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Feature/FeatureAvDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Feature; diff --git a/core/lib/Thelia/Core/Event/Feature/FeatureAvEvent.php b/core/lib/Thelia/Core/Event/Feature/FeatureAvEvent.php index 42011bfe3..73a120f91 100644 --- a/core/lib/Thelia/Core/Event/Feature/FeatureAvEvent.php +++ b/core/lib/Thelia/Core/Event/Feature/FeatureAvEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Feature; diff --git a/core/lib/Thelia/Core/Event/Feature/FeatureAvUpdateEvent.php b/core/lib/Thelia/Core/Event/Feature/FeatureAvUpdateEvent.php index 88235a5a0..afe31d999 100644 --- a/core/lib/Thelia/Core/Event/Feature/FeatureAvUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Feature/FeatureAvUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Feature; diff --git a/core/lib/Thelia/Core/Event/Feature/FeatureCreateEvent.php b/core/lib/Thelia/Core/Event/Feature/FeatureCreateEvent.php index b5654f6a3..1a0f8536e 100644 --- a/core/lib/Thelia/Core/Event/Feature/FeatureCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Feature/FeatureCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Feature; diff --git a/core/lib/Thelia/Core/Event/Feature/FeatureDeleteEvent.php b/core/lib/Thelia/Core/Event/Feature/FeatureDeleteEvent.php index ea7a52f0a..201ccfbac 100644 --- a/core/lib/Thelia/Core/Event/Feature/FeatureDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Feature/FeatureDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Feature; diff --git a/core/lib/Thelia/Core/Event/Feature/FeatureEvent.php b/core/lib/Thelia/Core/Event/Feature/FeatureEvent.php index 7b597acaf..bbe5ff754 100644 --- a/core/lib/Thelia/Core/Event/Feature/FeatureEvent.php +++ b/core/lib/Thelia/Core/Event/Feature/FeatureEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Feature; diff --git a/core/lib/Thelia/Core/Event/Feature/FeatureUpdateEvent.php b/core/lib/Thelia/Core/Event/Feature/FeatureUpdateEvent.php index 1dd96f54d..f053cab02 100644 --- a/core/lib/Thelia/Core/Event/Feature/FeatureUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Feature/FeatureUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Feature; diff --git a/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductDeleteEvent.php b/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductDeleteEvent.php index 7bcab6f4c..868dbd8d5 100644 --- a/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\FeatureProduct; diff --git a/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductEvent.php b/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductEvent.php index aef4b25f5..6091098c2 100644 --- a/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductEvent.php +++ b/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\FeatureProduct; diff --git a/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductUpdateEvent.php b/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductUpdateEvent.php index 894783698..8f643fc07 100644 --- a/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/FeatureProduct/FeatureProductUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\FeatureProduct; diff --git a/core/lib/Thelia/Core/Event/Folder/FolderCreateEvent.php b/core/lib/Thelia/Core/Event/Folder/FolderCreateEvent.php index c45b77632..86e654de4 100644 --- a/core/lib/Thelia/Core/Event/Folder/FolderCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Folder/FolderCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Folder; diff --git a/core/lib/Thelia/Core/Event/Folder/FolderDeleteEvent.php b/core/lib/Thelia/Core/Event/Folder/FolderDeleteEvent.php index f20a35bdb..042dd2b4c 100644 --- a/core/lib/Thelia/Core/Event/Folder/FolderDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Folder/FolderDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Folder; diff --git a/core/lib/Thelia/Core/Event/Folder/FolderEvent.php b/core/lib/Thelia/Core/Event/Folder/FolderEvent.php index 62eaddf39..b027ee638 100644 --- a/core/lib/Thelia/Core/Event/Folder/FolderEvent.php +++ b/core/lib/Thelia/Core/Event/Folder/FolderEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Folder; diff --git a/core/lib/Thelia/Core/Event/Folder/FolderToggleVisibilityEvent.php b/core/lib/Thelia/Core/Event/Folder/FolderToggleVisibilityEvent.php index 2f39e1c7d..7a13e5327 100644 --- a/core/lib/Thelia/Core/Event/Folder/FolderToggleVisibilityEvent.php +++ b/core/lib/Thelia/Core/Event/Folder/FolderToggleVisibilityEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Folder; diff --git a/core/lib/Thelia/Core/Event/Folder/FolderUpdateEvent.php b/core/lib/Thelia/Core/Event/Folder/FolderUpdateEvent.php index 258668b16..816675d93 100644 --- a/core/lib/Thelia/Core/Event/Folder/FolderUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Folder/FolderUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Folder; diff --git a/core/lib/Thelia/Core/Event/GenerateRewrittenUrlEvent.php b/core/lib/Thelia/Core/Event/GenerateRewrittenUrlEvent.php index 95604ceb5..54f9f9575 100644 --- a/core/lib/Thelia/Core/Event/GenerateRewrittenUrlEvent.php +++ b/core/lib/Thelia/Core/Event/GenerateRewrittenUrlEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/Image/ImageCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Image/ImageCreateOrUpdateEvent.php index 1f37ff7af..5a3485abe 100644 --- a/core/lib/Thelia/Core/Event/Image/ImageCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Image/ImageCreateOrUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Image; diff --git a/core/lib/Thelia/Core/Event/Image/ImageDeleteEvent.php b/core/lib/Thelia/Core/Event/Image/ImageDeleteEvent.php index ad1319f42..cef4982b5 100644 --- a/core/lib/Thelia/Core/Event/Image/ImageDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Image/ImageDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Image; diff --git a/core/lib/Thelia/Core/Event/Image/ImageEvent.php b/core/lib/Thelia/Core/Event/Image/ImageEvent.php index 2fce2466c..e6f152708 100644 --- a/core/lib/Thelia/Core/Event/Image/ImageEvent.php +++ b/core/lib/Thelia/Core/Event/Image/ImageEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Image; diff --git a/core/lib/Thelia/Core/Event/Lang/LangCreateEvent.php b/core/lib/Thelia/Core/Event/Lang/LangCreateEvent.php index 3e7c667dd..0b0c35bdc 100644 --- a/core/lib/Thelia/Core/Event/Lang/LangCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Lang/LangCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Lang; @@ -35,6 +24,9 @@ class LangCreateEvent extends LangEvent protected $locale; protected $date_format; protected $time_format; + protected $decimal_separator; + protected $thousands_separator; + protected $decimals; /** * @param mixed $code @@ -136,4 +128,60 @@ class LangCreateEvent extends LangEvent return $this->title; } + /** + * @param mixed $decimal_separator + */ + public function setDecimalSeparator($decimal_separator) + { + $this->decimal_separator = $decimal_separator; + + return $this; + } + + /** + * @return mixed + */ + public function getDecimalSeparator() + { + return $this->decimal_separator; + } + + /** + * @param mixed $decimals + */ + public function setDecimals($decimals) + { + $this->decimals = $decimals; + + return $this; + } + + /** + * @return mixed + */ + public function getDecimals() + { + return $this->decimals; + } + + /** + * @param mixed $thousands_separator + */ + public function setThousandsSeparator($thousands_separator) + { + $this->thousands_separator = $thousands_separator; + + return $this; + } + + /** + * @return mixed + */ + public function getThousandsSeparator() + { + return $this->thousands_separator; + } + + + } diff --git a/core/lib/Thelia/Core/Event/Lang/LangDefaultBehaviorEvent.php b/core/lib/Thelia/Core/Event/Lang/LangDefaultBehaviorEvent.php index fff119e96..2800c69e5 100644 --- a/core/lib/Thelia/Core/Event/Lang/LangDefaultBehaviorEvent.php +++ b/core/lib/Thelia/Core/Event/Lang/LangDefaultBehaviorEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Lang; diff --git a/core/lib/Thelia/Core/Event/Lang/LangDeleteEvent.php b/core/lib/Thelia/Core/Event/Lang/LangDeleteEvent.php index 25190f857..d4d81802a 100644 --- a/core/lib/Thelia/Core/Event/Lang/LangDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Lang/LangDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Lang; diff --git a/core/lib/Thelia/Core/Event/Lang/LangEvent.php b/core/lib/Thelia/Core/Event/Lang/LangEvent.php index 1cc7da5e6..ce54e5757 100644 --- a/core/lib/Thelia/Core/Event/Lang/LangEvent.php +++ b/core/lib/Thelia/Core/Event/Lang/LangEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Lang; diff --git a/core/lib/Thelia/Core/Event/Lang/LangToggleDefaultEvent.php b/core/lib/Thelia/Core/Event/Lang/LangToggleDefaultEvent.php index 626396191..2ed55d2ec 100644 --- a/core/lib/Thelia/Core/Event/Lang/LangToggleDefaultEvent.php +++ b/core/lib/Thelia/Core/Event/Lang/LangToggleDefaultEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Lang; diff --git a/core/lib/Thelia/Core/Event/Lang/LangUpdateEvent.php b/core/lib/Thelia/Core/Event/Lang/LangUpdateEvent.php index cb6282395..25329c356 100644 --- a/core/lib/Thelia/Core/Event/Lang/LangUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Lang/LangUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Lang; diff --git a/core/lib/Thelia/Core/Event/LostPasswordEvent.php b/core/lib/Thelia/Core/Event/LostPasswordEvent.php index 78d786b2d..1757e7942 100644 --- a/core/lib/Thelia/Core/Event/LostPasswordEvent.php +++ b/core/lib/Thelia/Core/Event/LostPasswordEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/MailTransporterEvent.php b/core/lib/Thelia/Core/Event/MailTransporterEvent.php index 5a133158e..6d7373c8b 100644 --- a/core/lib/Thelia/Core/Event/MailTransporterEvent.php +++ b/core/lib/Thelia/Core/Event/MailTransporterEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/MailingSystem/MailingSystemEvent.php b/core/lib/Thelia/Core/Event/MailingSystem/MailingSystemEvent.php index 02cb25e6e..29a034ddb 100644 --- a/core/lib/Thelia/Core/Event/MailingSystem/MailingSystemEvent.php +++ b/core/lib/Thelia/Core/Event/MailingSystem/MailingSystemEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\MailingSystem; diff --git a/core/lib/Thelia/Core/Event/Message/MessageCreateEvent.php b/core/lib/Thelia/Core/Event/Message/MessageCreateEvent.php index 2957d2c2d..f76a58171 100644 --- a/core/lib/Thelia/Core/Event/Message/MessageCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Message/MessageCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Message; diff --git a/core/lib/Thelia/Core/Event/Message/MessageDeleteEvent.php b/core/lib/Thelia/Core/Event/Message/MessageDeleteEvent.php index 950daebde..013e4ab9e 100644 --- a/core/lib/Thelia/Core/Event/Message/MessageDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Message/MessageDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Message; diff --git a/core/lib/Thelia/Core/Event/Message/MessageEvent.php b/core/lib/Thelia/Core/Event/Message/MessageEvent.php index 82086ed05..e5552142c 100644 --- a/core/lib/Thelia/Core/Event/Message/MessageEvent.php +++ b/core/lib/Thelia/Core/Event/Message/MessageEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Message; diff --git a/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php b/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php index 56e4d57a0..9f39e0b68 100644 --- a/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Message; diff --git a/core/lib/Thelia/Core/Event/Module/ModuleDeleteEvent.php b/core/lib/Thelia/Core/Event/Module/ModuleDeleteEvent.php index cf7e0bc41..01e1d5c25 100644 --- a/core/lib/Thelia/Core/Event/Module/ModuleDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Module/ModuleDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Module; diff --git a/core/lib/Thelia/Core/Event/Module/ModuleEvent.php b/core/lib/Thelia/Core/Event/Module/ModuleEvent.php index 7dc3f67e8..ee268973a 100644 --- a/core/lib/Thelia/Core/Event/Module/ModuleEvent.php +++ b/core/lib/Thelia/Core/Event/Module/ModuleEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Module; diff --git a/core/lib/Thelia/Core/Event/Module/ModuleToggleActivationEvent.php b/core/lib/Thelia/Core/Event/Module/ModuleToggleActivationEvent.php index c6ece16f4..842600a14 100644 --- a/core/lib/Thelia/Core/Event/Module/ModuleToggleActivationEvent.php +++ b/core/lib/Thelia/Core/Event/Module/ModuleToggleActivationEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Module; diff --git a/core/lib/Thelia/Core/Event/Newsletter/NewsletterEvent.php b/core/lib/Thelia/Core/Event/Newsletter/NewsletterEvent.php index 3994d265f..df9264d9e 100644 --- a/core/lib/Thelia/Core/Event/Newsletter/NewsletterEvent.php +++ b/core/lib/Thelia/Core/Event/Newsletter/NewsletterEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Newsletter; diff --git a/core/lib/Thelia/Core/Event/Order/OrderAddressEvent.php b/core/lib/Thelia/Core/Event/Order/OrderAddressEvent.php index 92c101dd6..4f929fbd4 100644 --- a/core/lib/Thelia/Core/Event/Order/OrderAddressEvent.php +++ b/core/lib/Thelia/Core/Event/Order/OrderAddressEvent.php @@ -1,26 +1,14 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ - namespace Thelia\Core\Event\Order; use Thelia\Core\Event\ActionEvent; diff --git a/core/lib/Thelia/Core/Event/Order/OrderEvent.php b/core/lib/Thelia/Core/Event/Order/OrderEvent.php index 282a71207..e1e4118c6 100644 --- a/core/lib/Thelia/Core/Event/Order/OrderEvent.php +++ b/core/lib/Thelia/Core/Event/Order/OrderEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Order; @@ -40,6 +29,8 @@ class OrderEvent extends ActionEvent protected $status = null; protected $deliveryRef = null; + protected $cartItemId = null; + /** * @var Response */ @@ -61,6 +52,24 @@ class OrderEvent extends ActionEvent $this->order = $order; } + /** + * @param null $cartItemId + */ + public function setCartItemId($cartItemId) + { + $this->cartItemId = $cartItemId; + + return $this; + } + + /** + * @return null + */ + public function getCartItemId() + { + return $this->cartItemId; + } + /** * @param Order $order */ @@ -118,7 +127,7 @@ class OrderEvent extends ActionEvent } /** - * @param $status + * @param int $status */ public function setStatus($status) { diff --git a/core/lib/Thelia/Core/Event/Order/OrderManualEvent.php b/core/lib/Thelia/Core/Event/Order/OrderManualEvent.php index dc5f0b155..7ca4a2aa4 100644 --- a/core/lib/Thelia/Core/Event/Order/OrderManualEvent.php +++ b/core/lib/Thelia/Core/Event/Order/OrderManualEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Order; diff --git a/core/lib/Thelia/Core/Event/Order/OrderPaymentEvent.php b/core/lib/Thelia/Core/Event/Order/OrderPaymentEvent.php index 1e15c2dfc..e11815555 100644 --- a/core/lib/Thelia/Core/Event/Order/OrderPaymentEvent.php +++ b/core/lib/Thelia/Core/Event/Order/OrderPaymentEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Order; diff --git a/core/lib/Thelia/Core/Event/PdfEvent.php b/core/lib/Thelia/Core/Event/PdfEvent.php index b439c8a23..fb170296b 100644 --- a/core/lib/Thelia/Core/Event/PdfEvent.php +++ b/core/lib/Thelia/Core/Event/PdfEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/Product/ProductAddAccessoryEvent.php b/core/lib/Thelia/Core/Event/Product/ProductAddAccessoryEvent.php index d32988b84..1f9fe2325 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductAddAccessoryEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductAddAccessoryEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductAddCategoryEvent.php b/core/lib/Thelia/Core/Event/Product/ProductAddCategoryEvent.php index de11b34cb..617913c0c 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductAddCategoryEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductAddCategoryEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductAddContentEvent.php b/core/lib/Thelia/Core/Event/Product/ProductAddContentEvent.php index 960dbfdf6..9dad4b418 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductAddContentEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductAddContentEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductAssociatedContentEvent.php b/core/lib/Thelia/Core/Event/Product/ProductAssociatedContentEvent.php index 5cdb7c8e1..2fa766ada 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductAssociatedContentEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductAssociatedContentEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php b/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php index 802ade89b..de845d7b4 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductCreateEvent.php b/core/lib/Thelia/Core/Event/Product/ProductCreateEvent.php index 9717f171d..0fe389161 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductDeleteAccessoryEvent.php b/core/lib/Thelia/Core/Event/Product/ProductDeleteAccessoryEvent.php index 0cfd979c2..4ddd2f317 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductDeleteAccessoryEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductDeleteAccessoryEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductDeleteCategoryEvent.php b/core/lib/Thelia/Core/Event/Product/ProductDeleteCategoryEvent.php index e83cd087b..af58a568f 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductDeleteCategoryEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductDeleteCategoryEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductDeleteContentEvent.php b/core/lib/Thelia/Core/Event/Product/ProductDeleteContentEvent.php index 6f09411cb..db7190c44 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductDeleteContentEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductDeleteContentEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductDeleteEvent.php b/core/lib/Thelia/Core/Event/Product/ProductDeleteEvent.php index 7a3406e7e..4cb710409 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductEvent.php b/core/lib/Thelia/Core/Event/Product/ProductEvent.php index 11359c616..c587cdf2f 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php b/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php index 0e95abfba..b0d46166c 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductToggleVisibilityEvent.php b/core/lib/Thelia/Core/Event/Product/ProductToggleVisibilityEvent.php index 1d082fd6d..e6f82b222 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductToggleVisibilityEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductToggleVisibilityEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/Product/ProductUpdateEvent.php b/core/lib/Thelia/Core/Event/Product/ProductUpdateEvent.php index 7bde5599a..1768f3384 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Product; diff --git a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementCreateEvent.php b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementCreateEvent.php index bbb5d07e7..c1286aa5d 100644 --- a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementCreateEvent.php +++ b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\ProductSaleElement; diff --git a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php index 8f94b254b..22cd7fd61 100644 --- a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\ProductSaleElement; diff --git a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementEvent.php b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementEvent.php index 0f34bd62f..4c3f6be85 100644 --- a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementEvent.php +++ b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\ProductSaleElement; diff --git a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementUpdateEvent.php b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementUpdateEvent.php index 5be7156dc..267e53053 100644 --- a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\ProductSaleElement; diff --git a/core/lib/Thelia/Core/Event/Profile/ProfileEvent.php b/core/lib/Thelia/Core/Event/Profile/ProfileEvent.php index 423f48654..dd66563ab 100644 --- a/core/lib/Thelia/Core/Event/Profile/ProfileEvent.php +++ b/core/lib/Thelia/Core/Event/Profile/ProfileEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Profile; diff --git a/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneAddAreaEvent.php b/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneAddAreaEvent.php index dfe1b33cd..e358573aa 100644 --- a/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneAddAreaEvent.php +++ b/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneAddAreaEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\ShippingZone; diff --git a/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneRemoveAreaEvent.php b/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneRemoveAreaEvent.php index a3177f522..68da304d2 100644 --- a/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneRemoveAreaEvent.php +++ b/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneRemoveAreaEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\ShippingZone; diff --git a/core/lib/Thelia/Core/Event/Tax/TaxEvent.php b/core/lib/Thelia/Core/Event/Tax/TaxEvent.php index 7acc02e32..0a7e254b7 100644 --- a/core/lib/Thelia/Core/Event/Tax/TaxEvent.php +++ b/core/lib/Thelia/Core/Event/Tax/TaxEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Tax; diff --git a/core/lib/Thelia/Core/Event/Tax/TaxRuleEvent.php b/core/lib/Thelia/Core/Event/Tax/TaxRuleEvent.php index 2da4fbf2d..013e03457 100644 --- a/core/lib/Thelia/Core/Event/Tax/TaxRuleEvent.php +++ b/core/lib/Thelia/Core/Event/Tax/TaxRuleEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Tax; diff --git a/core/lib/Thelia/Core/Event/Template/TemplateAddAttributeEvent.php b/core/lib/Thelia/Core/Event/Template/TemplateAddAttributeEvent.php index 03160ffb6..4e1eb90d7 100644 --- a/core/lib/Thelia/Core/Event/Template/TemplateAddAttributeEvent.php +++ b/core/lib/Thelia/Core/Event/Template/TemplateAddAttributeEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Template; diff --git a/core/lib/Thelia/Core/Event/Template/TemplateAddFeatureEvent.php b/core/lib/Thelia/Core/Event/Template/TemplateAddFeatureEvent.php index 900007853..e911767e5 100644 --- a/core/lib/Thelia/Core/Event/Template/TemplateAddFeatureEvent.php +++ b/core/lib/Thelia/Core/Event/Template/TemplateAddFeatureEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Template; diff --git a/core/lib/Thelia/Core/Event/Template/TemplateCreateEvent.php b/core/lib/Thelia/Core/Event/Template/TemplateCreateEvent.php index 4cb676481..8ff1bfab6 100644 --- a/core/lib/Thelia/Core/Event/Template/TemplateCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Template/TemplateCreateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Template; diff --git a/core/lib/Thelia/Core/Event/Template/TemplateDeleteAttributeEvent.php b/core/lib/Thelia/Core/Event/Template/TemplateDeleteAttributeEvent.php index a9c3f978e..3fb591cc2 100644 --- a/core/lib/Thelia/Core/Event/Template/TemplateDeleteAttributeEvent.php +++ b/core/lib/Thelia/Core/Event/Template/TemplateDeleteAttributeEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Template; diff --git a/core/lib/Thelia/Core/Event/Template/TemplateDeleteEvent.php b/core/lib/Thelia/Core/Event/Template/TemplateDeleteEvent.php index b5c2efca6..fcfa10bfd 100644 --- a/core/lib/Thelia/Core/Event/Template/TemplateDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Template/TemplateDeleteEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Template; diff --git a/core/lib/Thelia/Core/Event/Template/TemplateDeleteFeatureEvent.php b/core/lib/Thelia/Core/Event/Template/TemplateDeleteFeatureEvent.php index 0c5c75eef..fec57a589 100644 --- a/core/lib/Thelia/Core/Event/Template/TemplateDeleteFeatureEvent.php +++ b/core/lib/Thelia/Core/Event/Template/TemplateDeleteFeatureEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Template; diff --git a/core/lib/Thelia/Core/Event/Template/TemplateEvent.php b/core/lib/Thelia/Core/Event/Template/TemplateEvent.php index 1010cfc31..b71ad5001 100644 --- a/core/lib/Thelia/Core/Event/Template/TemplateEvent.php +++ b/core/lib/Thelia/Core/Event/Template/TemplateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Template; diff --git a/core/lib/Thelia/Core/Event/Template/TemplateUpdateEvent.php b/core/lib/Thelia/Core/Event/Template/TemplateUpdateEvent.php index 9f2c22a9c..a174253cb 100644 --- a/core/lib/Thelia/Core/Event/Template/TemplateUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Template/TemplateUpdateEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event\Template; diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php index 580fac029..69c12fb73 100644 --- a/core/lib/Thelia/Core/Event/TheliaEvents.php +++ b/core/lib/Thelia/Core/Event/TheliaEvents.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; @@ -342,6 +331,8 @@ final class TheliaEvents */ const CART_DUPLICATE = "cart.duplicate"; + const CART_ITEM_DUPLICATE = "cart.item.duplicate"; + /** * sent when a new item is added to current cart */ diff --git a/core/lib/Thelia/Core/Event/ToggleVisibilityEvent.php b/core/lib/Thelia/Core/Event/ToggleVisibilityEvent.php index 996292c8e..72cf41b32 100644 --- a/core/lib/Thelia/Core/Event/ToggleVisibilityEvent.php +++ b/core/lib/Thelia/Core/Event/ToggleVisibilityEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/UpdateFilePositionEvent.php b/core/lib/Thelia/Core/Event/UpdateFilePositionEvent.php index 1cd9b6677..8cf2f35c0 100644 --- a/core/lib/Thelia/Core/Event/UpdateFilePositionEvent.php +++ b/core/lib/Thelia/Core/Event/UpdateFilePositionEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/UpdatePositionEvent.php b/core/lib/Thelia/Core/Event/UpdatePositionEvent.php index e75e30b98..feb26e9c5 100644 --- a/core/lib/Thelia/Core/Event/UpdatePositionEvent.php +++ b/core/lib/Thelia/Core/Event/UpdatePositionEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/UpdateSeoEvent.php b/core/lib/Thelia/Core/Event/UpdateSeoEvent.php index cb287b869..dbd433f09 100644 --- a/core/lib/Thelia/Core/Event/UpdateSeoEvent.php +++ b/core/lib/Thelia/Core/Event/UpdateSeoEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/EventListener/RequestListener.php b/core/lib/Thelia/Core/EventListener/RequestListener.php index a3f7aad4e..fff731301 100644 --- a/core/lib/Thelia/Core/EventListener/RequestListener.php +++ b/core/lib/Thelia/Core/EventListener/RequestListener.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\EventListener; diff --git a/core/lib/Thelia/Core/EventListener/ResponseListener.php b/core/lib/Thelia/Core/EventListener/ResponseListener.php new file mode 100644 index 000000000..db2a6e491 --- /dev/null +++ b/core/lib/Thelia/Core/EventListener/ResponseListener.php @@ -0,0 +1,72 @@ + + */ +class ResponseListener implements EventSubscriberInterface +{ + + public function beforeResponse(FilterResponseEvent $event) + { + $session = $event->getRequest()->getSession(); + + if (null !== $id = $session->get("cart_use_cookie")) { + $response = $event->getResponse(); + $response->headers->setCookie(new Cookie( + "thelia_cart", + $id, + time()+ConfigQuery::read("cart.cookie_lifetime", 60*60*24*365), + '/' + )); + + $session->set("cart_use_cookie", null); + } + } + + /** + * Returns an array of event names this subscriber wants to listen to. + * + * The array keys are event names and the value can be: + * + * * The method name to call (priority defaults to 0) + * * An array composed of the method name to call and the priority + * * An array of arrays composed of the method names to call and respective + * priorities, or 0 if unset + * + * For instance: + * + * * array('eventName' => 'methodName') + * * array('eventName' => array('methodName', $priority)) + * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) + * + * @return array The event names to listen to + * + * @api + */ + public static function getSubscribedEvents() + { + return [ + KernelEvents::RESPONSE => ['beforeResponse', 128] + ]; + } +} diff --git a/core/lib/Thelia/Core/EventListener/ViewListener.php b/core/lib/Thelia/Core/EventListener/ViewListener.php index 0e57bdaf7..b0ed5ce2f 100644 --- a/core/lib/Thelia/Core/EventListener/ViewListener.php +++ b/core/lib/Thelia/Core/EventListener/ViewListener.php @@ -1,28 +1,19 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\EventListener; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; @@ -78,7 +69,7 @@ class ViewListener implements EventSubscriberInterface $parser = $this->container->get('thelia.parser'); $parser->setTemplateDefinition(TemplateHelper::getInstance()->getActiveFrontTemplate()); $request = $this->container->get('request'); - + $response = null; try { $content = $parser->render($request->attributes->get('_view').".html"); @@ -88,27 +79,29 @@ class ViewListener implements EventSubscriberInterface $response = new Response($content, $parser->getStatus() ?: 200); } - $event->setResponse($response); } catch (ResourceNotFoundException $e) { throw new NotFoundHttpException(); } catch (AuthenticationException $ex) { // Redirect to the login template - Redirect::exec($this->container->get('thelia.url.manager')->viewUrl($ex->getLoginTemplate())); + $response = RedirectResponse::create($this->container->get('thelia.url.manager')->viewUrl($ex->getLoginTemplate())); } catch (OrderException $e) { switch ($e->getCode()) { case OrderException::CART_EMPTY: // Redirect to the cart template - Redirect::exec($this->container->get('router.chainRequest')->generate($e->cartRoute, $e->arguments, Router::ABSOLUTE_URL)); + $response = RedirectResponse::create($this->container->get('router.chainRequest')->generate($e->cartRoute, $e->arguments, Router::ABSOLUTE_URL)); break; case OrderException::UNDEFINED_DELIVERY: // Redirect to the delivery choice template - Redirect::exec($this->container->get('router.chainRequest')->generate($e->orderDeliveryRoute, $e->arguments, Router::ABSOLUTE_URL)); + $response = RedirectResponse::create($this->container->get('router.chainRequest')->generate($e->orderDeliveryRoute, $e->arguments, Router::ABSOLUTE_URL)); break; } - - throw $e; + if (null === $response) { + throw $e; + } } + + $event->setResponse($response); } public function beforeKernelView(GetResponseForControllerResultEvent $event) diff --git a/core/lib/Thelia/Core/Factory/ActionEventFactory.php b/core/lib/Thelia/Core/Factory/ActionEventFactory.php index cbbb7caf8..d34838124 100644 --- a/core/lib/Thelia/Core/Factory/ActionEventFactory.php +++ b/core/lib/Thelia/Core/Factory/ActionEventFactory.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Factory; diff --git a/core/lib/Thelia/Core/Form/Type/TheliaType.php b/core/lib/Thelia/Core/Form/Type/TheliaType.php index eaad895be..9b0d33e49 100644 --- a/core/lib/Thelia/Core/Form/Type/TheliaType.php +++ b/core/lib/Thelia/Core/Form/Type/TheliaType.php @@ -1,4 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\HttpFoundation; use Symfony\Component\HttpFoundation\Request as BaseRequest; diff --git a/core/lib/Thelia/Core/HttpFoundation/Response.php b/core/lib/Thelia/Core/HttpFoundation/Response.php index e279215b8..b8194d37d 100644 --- a/core/lib/Thelia/Core/HttpFoundation/Response.php +++ b/core/lib/Thelia/Core/HttpFoundation/Response.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\HttpFoundation; use Symfony\Component\HttpFoundation\Response as BaseResponse; diff --git a/core/lib/Thelia/Core/HttpFoundation/Session/Session.php b/core/lib/Thelia/Core/HttpFoundation/Session/Session.php index df5fa6a38..008f0fbfb 100644 --- a/core/lib/Thelia/Core/HttpFoundation/Session/Session.php +++ b/core/lib/Thelia/Core/HttpFoundation/Session/Session.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\HttpFoundation\Session; diff --git a/core/lib/Thelia/Core/HttpKernel/Exception/NotFountHttpException.php b/core/lib/Thelia/Core/HttpKernel/Exception/NotFountHttpException.php index 41ca0bdc1..4f150a325 100644 --- a/core/lib/Thelia/Core/HttpKernel/Exception/NotFountHttpException.php +++ b/core/lib/Thelia/Core/HttpKernel/Exception/NotFountHttpException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\HttpKernel\Exception; diff --git a/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php b/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php index aceb6235f..38d3d968c 100644 --- a/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php +++ b/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\HttpKernel\HttpCache; diff --git a/core/lib/Thelia/Core/Routing/RewritingRouter.php b/core/lib/Thelia/Core/Routing/RewritingRouter.php index bdf0a6e03..e416b21e3 100644 --- a/core/lib/Thelia/Core/Routing/RewritingRouter.php +++ b/core/lib/Thelia/Core/Routing/RewritingRouter.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Routing; diff --git a/core/lib/Thelia/Core/Security/AccessManager.php b/core/lib/Thelia/Core/Security/AccessManager.php index 07fc5bcae..5186a7245 100644 --- a/core/lib/Thelia/Core/Security/AccessManager.php +++ b/core/lib/Thelia/Core/Security/AccessManager.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security; diff --git a/core/lib/Thelia/Core/Security/Authentication/AdminTokenAuthenticator.php b/core/lib/Thelia/Core/Security/Authentication/AdminTokenAuthenticator.php index 4c6dcec5c..4db122f4e 100644 --- a/core/lib/Thelia/Core/Security/Authentication/AdminTokenAuthenticator.php +++ b/core/lib/Thelia/Core/Security/Authentication/AdminTokenAuthenticator.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Authentication; diff --git a/core/lib/Thelia/Core/Security/Authentication/AdminUsernamePasswordFormAuthenticator.php b/core/lib/Thelia/Core/Security/Authentication/AdminUsernamePasswordFormAuthenticator.php index 256649ae0..b380b0eb6 100644 --- a/core/lib/Thelia/Core/Security/Authentication/AdminUsernamePasswordFormAuthenticator.php +++ b/core/lib/Thelia/Core/Security/Authentication/AdminUsernamePasswordFormAuthenticator.php @@ -1,25 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Authentication; diff --git a/core/lib/Thelia/Core/Security/Authentication/AuthenticatorInterface.php b/core/lib/Thelia/Core/Security/Authentication/AuthenticatorInterface.php index 9e2079ce4..5128a3ee7 100644 --- a/core/lib/Thelia/Core/Security/Authentication/AuthenticatorInterface.php +++ b/core/lib/Thelia/Core/Security/Authentication/AuthenticatorInterface.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Authentication; diff --git a/core/lib/Thelia/Core/Security/Authentication/CustomerTokenAuthenticator.php b/core/lib/Thelia/Core/Security/Authentication/CustomerTokenAuthenticator.php index d06400875..3f79f6a39 100644 --- a/core/lib/Thelia/Core/Security/Authentication/CustomerTokenAuthenticator.php +++ b/core/lib/Thelia/Core/Security/Authentication/CustomerTokenAuthenticator.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Authentication; diff --git a/core/lib/Thelia/Core/Security/Authentication/CustomerUsernamePasswordFormAuthenticator.php b/core/lib/Thelia/Core/Security/Authentication/CustomerUsernamePasswordFormAuthenticator.php index 7da54e26b..9f426280a 100644 --- a/core/lib/Thelia/Core/Security/Authentication/CustomerUsernamePasswordFormAuthenticator.php +++ b/core/lib/Thelia/Core/Security/Authentication/CustomerUsernamePasswordFormAuthenticator.php @@ -1,25 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Authentication; diff --git a/core/lib/Thelia/Core/Security/Authentication/TokenAuthenticator.php b/core/lib/Thelia/Core/Security/Authentication/TokenAuthenticator.php index 840394d4f..cb800ee40 100644 --- a/core/lib/Thelia/Core/Security/Authentication/TokenAuthenticator.php +++ b/core/lib/Thelia/Core/Security/Authentication/TokenAuthenticator.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Authentication; diff --git a/core/lib/Thelia/Core/Security/Authentication/UsernamePasswordFormAuthenticator.php b/core/lib/Thelia/Core/Security/Authentication/UsernamePasswordFormAuthenticator.php index e016233c2..13bed48e7 100644 --- a/core/lib/Thelia/Core/Security/Authentication/UsernamePasswordFormAuthenticator.php +++ b/core/lib/Thelia/Core/Security/Authentication/UsernamePasswordFormAuthenticator.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Authentication; diff --git a/core/lib/Thelia/Core/Security/Exception/AuthenticationException.php b/core/lib/Thelia/Core/Security/Exception/AuthenticationException.php index 93eed87d5..f316faf0c 100644 --- a/core/lib/Thelia/Core/Security/Exception/AuthenticationException.php +++ b/core/lib/Thelia/Core/Security/Exception/AuthenticationException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Exception; diff --git a/core/lib/Thelia/Core/Security/Exception/AuthorizationException.php b/core/lib/Thelia/Core/Security/Exception/AuthorizationException.php index 60bd0a2d6..1f37f88ad 100644 --- a/core/lib/Thelia/Core/Security/Exception/AuthorizationException.php +++ b/core/lib/Thelia/Core/Security/Exception/AuthorizationException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Exception; diff --git a/core/lib/Thelia/Core/Security/Exception/ResourceException.php b/core/lib/Thelia/Core/Security/Exception/ResourceException.php index 27343bd16..9f4e188d5 100644 --- a/core/lib/Thelia/Core/Security/Exception/ResourceException.php +++ b/core/lib/Thelia/Core/Security/Exception/ResourceException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Exception; diff --git a/core/lib/Thelia/Core/Security/Exception/TokenAuthenticationException.php b/core/lib/Thelia/Core/Security/Exception/TokenAuthenticationException.php index 6af57162d..19ffc28e8 100644 --- a/core/lib/Thelia/Core/Security/Exception/TokenAuthenticationException.php +++ b/core/lib/Thelia/Core/Security/Exception/TokenAuthenticationException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Exception; diff --git a/core/lib/Thelia/Core/Security/Exception/UsernameNotFoundException.php b/core/lib/Thelia/Core/Security/Exception/UsernameNotFoundException.php index 2168e63ca..508339f92 100644 --- a/core/lib/Thelia/Core/Security/Exception/UsernameNotFoundException.php +++ b/core/lib/Thelia/Core/Security/Exception/UsernameNotFoundException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Exception; diff --git a/core/lib/Thelia/Core/Security/Exception/WrongPasswordException.php b/core/lib/Thelia/Core/Security/Exception/WrongPasswordException.php index 6088f43ad..9ddcef286 100644 --- a/core/lib/Thelia/Core/Security/Exception/WrongPasswordException.php +++ b/core/lib/Thelia/Core/Security/Exception/WrongPasswordException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Exception; diff --git a/core/lib/Thelia/Core/Security/Resource/AdminResources.php b/core/lib/Thelia/Core/Security/Resource/AdminResources.php index 314038e67..107aef017 100644 --- a/core/lib/Thelia/Core/Security/Resource/AdminResources.php +++ b/core/lib/Thelia/Core/Security/Resource/AdminResources.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Resource; @@ -56,6 +45,8 @@ final class AdminResources const ADMINISTRATOR = "admin.configuration.administrator"; + const ADVANCED_CONFIGURATION = "admin.configuration.advanced"; + const AREA = "admin.configuration.area"; const ATTRIBUTE = "admin.configuration.attribute"; @@ -78,6 +69,8 @@ final class AdminResources const FOLDER = "admin.folder"; + const HOME = "admin.home"; + const LANGUAGE = "admin.configuration.language"; const MAILING_SYSTEM = "admin.configuration.mailing-system"; @@ -98,11 +91,19 @@ final class AdminResources const TEMPLATE = "admin.configuration.template"; - const SYSTEM_LOG = "admin.configuration.system-log"; + const SYSTEM_LOG = "admin.configuration.system-logs"; + + const ADMIN_LOG = "admin.configuration.admin-logs"; const STORE = "admin.configuration.store"; const TRANSLATIONS = "admin.configuration.translations"; const UPDATE = "admin.configuration.update"; + + const EXPORT = "admin.export"; + + const EXPORT_CUSTOMER_NEWSLETTER = "admin.export.customer.newsletter"; + + const TOOLS = "admin.tools"; } diff --git a/core/lib/Thelia/Core/Security/SecurityContext.php b/core/lib/Thelia/Core/Security/SecurityContext.php index 2cbbf069e..4d4e791df 100644 --- a/core/lib/Thelia/Core/Security/SecurityContext.php +++ b/core/lib/Thelia/Core/Security/SecurityContext.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security; diff --git a/core/lib/Thelia/Core/Security/Token/CookieTokenProvider.php b/core/lib/Thelia/Core/Security/Token/CookieTokenProvider.php index ee2d9291a..d2ccfd283 100644 --- a/core/lib/Thelia/Core/Security/Token/CookieTokenProvider.php +++ b/core/lib/Thelia/Core/Security/Token/CookieTokenProvider.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\Token; diff --git a/core/lib/Thelia/Core/Security/Token/TokenProvider.php b/core/lib/Thelia/Core/Security/Token/TokenProvider.php index 32c5b7d6c..39bb75a7e 100644 --- a/core/lib/Thelia/Core/Security/Token/TokenProvider.php +++ b/core/lib/Thelia/Core/Security/Token/TokenProvider.php @@ -1,4 +1,14 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\UserProvider; diff --git a/core/lib/Thelia/Core/Security/UserProvider/AdminUserProvider.php b/core/lib/Thelia/Core/Security/UserProvider/AdminUserProvider.php index 0ed80d556..e97ef15da 100644 --- a/core/lib/Thelia/Core/Security/UserProvider/AdminUserProvider.php +++ b/core/lib/Thelia/Core/Security/UserProvider/AdminUserProvider.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\UserProvider; diff --git a/core/lib/Thelia/Core/Security/UserProvider/CustomerTokenUserProvider.php b/core/lib/Thelia/Core/Security/UserProvider/CustomerTokenUserProvider.php index e0ea58b84..bd88fcc81 100644 --- a/core/lib/Thelia/Core/Security/UserProvider/CustomerTokenUserProvider.php +++ b/core/lib/Thelia/Core/Security/UserProvider/CustomerTokenUserProvider.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\UserProvider; diff --git a/core/lib/Thelia/Core/Security/UserProvider/CustomerUserProvider.php b/core/lib/Thelia/Core/Security/UserProvider/CustomerUserProvider.php index 3193e3a45..80a5004d3 100644 --- a/core/lib/Thelia/Core/Security/UserProvider/CustomerUserProvider.php +++ b/core/lib/Thelia/Core/Security/UserProvider/CustomerUserProvider.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\UserProvider; diff --git a/core/lib/Thelia/Core/Security/UserProvider/TokenUserProvider.php b/core/lib/Thelia/Core/Security/UserProvider/TokenUserProvider.php index e58a2e123..780760ac7 100644 --- a/core/lib/Thelia/Core/Security/UserProvider/TokenUserProvider.php +++ b/core/lib/Thelia/Core/Security/UserProvider/TokenUserProvider.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\UserProvider; diff --git a/core/lib/Thelia/Core/Security/UserProvider/UserProviderInterface.php b/core/lib/Thelia/Core/Security/UserProvider/UserProviderInterface.php index 6fe5e5197..52dd1dd6b 100644 --- a/core/lib/Thelia/Core/Security/UserProvider/UserProviderInterface.php +++ b/core/lib/Thelia/Core/Security/UserProvider/UserProviderInterface.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Security\UserProvider; diff --git a/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php b/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php index dedb54d8e..a248d9f1a 100644 --- a/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php +++ b/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Assets; diff --git a/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php b/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php index f7b85c128..273c9bace 100644 --- a/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php +++ b/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Assets; diff --git a/core/lib/Thelia/Core/Template/Element/ArraySearchLoopInterface.php b/core/lib/Thelia/Core/Template/Element/ArraySearchLoopInterface.php index f33b8505e..d81f70b33 100644 --- a/core/lib/Thelia/Core/Template/Element/ArraySearchLoopInterface.php +++ b/core/lib/Thelia/Core/Template/Element/ArraySearchLoopInterface.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\Template\Element; /** diff --git a/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php b/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php index 35912679d..139fdf747 100644 --- a/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Element; diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index 7a6e3bf8f..1038541de 100644 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -1,34 +1,26 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Element; use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\ModelCriteria; +use Propel\Runtime\Collection\ObjectCollection; +use Propel\Runtime\Util\PropelModelPager; use Symfony\Component\DependencyInjection\ContainerInterface; use Thelia\Core\Security\SecurityContext; use Thelia\Core\Template\Element\Exception\LoopException; use Thelia\Core\Template\Loop\Argument\Argument; +use Thelia\Core\Translation\Translator; use Thelia\Type\EnumListType; use Thelia\Type\EnumType; use Thelia\Type\TypeCollection; @@ -64,8 +56,11 @@ abstract class BaseLoop protected $timestampable = false; protected $versionable = false; - private static $cacheLoopResult = array(); - private static $cacheCount = array(); + /** @var Translator */ + protected $translator = null; + + private static $cacheLoopResult = []; + private static $cacheCount = []; /** * Create a new Loop @@ -81,6 +76,7 @@ abstract class BaseLoop $this->request = $container->get('request'); $this->dispatcher = $container->get('event_dispatcher'); $this->securityContext = $container->get('thelia.securityContext'); + $this->translator = $container->get("thelia.translator"); $this->args = $this->getArgDefinitions()->addArguments($this->getDefaultArgs(), false); } @@ -92,53 +88,54 @@ abstract class BaseLoop */ protected function getDefaultArgs() { - $defaultArgs = array( + $defaultArgs = [ Argument::createBooleanTypeArgument('backend_context', false), Argument::createBooleanTypeArgument('force_return', false), Argument::createAnyTypeArgument('type'), - ); + ]; if (true === $this->countable) { - $defaultArgs = array_merge($defaultArgs, array( - Argument::createIntTypeArgument('offset', 0), - Argument::createIntTypeArgument('page'), - Argument::createIntTypeArgument('limit', PHP_INT_MAX), - )); + $defaultArgs = array_merge($defaultArgs, [ + Argument::createIntTypeArgument('offset', 0), + Argument::createIntTypeArgument('page'), + Argument::createIntTypeArgument('limit', PHP_INT_MAX), + ]); } if ($this instanceof SearchLoopInterface) { - $defaultArgs = array_merge($defaultArgs, array( - Argument::createAnyTypeArgument('search_term'), - new Argument( - 'search_in', - new TypeCollection( - new EnumListType($this->getSearchIn()) - ) - ), - new Argument( - 'search_mode', - new TypeCollection( - new EnumType(array( - SearchLoopInterface::MODE_ANY_WORD, - SearchLoopInterface::MODE_SENTENCE, - SearchLoopInterface::MODE_STRICT_SENTENCE, - )) + + $defaultArgs = array_merge($defaultArgs, [ + Argument::createAnyTypeArgument('search_term'), + new Argument( + 'search_in', + new TypeCollection( + new EnumListType($this->getSearchIn()) + ) ), - SearchLoopInterface::MODE_STRICT_SENTENCE - ) - )); + new Argument( + 'search_mode', + new TypeCollection( + new EnumType([ + SearchLoopInterface::MODE_ANY_WORD, + SearchLoopInterface::MODE_SENTENCE, + SearchLoopInterface::MODE_STRICT_SENTENCE, + ]) + ), + SearchLoopInterface::MODE_STRICT_SENTENCE + ) + ]); } return $defaultArgs; } /** - * Provides a getter to loop parameters + * Provides a getter to loop parameter values * - * @param string $name the methode name (only getArgname is supported) - * @param $arguments this parameter is ignored + * @param string $name the method name (only getArgname is supported) + * @param mixed $arguments this parameter is ignored * - * @return null + * @return mixed the argument value * @throws \InvalidArgumentException if the parameter is unknown or the method name is not supported. */ public function __call($name, $arguments) @@ -148,10 +145,12 @@ abstract class BaseLoop // camelCase to underscore: getNotEmpty -> not_empty $argName = strtolower(preg_replace('/([^A-Z])([A-Z])/', "$1_$2", substr($name, 3))); - return $this->getArg($argName)->getValue(); + return $this->getArgValue($argName); } - throw new \InvalidArgumentException(sprintf("Unsupported magic method %s. only getArgname() is supported.", $name)); + throw new \InvalidArgumentException( + $this->translator->trans("Unsupported magic method %name. only getArgname() is supported.", ['%name' => $name]) + ); } /** @@ -159,12 +158,12 @@ abstract class BaseLoop * * @param array $nameValuePairs a array of name => value pairs. The name is the name of the argument. * - * @throws \InvalidArgumentException if somùe argument values are missing, or invalid + * @throws \InvalidArgumentException if some argument values are missing, or invalid */ public function initializeArgs(array $nameValuePairs) { - $faultActor = array(); - $faultDetails = array(); + $faultActor = []; + $faultDetails = []; $loopType = isset($nameValuePairs['type']) ? $nameValuePairs['type'] : "undefined"; $loopName = isset($nameValuePairs['name']) ? $nameValuePairs['name'] : "undefined"; @@ -178,19 +177,38 @@ abstract class BaseLoop /* check if mandatory */ if ($value === null && $argument->mandatory) { $faultActor[] = $argument->name; - $faultDetails[] = sprintf('"%s" parameter is missing in loop type: %s, name: %s', $argument->name, $loopType, $loopName); - } else if ($value === '') { + $faultDetails[] = $this->translator->trans( + '"%param" parameter is missing in loop type: %type, name: %name', [ + '%param' => $argument->name, + '%type' => $loopType, + '%name' => $loopName + ] + ); + } elseif ($value === '') { if (!$argument->empty) { /* check if empty */ $faultActor[] = $argument->name; - $faultDetails[] = sprintf('"%s" parameter cannot be empty in loop type: %s, name: %s', $argument->name, $loopType, $loopName); + $faultDetails[] = $this->translator->trans( + '"%param" parameter cannot be empty in loop type: %type, name: %name', [ + '%param' => $argument->name, + '%type' => $loopType, + '%name' => $loopName + ] + ); } } elseif ($value !== null && !$argument->type->isValid($value)) { /* check type */ $faultActor[] = $argument->name; - $faultDetails[] = sprintf('Invalid value "%s" for "%s" argument in loop type: %s, name: %s', $value, $argument->name, $loopType, $loopName); + $faultDetails[] = $this->translator->trans( + 'Invalid value "%value" for "%param" parameter in loop type: %type, name: %name', [ + '%value' => $value, + '%param' => $argument->name, + '%type' => $loopType, + '%name' => $loopName + ] + ); } else { - /* set default */ + /* set default value */ /* did it as last checking for we consider default value is acceptable no matter type or empty restriction */ if ($value === null) { $value = $argument->default; @@ -200,9 +218,9 @@ abstract class BaseLoop } } - if (!empty($faultActor)) { - + if (! empty($faultActor)) { $complement = sprintf('[%s]', implode(', ', $faultDetails)); + throw new \InvalidArgumentException($complement); } } @@ -212,15 +230,17 @@ abstract class BaseLoop * * @param string $argumentName the argument name * - * @throws \InvalidArgumentException if argument is not found in loop argument list * @return Argument the loop argument. + * @throws \InvalidArgumentException if argument is not found in loop argument list */ protected function getArg($argumentName) { $arg = $this->args->get($argumentName); if ($arg === null) - throw new \InvalidArgumentException("Undefined loop argument '$argumentName'"); + throw new \InvalidArgumentException( + $this->translator->trans('Undefined loop argument "%name"', ['%name' => $argumentName]) + ); return $arg; } @@ -231,7 +251,7 @@ abstract class BaseLoop * @param string $argumentName the argument name * * @throws \InvalidArgumentException if argument is not found in loop argument list - * @return Argument the loop argument. + * @return mixed the loop argument value */ protected function getArgValue($argumentName) { @@ -239,20 +259,24 @@ abstract class BaseLoop } /** - * @param ModelCriteria $search - * @param null $pagination + * @param ModelCriteria $search the search request + * @param PropelModelPager $pagination the pagination part * - * @return array|mixed|\PropelModelPager|\PropelObjectCollection + * @return array|PropelModelPager|ObjectCollection + * @throws \InvalidArgumentException if the search mode is undefined. */ protected function search(ModelCriteria $search, &$pagination = null) { if (false === $this->countable) { return $search->find(); } + if ($this instanceof SearchLoopInterface) { - $searchTerm = $this->getSearch_term(); - $searchIn = $this->getSearch_in(); - $searchMode = $this->getSearch_mode(); + + $searchTerm = $this->getArgValue('search_term'); + $searchIn = $this->getArgValue('search_in'); + $searchMode = $this->getArgValue('search_mode'); + if (null !== $searchTerm && null !== $searchIn) { switch ($searchMode) { @@ -267,6 +291,10 @@ abstract class BaseLoop case SearchLoopInterface::MODE_STRICT_SENTENCE: $searchCriteria = Criteria::EQUAL; break; + default: + throw new \InvalidArgumentException( + $this->translator->trans("Undefined search mode '%mode'", ['%mode' => $searchMode]) + ); } $this->doSearch($search, $searchTerm, $searchIn, $searchCriteria); @@ -280,24 +308,31 @@ abstract class BaseLoop } } - protected function searchArray(array $search, &$pagination = null) + protected function searchArray(array $search) { if (false === $this->countable) { return $search; } + + $limit = intval($this->getArgValue('limit')); + $offset = intval($this->getArgValue('offset')); + if ($this->getArgValue('page') !== null) { - $nbPage = ceil(count($search)/$this->getArgValue('limit')); - if ($this->getArgValue('page') > $nbPage || $this->getArgValue('page') <= 0) { - return array(); + $pageNum = intval($this->getArgValue('page')); + + $totalPageCount = ceil(count($search) / $limit); + + if ($pageNum > $totalPageCount || $pageNum <= 0) { + return []; } - $firstItem = ($this->getArgValue('page')-1) * $this->getArgValue('limit') + 1; + $firstItem = ($pageNum - 1) * $limit + 1; - return array_slice($search, $firstItem, $firstItem + $this->getArgValue('limit'), false); + return array_slice($search, $firstItem, $firstItem + $limit, false); } else { - return array_slice($search, $this->getArgValue('offset'), $this->getArgValue('limit'), false); + return array_slice($search, $offset, $limit, false); } } @@ -305,30 +340,36 @@ abstract class BaseLoop /** * @param ModelCriteria $search * - * @return array|mixed|\PropelObjectCollection + * @return ObjectCollection */ protected function searchWithOffset(ModelCriteria $search) { - if ($this->getArgValue('limit') >= 0) { - $search->limit($this->getArgValue('limit')); + $limit = intval($this->getArgValue('limit')); + + if ($limit >= 0) { + $search->limit($limit); } - $search->offset($this->getArgValue('offset')); + + $search->offset(intval($this->getArgValue('offset'))); return $search->find(); } /** - * @param ModelCriteria $search - * @param $pagination + * @param ModelCriteria $search + * @param PropelModelPager $pagination * - * @return array|\Propel\Runtime\Util\PropelModelPager + * @return array|PropelModelPager */ protected function searchWithPagination(ModelCriteria $search, &$pagination) { - $pagination = $search->paginate($this->getArgValue('page'), $this->getArgValue('limit')); + $page = intval($this->getArgValue('page')); + $limit = intval($this->getArgValue('limit')); - if ($this->getArgValue('page') > $pagination->getLastPage()) { - return array(); + $pagination = $search->paginate($page, $limit); + + if ($page > $pagination->getLastPage()) { + return []; } else { return $pagination; } @@ -361,18 +402,21 @@ abstract class BaseLoop } /** - * @param $pagination + * @param PropelModelPager $pagination + * * @return LoopResult */ public function exec(&$pagination) { $hash = $this->args->getHash(); if (false === isset(self::$cacheLoopResult[$hash])) { + + $results = []; + if ($this instanceof PropelSearchLoopInterface) { $searchModelCriteria = $this->buildModelCriteria(); - if (null === $searchModelCriteria) { - $results = array(); - } else { + + if (null !== $searchModelCriteria) { $results = $this->search( $searchModelCriteria, $pagination @@ -380,13 +424,9 @@ abstract class BaseLoop } } elseif ($this instanceof ArraySearchLoopInterface) { $searchArray = $this->buildArray(); - if (null === $searchArray) { - $results = array(); - } else { - $results = $this->searchArray( - $searchArray, - $pagination - ); + + if (null !== $searchArray) { + $results = $this->searchArray($searchArray); } } @@ -416,30 +456,49 @@ abstract class BaseLoop * - ArraySearchLoopInterface */ $searchInterface = false; + if ($this instanceof PropelSearchLoopInterface) { if (true === $searchInterface) { - throw new LoopException('Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::MULTIPLE_SEARCH_INTERFACE); + throw new LoopException( + $this->translator->trans( + 'Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`' + ), + LoopException::MULTIPLE_SEARCH_INTERFACE); } $searchInterface = true; } + if ($this instanceof ArraySearchLoopInterface) { if (true === $searchInterface) { - throw new LoopException('Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::MULTIPLE_SEARCH_INTERFACE); + throw new LoopException( + $this->translator->trans( + 'Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`' + ), + LoopException::MULTIPLE_SEARCH_INTERFACE); } $searchInterface = true; } if (false === $searchInterface) { - throw new LoopException('Loop must implements one of the following interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::SEARCH_INTERFACE_NOT_FOUND); + throw new LoopException( + $this->translator->trans( + 'Loop must implements one of the following interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`' + ), + LoopException::SEARCH_INTERFACE_NOT_FOUND); } /* Only PropelSearch allows timestamp and version */ if (!$this instanceof PropelSearchLoopInterface) { if (true === $this->timestampable) { - throw new LoopException("Loop must implements 'PropelSearchLoopInterface' to be timestampable", LoopException::NOT_TIMESTAMPED); + throw new LoopException( + $this->translator->trans("Loop must implements 'PropelSearchLoopInterface' to be timestampable"), + LoopException::NOT_TIMESTAMPED); } + if (true === $this->versionable) { - throw new LoopException("Loop must implements 'PropelSearchLoopInterface' to be versionable", LoopException::NOT_VERSIONED); + throw new LoopException( + $this->translator->trans("Loop must implements 'PropelSearchLoopInterface' to be versionable"), + LoopException::NOT_VERSIONED); } } } @@ -452,15 +511,14 @@ abstract class BaseLoop abstract public function parseResults(LoopResult $loopResult); /** - * - * define all args used in your loop - * + * Definition of loop arguments * * example : * * public function getArgDefinitions() * { * return new ArgumentCollection( + * * Argument::createIntListTypeArgument('id'), * new Argument( * 'ref', @@ -470,14 +528,7 @@ abstract class BaseLoop * ), * Argument::createIntListTypeArgument('category'), * Argument::createBooleanTypeArgument('new'), - * Argument::createBooleanTypeArgument('promo'), - * Argument::createFloatTypeArgument('min_price'), - * Argument::createFloatTypeArgument('max_price'), - * Argument::createIntTypeArgument('min_stock'), - * Argument::createFloatTypeArgument('min_weight'), - * Argument::createFloatTypeArgument('max_weight'), - * Argument::createBooleanTypeArgument('current'), - * + * ... * ); * } * diff --git a/core/lib/Thelia/Core/Template/Element/Exception/ElementNotFoundException.php b/core/lib/Thelia/Core/Template/Element/Exception/ElementNotFoundException.php index 0f9972e97..1d8359c6c 100644 --- a/core/lib/Thelia/Core/Template/Element/Exception/ElementNotFoundException.php +++ b/core/lib/Thelia/Core/Template/Element/Exception/ElementNotFoundException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Element\Exception; diff --git a/core/lib/Thelia/Core/Template/Element/Exception/InvalidElementException.php b/core/lib/Thelia/Core/Template/Element/Exception/InvalidElementException.php index b77f76a09..244da4c5f 100644 --- a/core/lib/Thelia/Core/Template/Element/Exception/InvalidElementException.php +++ b/core/lib/Thelia/Core/Template/Element/Exception/InvalidElementException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Element\Exception; diff --git a/core/lib/Thelia/Core/Template/Element/Exception/LoopException.php b/core/lib/Thelia/Core/Template/Element/Exception/LoopException.php index cc6340df3..79648e331 100644 --- a/core/lib/Thelia/Core/Template/Element/Exception/LoopException.php +++ b/core/lib/Thelia/Core/Template/Element/Exception/LoopException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Element\Exception; diff --git a/core/lib/Thelia/Core/Template/Element/Exception/SearchLoopException.php b/core/lib/Thelia/Core/Template/Element/Exception/SearchLoopException.php index f1ce6657f..ed972b16b 100644 --- a/core/lib/Thelia/Core/Template/Element/Exception/SearchLoopException.php +++ b/core/lib/Thelia/Core/Template/Element/Exception/SearchLoopException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Element\Exception; diff --git a/core/lib/Thelia/Core/Template/Element/LoopResult.php b/core/lib/Thelia/Core/Template/Element/LoopResult.php index 66a972872..bd658e02c 100644 --- a/core/lib/Thelia/Core/Template/Element/LoopResult.php +++ b/core/lib/Thelia/Core/Template/Element/LoopResult.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Element; diff --git a/core/lib/Thelia/Core/Template/Element/LoopResultRow.php b/core/lib/Thelia/Core/Template/Element/LoopResultRow.php index d908c92c3..5d30e4609 100644 --- a/core/lib/Thelia/Core/Template/Element/LoopResultRow.php +++ b/core/lib/Thelia/Core/Template/Element/LoopResultRow.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Element; diff --git a/core/lib/Thelia/Core/Template/Element/PropelSearchLoopInterface.php b/core/lib/Thelia/Core/Template/Element/PropelSearchLoopInterface.php index 7bcb5614c..5c794b68d 100644 --- a/core/lib/Thelia/Core/Template/Element/PropelSearchLoopInterface.php +++ b/core/lib/Thelia/Core/Template/Element/PropelSearchLoopInterface.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\Template\Element; /** diff --git a/core/lib/Thelia/Core/Template/Element/SearchLoopInterface.php b/core/lib/Thelia/Core/Template/Element/SearchLoopInterface.php index 26a154e15..290a59995 100644 --- a/core/lib/Thelia/Core/Template/Element/SearchLoopInterface.php +++ b/core/lib/Thelia/Core/Template/Element/SearchLoopInterface.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\Template\Element; /** diff --git a/core/lib/Thelia/Core/Template/Exception/ResourceNotFoundException.php b/core/lib/Thelia/Core/Template/Exception/ResourceNotFoundException.php index 37856c620..1a733efbd 100644 --- a/core/lib/Thelia/Core/Template/Exception/ResourceNotFoundException.php +++ b/core/lib/Thelia/Core/Template/Exception/ResourceNotFoundException.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\Template\Exception; class ResourceNotFoundException extends \RuntimeException diff --git a/core/lib/Thelia/Core/Template/Loop/Accessory.php b/core/lib/Thelia/Core/Template/Loop/Accessory.php index 5238b6fbb..d96208eb8 100644 --- a/core/lib/Thelia/Core/Template/Loop/Accessory.php +++ b/core/lib/Thelia/Core/Template/Loop/Accessory.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Address.php b/core/lib/Thelia/Core/Template/Loop/Address.php index 8bb4f4f9c..6daf7029f 100644 --- a/core/lib/Thelia/Core/Template/Loop/Address.php +++ b/core/lib/Thelia/Core/Template/Loop/Address.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Admin.php b/core/lib/Thelia/Core/Template/Loop/Admin.php index b5ac7d8b8..36125b401 100644 --- a/core/lib/Thelia/Core/Template/Loop/Admin.php +++ b/core/lib/Thelia/Core/Template/Loop/Admin.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Area.php b/core/lib/Thelia/Core/Template/Loop/Area.php index 6ac3b1518..5653c787e 100644 --- a/core/lib/Thelia/Core/Template/Loop/Area.php +++ b/core/lib/Thelia/Core/Template/Loop/Area.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -77,7 +66,8 @@ class Area extends BaseLoop implements PropelSearchLoopInterface return new ArgumentCollection( Argument::createIntListTypeArgument('id'), Argument::createIntTypeArgument('with_zone'), - Argument::createIntTypeArgument('without_zone') + Argument::createIntTypeArgument('without_zone'), + Argument::createBooleanOrBothTypeArgument('unassigned') ); } @@ -106,6 +96,14 @@ class Area extends BaseLoop implements PropelSearchLoopInterface ->where('`without_zone`.delivery_module_id '.Criteria::ISNULL); } + $notAssigned = $this->getUnassigned(); + + if ($notAssigned) { + $search + ->joinAreaDeliveryModule('unassigned', Criteria::LEFT_JOIN) + ->where('`unassigned`.delivery_module_id ' . Criteria::ISNULL); + } + return $search; } diff --git a/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php b/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php index 56100e490..9de14b6a8 100644 --- a/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php +++ b/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop\Argument; diff --git a/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php b/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php index c272592eb..5cb91ebf4 100644 --- a/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php +++ b/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\Template\Loop\Argument; /** diff --git a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php index 1184210ea..d1e8fc97d 100644 --- a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php +++ b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Attribute.php b/core/lib/Thelia/Core/Template/Loop/Attribute.php index a973aade0..451993de0 100644 --- a/core/lib/Thelia/Core/Template/Loop/Attribute.php +++ b/core/lib/Thelia/Core/Template/Loop/Attribute.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php b/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php index 81f01f6da..933ebcdce 100644 --- a/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php +++ b/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php b/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php index 7fad6bd34..f39adb95b 100644 --- a/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php +++ b/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Auth.php b/core/lib/Thelia/Core/Template/Loop/Auth.php index 667d5dfd2..b81601c14 100644 --- a/core/lib/Thelia/Core/Template/Loop/Auth.php +++ b/core/lib/Thelia/Core/Template/Loop/Auth.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -71,8 +60,7 @@ class Auth extends BaseLoop implements ArraySearchLoopInterface new TypeCollection( new EnumListType(array(AccessManager::VIEW, AccessManager::CREATE, AccessManager::UPDATE, AccessManager::DELETE)) ) - ), - Argument::createAnyTypeArgument('context', 'front', false) + ) ); } diff --git a/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php b/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php index ae7226152..de7a66454 100644 --- a/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php +++ b/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Cart.php b/core/lib/Thelia/Core/Template/Loop/Cart.php index 02a3fada6..d01cb3df0 100644 --- a/core/lib/Thelia/Core/Template/Loop/Cart.php +++ b/core/lib/Thelia/Core/Template/Loop/Cart.php @@ -1,11 +1,14 @@ set("TITLE", $product->getTitle()); $loopResultRow->set("REF", $product->getRef()); $loopResultRow->set("QUANTITY", $cartItem->getQuantity()); - $loopResultRow->set("PRICE", $cartItem->getPrice()); $loopResultRow->set("PRODUCT_ID", $product->getId()); $loopResultRow->set("PRODUCT_URL", $product->getUrl($this->request->getSession()->getLang()->getLocale())) ->set("STOCK", $productSaleElement->getQuantity()) diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index b5dbd4de0..9dbb3ea2a 100644 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php index d70654d0b..4610949b8 100644 --- a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php +++ b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -65,7 +54,6 @@ class CategoryPath extends BaseI18nLoop implements ArraySearchLoopInterface return new ArgumentCollection( Argument::createIntTypeArgument('category', null, true), Argument::createIntTypeArgument('depth'), - Argument::createIntTypeArgument('level'), Argument::createBooleanOrBothTypeArgument('visible', true, false) ); } diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php index 35a9569f9..2cc4435b7 100644 --- a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php +++ b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Config.php b/core/lib/Thelia/Core/Template/Loop/Config.php index f656c6d51..8cbfea5e7 100644 --- a/core/lib/Thelia/Core/Template/Loop/Config.php +++ b/core/lib/Thelia/Core/Template/Loop/Config.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Content.php b/core/lib/Thelia/Core/Template/Loop/Content.php index ee028e16d..377737088 100644 --- a/core/lib/Thelia/Core/Template/Loop/Content.php +++ b/core/lib/Thelia/Core/Template/Loop/Content.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -64,6 +53,7 @@ class Content extends BaseI18nLoop implements PropelSearchLoopInterface Argument::createIntListTypeArgument('folder_default'), Argument::createBooleanTypeArgument('current'), Argument::createBooleanTypeArgument('current_folder'), + Argument::createBooleanTypeArgument('with_prev_next_info', false), Argument::createIntTypeArgument('depth', 1), Argument::createBooleanOrBothTypeArgument('visible', 1), Argument::createAnyTypeArgument('title'), @@ -212,9 +202,10 @@ class Content extends BaseI18nLoop implements PropelSearchLoopInterface public function parseResults(LoopResult $loopResult) { + /** @var \Thelia\Model\Content $content */ foreach ($loopResult->getResultDataCollection() as $content) { $loopResultRow = new LoopResultRow($content); - + $defaultFolderId = $content->getDefaultFolderId(); $loopResultRow->set("ID" , $content->getId()) ->set("IS_TRANSLATED" , $content->getVirtualColumn('IS_TRANSLATED')) ->set("LOCALE" , $this->locale) @@ -227,16 +218,54 @@ class Content extends BaseI18nLoop implements PropelSearchLoopInterface ->set("META_DESCRIPTION" , $content->getVirtualColumn('i18n_META_DESCRIPTION')) ->set("META_KEYWORDS" , $content->getVirtualColumn('i18n_META_KEYWORDS')) ->set("POSITION" , $content->getPosition()) - ->set("DEFAULT_FOLDER" , $content->getDefaultFolderId()) + ->set("DEFAULT_FOLDER" , $defaultFolderId) ->set("VISIBLE" , $content->getVisible()) ; - $loopResult->addRow($loopResultRow); + $loopResult->addRow($this->findNextPrev($loopResultRow, $content, $defaultFolderId)); } return $loopResult; } + /** + * @param LoopResultRow $loopResultRow + * @param \Thelia\Model\Content $content + * @param $defaultFolderId + * @return LoopResultRow + */ + private function findNextPrev(LoopResultRow $loopResultRow, \Thelia\Model\Content $content, $defaultFolderId) + { + if ($this->getBackend_context() || $this->getWithPrevNextInfo()) { + + // Find previous and next category + $previous = ContentQuery::create() + ->joinContentFolder() + ->where('ContentFolder.folder_id = ?', $defaultFolderId) + ->filterByPosition($content->getPosition(), Criteria::LESS_THAN) + ->orderByPosition(Criteria::DESC) + ->findOne() + ; + + $next = ContentQuery::create() + ->joinContentFolder() + ->where('ContentFolder.folder_id = ?', $defaultFolderId) + ->filterByPosition($content->getPosition(), Criteria::GREATER_THAN) + ->orderByPosition(Criteria::ASC) + ->findOne() + ; + + $loopResultRow + ->set("HAS_PREVIOUS" , $previous != null ? 1 : 0) + ->set("HAS_NEXT" , $next != null ? 1 : 0) + ->set("PREVIOUS" , $previous != null ? $previous->getId() : -1) + ->set("NEXT" , $next != null ? $next->getId() : -1) + ; + } + + return $loopResultRow; + } + } diff --git a/core/lib/Thelia/Core/Template/Loop/Country.php b/core/lib/Thelia/Core/Template/Loop/Country.php index 8676e03af..16d2f5da4 100644 --- a/core/lib/Thelia/Core/Template/Loop/Country.php +++ b/core/lib/Thelia/Core/Template/Loop/Country.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Coupon.php b/core/lib/Thelia/Core/Template/Loop/Coupon.php index 53ecfa5c3..6885463eb 100644 --- a/core/lib/Thelia/Core/Template/Loop/Coupon.php +++ b/core/lib/Thelia/Core/Template/Loop/Coupon.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -36,6 +25,9 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Coupon\Type\CouponInterface; use Thelia\Model\Coupon as MCoupon; use Thelia\Model\CouponQuery; +use Thelia\Model\Map\CouponTableMap; +use Thelia\Type\EnumListType; +use Thelia\Type\TypeCollection; /** * Coupon Loop @@ -55,7 +47,23 @@ class Coupon extends BaseI18nLoop implements PropelSearchLoopInterface { return new ArgumentCollection( Argument::createIntListTypeArgument('id'), - Argument::createBooleanOrBothTypeArgument('is_enabled') + Argument::createBooleanOrBothTypeArgument('is_enabled'), + new Argument( + 'order', + new TypeCollection( + new EnumListType(array( + 'id', 'id-reverse', + 'code', 'code-reverse', + 'title', 'title-reverse', + 'enabled', 'enabled-reverse', + 'expiration-date', 'expiration-date-reverse', + 'days-left', 'days-left-reverse', + 'usages-left', 'usages-left-reverse' + ) + ) + ), + 'code' + ) ); } @@ -77,6 +85,63 @@ class Coupon extends BaseI18nLoop implements PropelSearchLoopInterface $search->filterByIsEnabled($isEnabled ? true : false); } + $search->addAsColumn('days_left', 'DATEDIFF('.CouponTableMap::EXPIRATION_DATE.', CURDATE()) - 1'); + + $orders = $this->getOrder(); + + foreach ($orders as $order) { + switch ($order) { + case 'id': + $search->orderById(Criteria::ASC); + break; + case 'id-reverse': + $search->orderById(Criteria::DESC); + break; + + case 'code': + $search->orderByCode(Criteria::ASC); + break; + case 'code-reverse': + $search->orderByCode(Criteria::DESC); + break; + + case 'title': + $search->addAscendingOrderByColumn('i18n_TITLE'); + break; + case 'title-reverse': + $search->addDescendingOrderByColumn('i18n_TITLE'); + break; + + case 'enabled': + $search->orderByIsEnabled(Criteria::ASC); + break; + case 'enabled-reverse': + $search->orderByIsEnabled(Criteria::DESC); + break; + + case 'expiration-date': + $search->orderByExpirationDate(Criteria::ASC); + break; + case 'expiration-date-reverse': + $search->orderByExpirationDate(Criteria::DESC); + break; + + case 'usages-left': + $search->orderByMaxUsage(Criteria::ASC); + break; + case 'usages-left-reverse': + $search->orderByMaxUsage(Criteria::DESC); + break; + + case 'days-left': + $search->addAscendingOrderByColumn('days_left'); + break; + case 'days-left-reverse': + $search->addDescendingOrderByColumn('days_left'); + break; + } + } + return $search; } @@ -92,7 +157,9 @@ class Coupon extends BaseI18nLoop implements PropelSearchLoopInterface /** @var MCoupon $coupon */ foreach ($loopResult->getResultDataCollection() as $coupon) { + $loopResultRow = new LoopResultRow($coupon); + $conditions = $conditionFactory->unserializeConditionCollection( $coupon->getSerializedConditions() ); @@ -114,10 +181,6 @@ class Coupon extends BaseI18nLoop implements PropelSearchLoopInterface $coupon->getExpirationDate() ); - $now = time(); - $datediff = $coupon->getExpirationDate()->getTimestamp() - $now; - $daysLeftBeforeExpiration = floor($datediff/(60*60*24)); - $cleanedConditions = array(); /** @var ConditionInterface $condition */ foreach ($conditions as $condition) { @@ -127,14 +190,16 @@ class Coupon extends BaseI18nLoop implements PropelSearchLoopInterface ); $cleanedConditions[] = $temp; } - $loopResultRow->set("ID", $coupon->getId()) + + $loopResultRow + ->set("ID", $coupon->getId()) ->set("IS_TRANSLATED", $coupon->getVirtualColumn('IS_TRANSLATED')) ->set("LOCALE", $this->locale) ->set("CODE", $coupon->getCode()) ->set("TITLE", $coupon->getVirtualColumn('i18n_TITLE')) ->set("SHORT_DESCRIPTION", $coupon->getVirtualColumn('i18n_SHORT_DESCRIPTION')) ->set("DESCRIPTION", $coupon->getVirtualColumn('i18n_DESCRIPTION')) - ->set("EXPIRATION_DATE", $coupon->getExpirationDate($lang->getDateFormat())) + ->set("EXPIRATION_DATE", $coupon->getExpirationDate()) ->set("USAGE_LEFT", $coupon->getMaxUsage()) ->set("IS_CUMULATIVE", $coupon->getIsCumulative()) ->set("IS_REMOVING_POSTAGE", $coupon->getIsRemovingPostage()) @@ -143,7 +208,7 @@ class Coupon extends BaseI18nLoop implements PropelSearchLoopInterface ->set("AMOUNT", $coupon->getAmount()) ->set("APPLICATION_CONDITIONS", $cleanedConditions) ->set("TOOLTIP", $couponManager->getToolTip()) - ->set("DAY_LEFT_BEFORE_EXPIRATION", $daysLeftBeforeExpiration) + ->set("DAY_LEFT_BEFORE_EXPIRATION", max(0, $coupon->getVirtualColumn('days_left'))) ->set("SERVICE_ID", $couponManager->getServiceId()); $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/Currency.php b/core/lib/Thelia/Core/Template/Loop/Currency.php index 3d7a5631e..9eb6aa970 100644 --- a/core/lib/Thelia/Core/Template/Loop/Currency.php +++ b/core/lib/Thelia/Core/Template/Loop/Currency.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Customer.php b/core/lib/Thelia/Core/Template/Loop/Customer.php index d4b8effb0..99886113e 100644 --- a/core/lib/Thelia/Core/Template/Loop/Customer.php +++ b/core/lib/Thelia/Core/Template/Loop/Customer.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -67,19 +56,26 @@ class Customer extends BaseLoop implements SearchLoopInterface, PropelSearchLoop Argument::createBooleanTypeArgument('reseller'), Argument::createIntTypeArgument('sponsor'), new Argument( - 'order', - new TypeCollection( - new Type\EnumListType(array( - 'id', 'id_reverse', - 'reference', 'reference_reverse', - 'firstname', 'firstname_reverse', - 'lastname', 'lastname_reverse', - 'last_order', 'last_order_reverse', - 'order_amount', 'order_amount_reverse', - 'registration_date', 'registration_date_reverse' - )) - ), - 'lastname' + 'order', + new TypeCollection( + new Type\EnumListType(array( + 'id', + 'id_reverse', + 'reference', + 'reference_reverse', + 'firstname', + 'firstname_reverse', + 'lastname', + 'lastname_reverse', + 'last_order', + 'last_order_reverse', + 'order_amount', + 'order_amount_reverse', + 'registration_date', + 'registration_date_reverse' + )) + ), + 'lastname' ) ); } @@ -166,7 +162,7 @@ class Customer extends BaseLoop implements SearchLoopInterface, PropelSearchLoop $search->filterBySponsor($sponsor, Criteria::EQUAL); } - $orders = $this->getOrder(); + $orders = $this->getOrder(); foreach ($orders as $order) { switch ($order) { @@ -219,19 +215,15 @@ class Customer extends BaseLoop implements SearchLoopInterface, PropelSearchLoop $loopResultRow = new LoopResultRow($customer); $loopResultRow - ->set("ID" , $customer->getId()) - ->set("REF" , $customer->getRef()) - ->set("TITLE" , $customer->getTitleId()) - ->set("FIRSTNAME" , $customer->getFirstname()) - ->set("LASTNAME" , $customer->getLastname()) - ->set("EMAIL" , $customer->getEmail()) - ->set("RESELLER" , $customer->getReseller()) - ->set("SPONSOR" , $customer->getSponsor()) - ->set("DISCOUNT" , $customer->getDiscount()) - - ->set("LAST_ORDER_DATE" , $lastOrder != null ? $lastOrder->getCreatedAt() : '') - ->set("LAST_ORDER_AMOUNT" , $lastOrder != null ? $lastOrder->getCreatedAt() : '') - ->set("LAST_ORDER_CURRENCY" , $lastOrder != null ? $lastOrder->getCreatedAt() : '') + ->set("ID", $customer->getId()) + ->set("REF", $customer->getRef()) + ->set("TITLE", $customer->getTitleId()) + ->set("FIRSTNAME", $customer->getFirstname()) + ->set("LASTNAME", $customer->getLastname()) + ->set("EMAIL", $customer->getEmail()) + ->set("RESELLER", $customer->getReseller()) + ->set("SPONSOR", $customer->getSponsor()) + ->set("DISCOUNT", $customer->getDiscount()) ; $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Loop/Delivery.php b/core/lib/Thelia/Core/Template/Loop/Delivery.php index 2e7391c95..6bdcf1a6e 100644 --- a/core/lib/Thelia/Core/Template/Loop/Delivery.php +++ b/core/lib/Thelia/Core/Template/Loop/Delivery.php @@ -1,34 +1,25 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Loop\Argument\Argument; -use Thelia\Exception\OrderException; +use Thelia\Model\AreaDeliveryModuleQuery; use Thelia\Model\CountryQuery; +use Thelia\Model\Module; use Thelia\Module\BaseModule; use Thelia\Module\DeliveryModuleInterface; +use Thelia\Module\Exception\DeliveryException; /** * Class Delivery @@ -62,9 +53,17 @@ class Delivery extends BaseSpecificModule $country = $this->container->get('thelia.taxEngine')->getDeliveryCountry(); } + /** @var Module $deliveryModule */ foreach ($loopResult->getResultDataCollection() as $deliveryModule) { + + $areaDeliveryModule = AreaDeliveryModuleQuery::create() + ->findByCountryAndModule($country, $deliveryModule); + + if (null === $areaDeliveryModule) continue; + $loopResultRow = new LoopResultRow($deliveryModule); + /** @var DeliveryModuleInterface $moduleInstance */ $moduleInstance = $this->container->get(sprintf('module.%s', $deliveryModule->getCode())); if (false === $moduleInstance instanceof DeliveryModuleInterface) { @@ -72,28 +71,27 @@ class Delivery extends BaseSpecificModule } try { - $postage = $moduleInstance->getPostage($country); - } catch (OrderException $e) { - switch ($e->getCode()) { - case OrderException::DELIVERY_MODULE_UNAVAILABLE: - /* do not show this delivery module */ - continue(2); - break; - default: - throw $e; + // Check if module is valid, by calling isValidDelivery(), + // or catching a DeliveryException. + + if ($moduleInstance->isValidDelivery($country)) { + + $postage = $moduleInstance->getPostage($country); + + $loopResultRow + ->set('ID', $deliveryModule->getId()) + ->set('TITLE', $deliveryModule->getVirtualColumn('i18n_TITLE')) + ->set('CHAPO', $deliveryModule->getVirtualColumn('i18n_CHAPO')) + ->set('DESCRIPTION', $deliveryModule->getVirtualColumn('i18n_DESCRIPTION')) + ->set('POSTSCRIPTUM', $deliveryModule->getVirtualColumn('i18n_POSTSCRIPTUM')) + ->set('POSTAGE', $postage) + ; + + $loopResult->addRow($loopResultRow); } + } catch (DeliveryException $ex) { + // Module is not available } - - $loopResultRow - ->set('ID', $deliveryModule->getId()) - ->set('TITLE', $deliveryModule->getVirtualColumn('i18n_TITLE')) - ->set('CHAPO', $deliveryModule->getVirtualColumn('i18n_CHAPO')) - ->set('DESCRIPTION', $deliveryModule->getVirtualColumn('i18n_DESCRIPTION')) - ->set('POSTSCRIPTUM', $deliveryModule->getVirtualColumn('i18n_POSTSCRIPTUM')) - ->set('POSTAGE', $postage) - ; - - $loopResult->addRow($loopResultRow); } return $loopResult; diff --git a/core/lib/Thelia/Core/Template/Loop/Document.php b/core/lib/Thelia/Core/Template/Loop/Document.php index 0353b8df6..3e4063d7b 100644 --- a/core/lib/Thelia/Core/Template/Loop/Document.php +++ b/core/lib/Thelia/Core/Template/Loop/Document.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -83,7 +72,8 @@ class Document extends BaseI18nLoop implements PropelSearchLoopInterface new EnumType($this->possible_sources) ) ), - Argument::createIntTypeArgument('source_id') + Argument::createIntTypeArgument('source_id'), + Argument::createBooleanTypeArgument('force_return', true) ); // Add possible document sources @@ -262,7 +252,7 @@ class Document extends BaseI18nLoop implements PropelSearchLoopInterface $loopResult->addRow($loopResultRow); } catch (\Exception $ex) { // Ignore the result and log an error - Tlog::getInstance()->addError(sprintf("Failed to process document in document loop: %s", $ex->getMessage()), $this->args); + Tlog::getInstance()->addError(sprintf("Failed to process document in document loop: %s", $ex->getMessage())); } } diff --git a/core/lib/Thelia/Core/Template/Loop/Feature.php b/core/lib/Thelia/Core/Template/Loop/Feature.php index 74d165562..838f427ce 100644 --- a/core/lib/Thelia/Core/Template/Loop/Feature.php +++ b/core/lib/Thelia/Core/Template/Loop/Feature.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php b/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php index 96c65713d..dbf7a97d7 100644 --- a/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php +++ b/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/FeatureValue.php b/core/lib/Thelia/Core/Template/Loop/FeatureValue.php index 2341db00a..d8f25d04b 100644 --- a/core/lib/Thelia/Core/Template/Loop/FeatureValue.php +++ b/core/lib/Thelia/Core/Template/Loop/FeatureValue.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Feed.php b/core/lib/Thelia/Core/Template/Loop/Feed.php index 90a6ffa41..8effe48a6 100644 --- a/core/lib/Thelia/Core/Template/Loop/Feed.php +++ b/core/lib/Thelia/Core/Template/Loop/Feed.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index fa561b3fb..7b6906e32 100644 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/FolderPath.php b/core/lib/Thelia/Core/Template/Loop/FolderPath.php index b50d7c55d..e8b7dc451 100644 --- a/core/lib/Thelia/Core/Template/Loop/FolderPath.php +++ b/core/lib/Thelia/Core/Template/Loop/FolderPath.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -75,7 +64,6 @@ class FolderPath extends BaseI18nLoop implements ArraySearchLoopInterface return new ArgumentCollection( Argument::createIntTypeArgument('folder', null, true), Argument::createIntTypeArgument('depth'), - Argument::createIntTypeArgument('level'), Argument::createBooleanOrBothTypeArgument('visible', true, false) ); } diff --git a/core/lib/Thelia/Core/Template/Loop/FolderTree.php b/core/lib/Thelia/Core/Template/Loop/FolderTree.php index 851b6d8ff..1cb7b487c 100644 --- a/core/lib/Thelia/Core/Template/Loop/FolderTree.php +++ b/core/lib/Thelia/Core/Template/Loop/FolderTree.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Image.php b/core/lib/Thelia/Core/Template/Loop/Image.php index 157259f30..2a94655b3 100644 --- a/core/lib/Thelia/Core/Template/Loop/Image.php +++ b/core/lib/Thelia/Core/Template/Loop/Image.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -316,7 +305,7 @@ class Image extends BaseI18nLoop implements PropelSearchLoopInterface $loopResult->addRow($loopResultRow); } catch (\Exception $ex) { // Ignore the result and log an error - Tlog::getInstance()->addError("Failed to process image in image loop: ", $this->args); + Tlog::getInstance()->addError(sprintf("Failed to process image in image loop: %s", $ex->getMessage())); } } diff --git a/core/lib/Thelia/Core/Template/Loop/Lang.php b/core/lib/Thelia/Core/Template/Loop/Lang.php index 64066ab89..6cafddb45 100644 --- a/core/lib/Thelia/Core/Template/Loop/Lang.php +++ b/core/lib/Thelia/Core/Template/Loop/Lang.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Message.php b/core/lib/Thelia/Core/Template/Loop/Message.php index 4594dd4d2..987bf2469 100644 --- a/core/lib/Thelia/Core/Template/Loop/Message.php +++ b/core/lib/Thelia/Core/Template/Loop/Message.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Module.php b/core/lib/Thelia/Core/Template/Loop/Module.php index 8c4703c24..b10c1f1ad 100644 --- a/core/lib/Thelia/Core/Template/Loop/Module.php +++ b/core/lib/Thelia/Core/Template/Loop/Module.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -177,65 +166,81 @@ class Module extends BaseI18nLoop implements PropelSearchLoopInterface public function parseResults(LoopResult $loopResult) { + /** @var \Thelia\Model\Module $module */ foreach ($loopResult->getResultDataCollection() as $module) { - $loopResultRow = new LoopResultRow($module); - $loopResultRow->set("ID", $module->getId()) - ->set("IS_TRANSLATED",$module->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE",$this->locale) - ->set("TITLE",$module->getVirtualColumn('i18n_TITLE')) - ->set("CHAPO", $module->getVirtualColumn('i18n_CHAPO')) - ->set("DESCRIPTION", $module->getVirtualColumn('i18n_DESCRIPTION')) - ->set("POSTSCRIPTUM", $module->getVirtualColumn('i18n_POSTSCRIPTUM')) - ->set("CODE", $module->getCode()) - ->set("TYPE", $module->getType()) - ->set("ACTIVE", $module->getActivate()) - ->set("CLASS", $module->getFullNamespace()) - ->set("POSITION", $module->getPosition()); - $hasConfigurationInterface = false; + try { + new \ReflectionClass($module->getFullNamespace()); - /* first test if module defines it's own config route */ - if ($module->getActivate()) { - // Works only fo activated modules - see Thelia\Core\DependencyInjection\Compiler\RegisterRouterPass - $routerId = "router." . $module->getBaseDir(); - if ($this->container->has($routerId)) { - try { - if ($this->container->get($routerId)->match('/admin/module/' . $module->getCode())) { + $exists = true; + } catch (\ReflectionException $ex) { + $exists = false; + } + + if ($exists || $this->getBackendContext()) { + $loopResultRow = new LoopResultRow($module); + + $loopResultRow + ->set("ID" , $module->getId()) + ->set("IS_TRANSLATED", $module->getVirtualColumn('IS_TRANSLATED')) + ->set("LOCALE" , $this->locale) + ->set("TITLE" , $module->getVirtualColumn('i18n_TITLE')) + ->set("CHAPO" , $module->getVirtualColumn('i18n_CHAPO')) + ->set("DESCRIPTION" , $module->getVirtualColumn('i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM" , $module->getVirtualColumn('i18n_POSTSCRIPTUM')) + ->set("CODE" , $module->getCode()) + ->set("TYPE" , $module->getType()) + ->set("ACTIVE" , $module->getActivate()) + ->set("CLASS" , $module->getFullNamespace()) + ->set("POSITION" , $module->getPosition()) + ->set("EXISTS" , $exists) + ; + + $hasConfigurationInterface = false; + + /* first test if module defines it's own config route */ + if ($module->getActivate()) { + // Works only fo activated modules - see Thelia\Core\DependencyInjection\Compiler\RegisterRouterPass + $routerId = "router." . $module->getBaseDir(); + if ($this->container->has($routerId)) { + try { + if ($this->container->get($routerId)->match('/admin/module/' . $module->getCode())) { + $hasConfigurationInterface = true; + } + } catch (ResourceNotFoundException $e) { + /* $hasConfigurationInterface stays false */ + } + } + + /* if not ; test if it uses admin inclusion : module_configuration.html */ + if (false === $hasConfigurationInterface) { + if (file_exists($module->getAbsoluteAdminIncludesPath() . DS . "module_configuration.html")) { $hasConfigurationInterface = true; } - } catch (ResourceNotFoundException $e) { - /* $hasConfigurationInterface stays false */ } - } + } else { + // Make a quick and dirty test on the module's routing.xml file + $routing = @file_get_contents($module->getAbsoluteConfigPath() . DS . "routing.xml"); - /* if not ; test if it uses admin inclusion : module_configuration.html */ - if (false === $hasConfigurationInterface) { - if (file_exists( sprintf("%s/AdminIncludes/%s.html", $module->getAbsoluteBaseDir(), "module_configuration"))) { + if ($routing && strpos($routing, '/admin/module/') !== false) { $hasConfigurationInterface = true; } } - } else { - // Make a quick and dirty test on the module's routing.xml file - $routing = @file_get_contents($module->getAbsoluteBaseDir() . DS . "Config" . DS . "routing.xml"); - if ($routing && strpos($routing, '/admin/module/') !== false) { - $hasConfigurationInterface = true; + $loopResultRow->set("CONFIGURABLE", $hasConfigurationInterface ? 1 : 0); + + if (null !== $this->getProfile()) { + $accessValue = $module->getVirtualColumn('access'); + $manager = new AccessManager($accessValue); + + $loopResultRow->set("VIEWABLE", $manager->can(AccessManager::VIEW)? 1 : 0) + ->set("CREATABLE", $manager->can(AccessManager::CREATE) ? 1 : 0) + ->set("UPDATABLE", $manager->can(AccessManager::UPDATE)? 1 : 0) + ->set("DELETABLE", $manager->can(AccessManager::DELETE)? 1 : 0); } + + $loopResult->addRow($loopResultRow); } - - $loopResultRow->set("CONFIGURABLE", $hasConfigurationInterface ? 1 : 0); - - if (null !== $this->getProfile()) { - $accessValue = $module->getVirtualColumn('access'); - $manager = new AccessManager($accessValue); - - $loopResultRow->set("VIEWABLE", $manager->can(AccessManager::VIEW)? 1 : 0) - ->set("CREATABLE", $manager->can(AccessManager::CREATE) ? 1 : 0) - ->set("UPDATABLE", $manager->can(AccessManager::UPDATE)? 1 : 0) - ->set("DELETABLE", $manager->can(AccessManager::DELETE)? 1 : 0); - } - - $loopResult->addRow($loopResultRow); } return $loopResult; diff --git a/core/lib/Thelia/Core/Template/Loop/Order.php b/core/lib/Thelia/Core/Template/Loop/Order.php index 870ce2121..b717ea46c 100644 --- a/core/lib/Thelia/Core/Template/Loop/Order.php +++ b/core/lib/Thelia/Core/Template/Loop/Order.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -92,11 +81,11 @@ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInt public function getSearchIn() { return array( - "ref", - "customer_ref", - "customer_firstname", - "customer_lastname", - "customer_email", + 'ref', + 'customer_ref', + 'customer_firstname', + 'customer_lastname', + 'customer_email', ); } @@ -115,25 +104,25 @@ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInt $search->_or(); } switch ($searchInElement) { - case "ref": + case 'ref': $search->filterByRef($searchTerm, $searchCriteria); break; - case "customer_ref": + case 'customer_ref': $search->filterByCustomer( CustomerQuery::create()->filterByRef($searchTerm, $searchCriteria)->find() ); break; - case "customer_firstname": + case 'customer_firstname': $search->filterByOrderAddressRelatedByInvoiceOrderAddressId( OrderAddressQuery::create()->filterByFirstname($searchTerm, $searchCriteria)->find() ); break; - case "customer_lastname": + case 'customer_lastname': $search->filterByOrderAddressRelatedByInvoiceOrderAddressId( OrderAddressQuery::create()->filterByLastname($searchTerm, $searchCriteria)->find() ); break; - case "customer_email": + case 'customer_email': $search->filterByCustomer( CustomerQuery::create()->filterByEmail($searchTerm, $searchCriteria)->find() ); @@ -178,28 +167,28 @@ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInt case 'id': $search->orderById(Criteria::ASC); break; - case 'id_reverse': + case 'id-reverse': $search->orderById(Criteria::DESC); break; case 'reference': $search->orderByRef(Criteria::ASC); break; - case 'reference_reverse': + case 'reference-reverse': $search->orderByRef(Criteria::DESC); break; - case "create-date": + case 'create-date': $search->orderByCreatedAt(Criteria::ASC); break; - case "create-date-reverse": + case 'create-date-reverse': $search->orderByCreatedAt(Criteria::DESC); break; - case "status": + case 'status': $search->orderByStatusId(Criteria::ASC); break; - case "status": + case 'status-reverse': $search->orderByStatusId(Criteria::DESC); break; @@ -210,7 +199,7 @@ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInt ->orderBy('company', Criteria::ASC) ; break; - case 'companyreverse' : + case 'company-reverse' : $search ->joinOrderAddressRelatedByDeliveryOrderAddressId() ->withColumn(OrderAddressTableMap::COMPANY, 'company') @@ -244,31 +233,32 @@ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInt public function parseResults(LoopResult $loopResult) { + /** @var \Thelia\Model\Order $order */ foreach ($loopResult->getResultDataCollection() as $order) { $tax = 0; $amount = $order->getTotalAmount($tax); $loopResultRow = new LoopResultRow($order); $loopResultRow - ->set("ID", $order->getId()) - ->set("REF", $order->getRef()) - ->set("CUSTOMER", $order->getCustomerId()) - ->set("DELIVERY_ADDRESS", $order->getDeliveryOrderAddressId()) - ->set("INVOICE_ADDRESS", $order->getInvoiceOrderAddressId()) - ->set("INVOICE_DATE", $order->getInvoiceDate()) - ->set("CURRENCY", $order->getCurrencyId()) - ->set("CURRENCY_RATE", $order->getCurrencyRate()) - ->set("TRANSACTION_REF", $order->getTransactionRef()) - ->set("DELIVERY_REF", $order->getDeliveryRef()) - ->set("INVOICE_REF", $order->getInvoiceRef()) - ->set("POSTAGE", $order->getPostage()) - ->set("PAYMENT_MODULE", $order->getPaymentModuleId()) - ->set("DELIVERY_MODULE", $order->getDeliveryModuleId()) - ->set("STATUS", $order->getStatusId()) - ->set("LANG", $order->getLangId()) - ->set("DISCOUNT", $order->getDiscount()) - ->set("TOTAL_TAX", $tax) - ->set("TOTAL_AMOUNT", $amount - $tax) - ->set("TOTAL_TAXED_AMOUNT", $amount) + ->set('ID', $order->getId()) + ->set('REF', $order->getRef()) + ->set('CUSTOMER', $order->getCustomerId()) + ->set('DELIVERY_ADDRESS', $order->getDeliveryOrderAddressId()) + ->set('INVOICE_ADDRESS', $order->getInvoiceOrderAddressId()) + ->set('INVOICE_DATE', $order->getInvoiceDate()) + ->set('CURRENCY', $order->getCurrencyId()) + ->set('CURRENCY_RATE', $order->getCurrencyRate()) + ->set('TRANSACTION_REF', $order->getTransactionRef()) + ->set('DELIVERY_REF', $order->getDeliveryRef()) + ->set('INVOICE_REF', $order->getInvoiceRef()) + ->set('POSTAGE', $order->getPostage()) + ->set('PAYMENT_MODULE', $order->getPaymentModuleId()) + ->set('DELIVERY_MODULE', $order->getDeliveryModuleId()) + ->set('STATUS', $order->getStatusId()) + ->set('LANG', $order->getLangId()) + ->set('DISCOUNT', $order->getDiscount()) + ->set('TOTAL_TAX', $tax) + ->set('TOTAL_AMOUNT', $amount - $tax) + ->set('TOTAL_TAXED_AMOUNT', $amount) ; $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Loop/OrderAddress.php b/core/lib/Thelia/Core/Template/Loop/OrderAddress.php index 4898a7217..4e78d05e6 100644 --- a/core/lib/Thelia/Core/Template/Loop/OrderAddress.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderAddress.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php b/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php index 264d7be4e..25bf4a614 100644 --- a/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/OrderProduct.php b/core/lib/Thelia/Core/Template/Loop/OrderProduct.php index 8e201f31c..889f3704e 100644 --- a/core/lib/Thelia/Core/Template/Loop/OrderProduct.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderProduct.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php index bb018ec98..881714553 100644 --- a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/OrderStatus.php b/core/lib/Thelia/Core/Template/Loop/OrderStatus.php index f45a1d99b..0fe1d29d1 100644 --- a/core/lib/Thelia/Core/Template/Loop/OrderStatus.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderStatus.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Payment.php b/core/lib/Thelia/Core/Template/Loop/Payment.php index 20a387e0e..af43b9ff0 100644 --- a/core/lib/Thelia/Core/Template/Loop/Payment.php +++ b/core/lib/Thelia/Core/Template/Loop/Payment.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index 8bcf76e4d..70348626b 100644 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -83,6 +72,7 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL Argument::createIntTypeArgument('min_stock'), Argument::createFloatTypeArgument('min_weight'), Argument::createFloatTypeArgument('max_weight'), + Argument::createBooleanTypeArgument('with_prev_next_info', false), Argument::createBooleanTypeArgument('current'), Argument::createBooleanTypeArgument('current_category'), Argument::createIntTypeArgument('depth', 1), @@ -467,12 +457,19 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL } $taxCountry = $this->container->get('thelia.taxEngine')->getDeliveryCountry(); + /** @var \Thelia\Core\Security\SecurityContext $securityContext */ + $securityContext = $this->container->get('thelia.securityContext'); foreach ($loopResult->getResultDataCollection() as $product) { $loopResultRow = new LoopResultRow($product); $price = $product->getVirtualColumn('price'); + + if ($securityContext->hasCustomerUser() && $securityContext->getCustomerUser()->getDiscount() > 0) { + $price = $price * (1-($securityContext->getCustomerUser()->getDiscount()/100)); + } + try { $taxedPrice = $product->getTaxedPrice( $taxCountry, @@ -482,6 +479,10 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL $taxedPrice = null; } $promoPrice = $product->getVirtualColumn('promo_price'); + + if ($securityContext->hasCustomerUser() && $securityContext->getCustomerUser()->getDiscount() > 0) { + $promoPrice = $promoPrice * (1-($securityContext->getCustomerUser()->getDiscount()/100)); + } try { $taxedPromoPrice = $product->getTaxedPromoPrice( $taxCountry, @@ -494,35 +495,10 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL // Find previous and next product, in the default category. $default_category_id = $product->getDefaultCategoryId(); - $previous = ProductQuery::create() - ->joinProductCategory() - ->where('ProductCategory.category_id = ?', $default_category_id) - ->filterByPosition($product->getPosition(), Criteria::LESS_THAN) - ->orderByPosition(Criteria::DESC) - ->findOne() - ; - - $next = ProductQuery::create() - ->joinProductCategory() - ->where('ProductCategory.category_id = ?', $default_category_id) - ->filterByPosition($product->getPosition(), Criteria::GREATER_THAN) - ->orderByPosition(Criteria::ASC) - ->findOne() - ; - $loopResultRow - ->set("ID" , $product->getId()) - ->set("REF" , $product->getRef()) - ->set("IS_TRANSLATED" , $product->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE" , $this->locale) - ->set("TITLE" , $product->getVirtualColumn('i18n_TITLE')) - ->set("CHAPO" , $product->getVirtualColumn('i18n_CHAPO')) - ->set("DESCRIPTION" , $product->getVirtualColumn('i18n_DESCRIPTION')) - ->set("POSTSCRIPTUM" , $product->getVirtualColumn('i18n_POSTSCRIPTUM')) - ->set("URL" , $product->getUrl($this->locale)) - ->set("META_TITLE" , $product->getVirtualColumn('i18n_META_TITLE')) - ->set("META_DESCRIPTION" , $product->getVirtualColumn('i18n_META_DESCRIPTION')) - ->set("META_KEYWORDS" , $product->getVirtualColumn('i18n_META_KEYWORDS')) + ->set("WEIGHT" , $product->getVirtualColumn('weight')) + ->set("QUANTITY" , $product->getVirtualColumn('quantity')) + ->set("EAN_CODE" , $product->getVirtualColumn('ean_code')) ->set("BEST_PRICE" , $product->getVirtualColumn('is_promo') ? $promoPrice : $price) ->set("BEST_PRICE_TAX" , $taxedPrice - $product->getVirtualColumn('is_promo') ? $taxedPromoPrice - $promoPrice : $taxedPrice - $price) ->set("BEST_TAXED_PRICE" , $product->getVirtualColumn('is_promo') ? $taxedPromoPrice : $taxedPrice) @@ -532,25 +508,13 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL ->set("PROMO_PRICE" , $promoPrice) ->set("PROMO_PRICE_TAX" , $taxedPromoPrice - $promoPrice) ->set("TAXED_PROMO_PRICE" , $taxedPromoPrice) - ->set("PRODUCT_SALE_ELEMENT" , $product->getVirtualColumn('pse_id')) - ->set("WEIGHT" , $product->getVirtualColumn('weight')) - ->set("QUANTITY" , $product->getVirtualColumn('quantity')) - ->set("EAN_CODE" , $product->getVirtualColumn('ean_code')) ->set("IS_PROMO" , $product->getVirtualColumn('is_promo')) ->set("IS_NEW" , $product->getVirtualColumn('is_new')) - ->set("POSITION" , $product->getPosition()) - ->set("VISIBLE" , $product->getVisible() ? "1" : "0") - ->set("TEMPLATE" , $product->getTemplateId()) - ->set("HAS_PREVIOUS" , $previous != null ? 1 : 0) - ->set("HAS_NEXT" , $next != null ? 1 : 0) - ->set("PREVIOUS" , $previous != null ? $previous->getId() : -1) - ->set("NEXT" , $next != null ? $next->getId() : -1) - ->set("DEFAULT_CATEGORY" , $default_category_id) - ->set("TAX_RULE_ID" , $product->getTaxRuleId()) ; - $loopResult->addRow($loopResultRow); + + $loopResult->addRow($this->associateValues($loopResultRow, $product, $default_category_id)); } return $loopResult; @@ -985,6 +949,8 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL $loopResult = new LoopResult($results); $taxCountry = $this->container->get('thelia.taxEngine')->getDeliveryCountry(); + /** @var \Thelia\Core\Security\SecurityContext $securityContext */ + $securityContext = $this->container->get('thelia.securityContext'); foreach ($loopResult->getResultDataCollection() as $product) { @@ -992,10 +958,14 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL $price = $product->getRealLowestPrice(); + if ($securityContext->hasCustomerUser() && $securityContext->getCustomerUser()->getDiscount() > 0) { + $price = $price * (1-($securityContext->getCustomerUser()->getDiscount()/100)); + } + try { $taxedPrice = $product->getTaxedPrice( $taxCountry, - $product->getRealLowestPrice() + $price ); } catch (TaxEngineException $e) { $taxedPrice = null; @@ -1004,6 +974,48 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL // Find previous and next product, in the default category. $default_category_id = $product->getDefaultCategoryId(); + $loopResultRow + ->set("BEST_PRICE" , $price) + ->set("BEST_PRICE_TAX" , $taxedPrice - $price) + ->set("BEST_TAXED_PRICE" , $taxedPrice) + ->set("IS_PROMO" , $product->getVirtualColumn('is_promo')) + ->set("IS_NEW" , $product->getVirtualColumn('is_new')) + ; + + + $loopResult->addRow($this->associateValues($loopResultRow, $product, $default_category_id)); + } + + return $loopResult; + } + + private function associateValues($loopResultRow, $product, $default_category_id) + { + $loopResultRow + ->set("ID" , $product->getId()) + ->set("REF" , $product->getRef()) + ->set("IS_TRANSLATED" , $product->getVirtualColumn('IS_TRANSLATED')) + ->set("LOCALE" , $this->locale) + ->set("TITLE" , $product->getVirtualColumn('i18n_TITLE')) + ->set("CHAPO" , $product->getVirtualColumn('i18n_CHAPO')) + ->set("DESCRIPTION" , $product->getVirtualColumn('i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM" , $product->getVirtualColumn('i18n_POSTSCRIPTUM')) + ->set("URL" , $product->getUrl($this->locale)) + ->set("META_TITLE" , $product->getVirtualColumn('i18n_META_TITLE')) + ->set("META_DESCRIPTION" , $product->getVirtualColumn('i18n_META_DESCRIPTION')) + ->set("META_KEYWORDS" , $product->getVirtualColumn('i18n_META_KEYWORDS')) + ->set("PRODUCT_SALE_ELEMENT" , $product->getVirtualColumn('pse_id')) + ->set("POSITION" , $product->getPosition()) + ->set("VISIBLE" , $product->getVisible() ? "1" : "0") + ->set("TEMPLATE" , $product->getTemplateId()) + ->set("DEFAULT_CATEGORY" , $default_category_id) + ->set("TAX_RULE_ID" , $product->getTaxRuleId()) + + ; + + + if ($this->getBackend_context() || $this->getWithPrevNextInfo()) { + // Find previous and next category $previous = ProductQuery::create() ->joinProductCategory() ->where('ProductCategory.category_id = ?', $default_category_id) @@ -1021,39 +1033,14 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL ; $loopResultRow - ->set("ID" , $product->getId()) - ->set("REF" , $product->getRef()) - ->set("IS_TRANSLATED" , $product->getVirtualColumn('IS_TRANSLATED')) - ->set("LOCALE" , $this->locale) - ->set("TITLE" , $product->getVirtualColumn('i18n_TITLE')) - ->set("CHAPO" , $product->getVirtualColumn('i18n_CHAPO')) - ->set("DESCRIPTION" , $product->getVirtualColumn('i18n_DESCRIPTION')) - ->set("POSTSCRIPTUM" , $product->getVirtualColumn('i18n_POSTSCRIPTUM')) - ->set("URL" , $product->getUrl($this->locale)) - ->set("META_TITLE" , $product->getVirtualColumn('i18n_META_TITLE')) - ->set("META_DESCRIPTION" , $product->getVirtualColumn('i18n_META_DESCRIPTION')) - ->set("META_KEYWORDS" , $product->getVirtualColumn('i18n_META_KEYWORDS')) - ->set("BEST_PRICE" , $price) - ->set("BEST_PRICE_TAX" , $taxedPrice - $price) - ->set("BEST_TAXED_PRICE" , $taxedPrice) - ->set("IS_PROMO" , $product->getVirtualColumn('main_product_is_promo')) - ->set("IS_NEW" , $product->getVirtualColumn('main_product_is_new')) - ->set("POSITION" , $product->getPosition()) - ->set("VISIBLE" , $product->getVisible() ? "1" : "0") - ->set("TEMPLATE" , $product->getTemplateId()) ->set("HAS_PREVIOUS" , $previous != null ? 1 : 0) ->set("HAS_NEXT" , $next != null ? 1 : 0) ->set("PREVIOUS" , $previous != null ? $previous->getId() : -1) ->set("NEXT" , $next != null ? $next->getId() : -1) - ->set("DEFAULT_CATEGORY" , $default_category_id) - ->set("TAX_RULE_ID" , $product->getTaxRuleId()) - ; - - $loopResult->addRow($loopResultRow); } - return $loopResult; + return $loopResultRow; } protected function manageFeatureAv(&$search, $feature_availability) diff --git a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php index e873faaf2..78e740d61 100644 --- a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php +++ b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; @@ -146,22 +135,34 @@ class ProductSaleElements extends BaseLoop implements PropelSearchLoopInterface public function parseResults(LoopResult $loopResult) { $taxCountry = $this->container->get('thelia.taxEngine')->getDeliveryCountry(); + /** @var \Thelia\Core\Security\SecurityContext $securityContext */ + $securityContext = $this->container->get('thelia.securityContext'); + $discount = 0; + + if ($securityContext->hasCustomerUser() && $securityContext->getCustomerUser()->getDiscount() > 0) { + $discount = $securityContext->getCustomerUser()->getDiscount(); + } foreach ($loopResult->getResultDataCollection() as $PSEValue) { $loopResultRow = new LoopResultRow($PSEValue); - $price = $PSEValue->getPrice(); + $price = $PSEValue->getPrice('price_PRICE', $discount); try { $taxedPrice = $PSEValue->getTaxedPrice( - $taxCountry + $taxCountry, + 'price_PRICE', + $discount ); } catch (TaxEngineException $e) { $taxedPrice = null; } - $promoPrice = $PSEValue->getPromoPrice(); + + $promoPrice = $PSEValue->getPromoPrice('price_PROMO_PRICE', $discount); try { $taxedPromoPrice = $PSEValue->getTaxedPromoPrice( - $taxCountry + $taxCountry, + 'price_PROMO_PRICE', + $discount ); } catch (TaxEngineException $e) { $taxedPromoPrice = null; diff --git a/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php b/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php index 41c8c00ed..362cbe284 100644 --- a/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php +++ b/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Profile.php b/core/lib/Thelia/Core/Template/Loop/Profile.php index 8b21d2fe0..fc9c5ce3a 100644 --- a/core/lib/Thelia/Core/Template/Loop/Profile.php +++ b/core/lib/Thelia/Core/Template/Loop/Profile.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Resource.php b/core/lib/Thelia/Core/Template/Loop/Resource.php index d1975d73f..eebbfb9a2 100644 --- a/core/lib/Thelia/Core/Template/Loop/Resource.php +++ b/core/lib/Thelia/Core/Template/Loop/Resource.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Tax.php b/core/lib/Thelia/Core/Template/Loop/Tax.php index 40c6e1cf3..cbee32be0 100644 --- a/core/lib/Thelia/Core/Template/Loop/Tax.php +++ b/core/lib/Thelia/Core/Template/Loop/Tax.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/TaxRule.php b/core/lib/Thelia/Core/Template/Loop/TaxRule.php index be90cc5ac..c3b2b11a6 100644 --- a/core/lib/Thelia/Core/Template/Loop/TaxRule.php +++ b/core/lib/Thelia/Core/Template/Loop/TaxRule.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php b/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php index 0c32a51df..d90cd11d9 100644 --- a/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php +++ b/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Template.php b/core/lib/Thelia/Core/Template/Loop/Template.php index e6cf47288..1ce42ae4e 100644 --- a/core/lib/Thelia/Core/Template/Loop/Template.php +++ b/core/lib/Thelia/Core/Template/Loop/Template.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/Loop/Title.php b/core/lib/Thelia/Core/Template/Loop/Title.php index 51d482892..856e3ab77 100644 --- a/core/lib/Thelia/Core/Template/Loop/Title.php +++ b/core/lib/Thelia/Core/Template/Loop/Title.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; diff --git a/core/lib/Thelia/Core/Template/ParserContext.php b/core/lib/Thelia/Core/Template/ParserContext.php index 9e676da89..07642ce7c 100644 --- a/core/lib/Thelia/Core/Template/ParserContext.php +++ b/core/lib/Thelia/Core/Template/ParserContext.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template; diff --git a/core/lib/Thelia/Core/Template/ParserInterface.php b/core/lib/Thelia/Core/Template/ParserInterface.php index 9ec99360c..0c32bd4ef 100644 --- a/core/lib/Thelia/Core/Template/ParserInterface.php +++ b/core/lib/Thelia/Core/Template/ParserInterface.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\Template; /** @@ -38,6 +28,13 @@ interface ParserInterface public function setStatus($status); + /** + * Setup the parser with a template definition, which provides a template description. + * + * @param TemplateDefinition $templateDefinition + */ + public function setTemplateDefinition(TemplateDefinition $templateDefinition); + /** * Add a template directory to the current template list * @@ -53,17 +50,17 @@ interface ParserInterface /** * Return the registeted template directories for a givent template type * - * @param unknown $templateType - * @throws InvalidArgumentException if the tempmateType is not defined - * @return array: an array of defined templates directories for the given template type + * @param unknown $templateType + * @throws \InvalidArgumentException if the templateType is not defined + * @return array: an array of defined templates directories for the given template type */ public function getTemplateDirectories($templateType); /** * Create a variable that will be available in the templates * - * @param $variable the vatiable name - * @param $value the value of the variable + * @param string $variable the variable name + * @param mixed $value the value of the variable */ public function assign($variable, $value); } diff --git a/core/lib/Thelia/Core/Template/Smarty/AbstractSmartyPlugin.php b/core/lib/Thelia/Core/Template/Smarty/AbstractSmartyPlugin.php index 611be2dbe..6bf8b4ec9 100644 --- a/core/lib/Thelia/Core/Template/Smarty/AbstractSmartyPlugin.php +++ b/core/lib/Thelia/Core/Template/Smarty/AbstractSmartyPlugin.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty; diff --git a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php index c175618cc..5974ef3db 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php +++ b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php @@ -1,28 +1,18 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Assets; +use Thelia\Log\Tlog; use Thelia\Tools\URL; use Thelia\Core\Template\Assets\AssetManagerInterface; @@ -119,6 +109,27 @@ class SmartyAssetsManager $templateDirectories = $smartyParser->getTemplateDirectories($templateDefinition->getType()); + // if it's not a custom template and looking for a different origin (e.g. module) + // we first check if the asset is present in the default "source" (template) + // if not we take the default asset from the assetOrigin (module) + if (! $webAssetTemplate && $assetOrigin !== "0") { + if (isset($templateDirectories[$templateDefinition->getName()]["0"])) { + if (file_exists($templateDirectories[$templateDefinition->getName()]["0"] . DS . $file)) { + // the file exists, we take the default origin + $assetOrigin = "0"; + } + } + } + + if (! isset($templateDirectories[$templateDefinition->getName()][$assetOrigin])) { + // we try with the default origin + if (! $webAssetTemplate && $assetOrigin !== "0") { + $assetOrigin = "0"; + } else { + throw new \Exception("Failed to get real path of '/".dirname($file)."'"); + } + } + if (! isset($templateDirectories[$templateDefinition->getName()][$assetOrigin])) { throw new \Exception("Failed to get real path of '/".dirname($file)."'"); } @@ -130,17 +141,21 @@ class SmartyAssetsManager $file = str_replace('/', DS, $file); } - $url = $this->assetsManager->processAsset( - $assetSource . DS . $file, - $assetSource . DS . self::$assetsDirectory, - $this->web_root . $this->path_relative_to_web_root, - $templateDefinition->getPath(), - $assetOrigin, - URL::getInstance()->absoluteUrl($this->path_relative_to_web_root, null, URL::PATH_TO_FILE /* path only */), - $assetType, - $filters, - $debug - ); + $url = ""; + // test if file exists before running the process + if (file_exists($assetSource . DS . $file)) { + $url = $this->assetsManager->processAsset( + $assetSource . DS . $file, + $assetSource . DS . self::$assetsDirectory, + $this->web_root . $this->path_relative_to_web_root, + $templateDefinition->getPath(), + $assetOrigin, + URL::getInstance()->absoluteUrl($this->path_relative_to_web_root, null, URL::PATH_TO_FILE /* path only */), + $assetType, + $filters, + $debug + ); + } return $url; } @@ -149,10 +164,13 @@ class SmartyAssetsManager { // Opening tag (first call only) if ($repeat) { - $url = $this->computeAssetUrl($assetType, $params, $template); - + $url = ""; + try { + $url = $this->computeAssetUrl($assetType, $params, $template); + } catch (\Exception $ex) { + Tlog::getInstance()->addWarning("Failed to get real path of " . $params['file']); + } $template->assign('asset_url', $url); - } elseif (isset($content)) { return $content; } diff --git a/core/lib/Thelia/Core/Template/Smarty/Exception/SmartyPluginException.php b/core/lib/Thelia/Core/Template/Smarty/Exception/SmartyPluginException.php index 77efa2d17..8ef8ca86d 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Exception/SmartyPluginException.php +++ b/core/lib/Thelia/Core/Template/Smarty/Exception/SmartyPluginException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Exception; diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php index 283a4c6cf..47fb45d8d 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Plugins; @@ -91,8 +80,8 @@ class AdminUtilities extends AbstractSmartyPlugin */ - if ($permissions == null || $this->securityContext->isGranted( - "ADMIN", + if ($this->securityContext->isGranted( + array("ADMIN"), $resource === null ? array() : array($resource), $module === null ? array() : array($module), array($access)) diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php index e4a5c866f..bc2107f8d 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Plugins; diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/CartPostage.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/CartPostage.php new file mode 100644 index 000000000..9bf98dd43 --- /dev/null +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/CartPostage.php @@ -0,0 +1,208 @@ +container = $container; + + $this->request = $container->get('request'); + } + + /** + * Get postage amount for cart + * + * @param array $params Block parameters + * @param mixed $content Block content + * @param \Smarty_Internal_Template $template Template + * @param bool $repeat Control how many times + * the block is displayed + * + * @return mixed + */ + public function postage($params, $content, $template, &$repeat) + { + + if (! $repeat) { + return (null !== $this->countryId) ? $content : ""; + } + + $customer = $this->request->getSession()->getCustomerUser(); + $country = $this->getDeliveryCountry($customer); + + if (null !== $country) { + $this->countryId = $country->getId(); + // try to get the cheapest delivery for this country + $this->getCheapestDelivery($country); + } + + $template->assign('country_id', $this->countryId); + $template->assign('delivery_id', $this->deliveryId); + $template->assign('postage', $this->postage ?: 0.0); + $template->assign('is_customizable', $this->isCustomizable); + } + + /** + * Retrieve the delivery country for a customer + * + * The rules : + * - the country of the delivery address of the customer related to the + * cart if it exists + * - the country saved in cookie if customer have changed + * the default country + * - the default country for the shop if it exists + * + * + * @param \Thelia\Model\Customer $customer + * @return \Thelia\Model\Country + */ + protected function getDeliveryCountry(Customer $customer = null) + { + + // get country from customer addresses + if (null !== $customer) { + $address = AddressQuery::create() + ->filterByCustomerId($customer->getId()) + ->filterByIsDefault(1) + ->findOne() + ; + + if (null !== $address) { + $this->isCustomizable = false; + + return $address->getCountry(); + } + } + + // get country from cookie + $cookieName = ConfigQuery::read('front_cart_country_cookie_name', 'fcccn'); + if ($this->request->cookies->has($cookieName)) { + $cookieVal = $this->request->cookies->getInt($cookieName, 0); + if (0 !== $cookieVal) { + $country = CountryQuery::create()->findPk($cookieVal); + if (null !== $country) { + return $country; + } + } + } + + // get default country for store. + try { + $country = Country::getDefaultCountry(); + + return $country; + } catch (\LogicException $e) { + ; + } + + return null; + + } + + /** + * Retrieve the cheapest delivery for country + * + * @param \Thelia\Model\Country $country + * @return DeliveryModuleInterface + */ + protected function getCheapestDelivery(Country $country) + { + + $deliveryModules = ModuleQuery::create() + ->filterByActivate(1) + ->filterByType(BaseModule::DELIVERY_MODULE_TYPE, Criteria::EQUAL) + ->find(); + ; + + foreach ($deliveryModules as $deliveryModule) { + + /** @var DeliveryModuleInterface $moduleInstance */ + $moduleInstance = $this->container->get(sprintf('module.%s', $deliveryModule->getCode())); + + if (false === $moduleInstance instanceof DeliveryModuleInterface) { + throw new \RuntimeException(sprintf("delivery module %s is not a Thelia\Module\DeliveryModuleInterface", $deliveryModule->getCode())); + } + + try { + // Check if module is valid, by calling isValidDelivery(), + // or catching a DeliveryException. + if ($moduleInstance->isValidDelivery($country)) { + + $postage = $moduleInstance->getPostage($country); + if (null === $this->postage || $this->postage > $postage) { + $this->postage = $postage; + $this->deliveryId = $deliveryModule->getId(); + } + } + } catch (DeliveryException $ex) { + // Module is not available + } + + } + + } + + /** + * Defines the various smarty plugins handled by this class + * + * @return SmartyPluginDescriptor[] smarty plugin descriptors + */ + public function getPluginDescriptors() + { + return array( + new SmartyPluginDescriptor('block', 'postage', $this, 'postage') + ); + } +} diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php index d12d8639a..d439e7d63 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Plugins; diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php index cfa3788bd..0177047f3 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Plugins; diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/FlashMessage.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/FlashMessage.php index e89898af6..f6d6f7bc1 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/FlashMessage.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/FlashMessage.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\Template\Smarty\Plugins; use Symfony\Component\HttpFoundation\Request; diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php index 92ad357f2..9fe5d2581 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\Template\Smarty\Plugins; use Symfony\Component\Form\FormView; @@ -127,16 +117,24 @@ class Form extends AbstractSmartyPlugin } } - protected function assignFieldValues($template, $fieldName, $fieldValue, $fieldVars, $total_value_count = 1) + protected function assignFieldValues( + $template, + $fieldName, + $fieldValue, + $fieldType, + $fieldVars, + $total_value_count = 1 + ) { $template->assign("name", $fieldName); - $template->assign("value", $fieldValue); + $template->assign("data", $fieldVars['data']); + + $template->assign("type", $fieldType); $template->assign("checked", isset($fieldVars['checked']) ? $fieldVars['checked'] : false); - - //data - $template->assign("data", $fieldVars['data']); + $template->assign("choices", isset($fieldVars['choices']) ? $fieldVars['choices'] : false); + $template->assign("multiple", isset($fieldVars['multiple']) ? $fieldVars['multiple'] : false); $template->assign("label", $fieldVars["label"]); $template->assign("label_attr", $fieldVars["label_attr"]); @@ -211,6 +209,8 @@ class Form extends AbstractSmartyPlugin $formFieldView = $this->getFormFieldView($params); $formFieldConfig = $this->getFormFieldConfig($params); + $formFieldType = $formFieldConfig->getType()->getName(); + $this->assignFormTypeValues($template, $formFieldConfig, $formFieldView); $value = $formFieldView->vars["value"]; @@ -230,9 +230,22 @@ class Form extends AbstractSmartyPlugin $val = $value[$key]; - $this->assignFieldValues($template, $name, $val, $formFieldView->vars, count($formFieldView->children)); + $this->assignFieldValues( + $template, + $name, + $val, + $formFieldType, + $formFieldView->vars, + count($formFieldView->children) + ); } else { - $this->assignFieldValues($template, $formFieldView->vars["full_name"], $formFieldView->vars["value"], $formFieldView->vars); + $this->assignFieldValues( + $template, + $formFieldView->vars["full_name"], + $formFieldView->vars["value"], + $formFieldType, + $formFieldView->vars + ); } $formFieldView->setRendered(); @@ -251,16 +264,20 @@ class Form extends AbstractSmartyPlugin } if (isset(self::$taggedFieldsStack[self::$taggedFieldsStackPosition])) { + + $field = self::$taggedFieldsStack[self::$taggedFieldsStackPosition]; + $this->assignFieldValues( $template, - self::$taggedFieldsStack[self::$taggedFieldsStackPosition]['view']->vars["full_name"], - self::$taggedFieldsStack[self::$taggedFieldsStackPosition]['view']->vars["value"], - self::$taggedFieldsStack[self::$taggedFieldsStackPosition]['view']->vars + $field['view']->vars["full_name"], + $field['view']->vars["value"], + $field['config']->getType()->getName(), + $field['view']->vars ); - $this->assignFormTypeValues($template, self::$taggedFieldsStack[self::$taggedFieldsStackPosition]['config'], self::$taggedFieldsStack[self::$taggedFieldsStackPosition]['view']); + $this->assignFormTypeValues($template, $field['config'], $field['view']); - self::$taggedFieldsStack[self::$taggedFieldsStackPosition]['view']->setRendered(); + $field['view']->setRendered(); $repeat = true; } diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php index f022cf0c5..372f74d3f 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Plugins; diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php index a66a1ed03..c067e32a1 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Plugins; @@ -63,43 +52,47 @@ class Module extends AbstractSmartyPlugin public function theliaModule($params, \Smarty_Internal_Template $template) { $content = null; - + $count = 0; if (false !== $location = $this->getParam($params, 'location', false)) { if ($this->debug === true && $this->request->get('SHOW_INCLUDE')) { - echo sprintf('
%s
', $location); + echo sprintf('
%s
', $location); } $moduleLimit = $this->getParam($params, 'module', null); $modules = ModuleQuery::getActivated(); - $count = 0; - + /** @var \Thelia\Model\Module $module */ foreach ($modules as $module) { if (null !== $moduleLimit && $moduleLimit != $module->getCode()) { continue; } - $file = sprintf("%s/AdminIncludes/%s.html", $module->getAbsoluteBaseDir(), $location); + $file = $module->getAbsoluteAdminIncludesPath() . DS . $location . '.html'; if (file_exists($file)) { - $content .= file_get_contents($file); - $count++; + $output = trim(file_get_contents($file)); + + if (! empty($output)) { + $content .= $output; + + $count++; + } } } } - if (! empty($content)) { - return $template->fetch(sprintf("string:%s", $content)); - } - if (false !== $countvarname = $this->getParam($params, 'countvar', false)) { $template->assign($countvarname, $count); } + if (! empty($content)) { + return $template->fetch(sprintf("string:%s", $content)); + } + return ""; } diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Security.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Security.php index 9db8e90fe..85ebb4257 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Security.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Security.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Plugins; @@ -61,8 +50,8 @@ class Security extends AbstractSmartyPlugin if (! $this->securityContext->isGranted($roles, $resources, $modules, $accesses)) { $ex = new AuthenticationException( - sprintf("User not granted for roles '%s', to access resources '%s' with %s in context '%s'.", - implode(',', $roles), implode(',', $resources), implode(',', $accesses), $context + sprintf("User not granted for roles '%s', to access resources '%s' with %s.", + implode(',', $roles), implode(',', $resources), implode(',', $accesses) ) ); diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php index e6a795de9..dfc31e3fd 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php @@ -1,38 +1,31 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Plugins; +use Propel\Runtime\Util\PropelModelPager; use Symfony\Component\DependencyInjection\ContainerInterface; use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Core\Template\Smarty\SmartyPluginDescriptor; use Thelia\Core\Template\Element\Exception\ElementNotFoundException; use Thelia\Core\Template\Element\Exception\InvalidElementException; +use Thelia\Core\Translation\Translator; class TheliaLoop extends AbstractSmartyPlugin { + /** @var PropelModelPager[] */ protected static $pagination = null; protected $loopDefinition = array(); @@ -41,10 +34,15 @@ class TheliaLoop extends AbstractSmartyPlugin protected $dispatcher; protected $securityContext; + /** @var Translator */ + protected $translator; + /** @var ContainerInterface Service Container */ protected $container = null; + /** @var LoopResult[] */ protected $loopstack = array(); + protected $varstack = array(); /** @@ -57,31 +55,43 @@ class TheliaLoop extends AbstractSmartyPlugin $this->request = $container->get('request'); $this->dispatcher = $container->get('event_dispatcher'); $this->securityContext = $container->get('thelia.securityContext'); + $this->translator = $container->get("thelia.translator"); } /** - * @param $loopId - * - * @return \PropelModelPager + * @param string $loopName + * @return PropelModelPager + * @throws \InvalidArgumentException if no pagination was found for loop */ public static function getPagination($loopName) { if (array_key_exists($loopName, self::$pagination)) { return self::$pagination[$loopName]; } else { - throw new \InvalidArgumentException("Loop $loopName is not defined"); + throw new \InvalidArgumentException( + Translator::getInstance()->trans("No pagination currently defined for loop name '%name'", ['%name' => $loopName ]) + ); } } /** * Process the count function: executes a loop and return the number of items found + * + * @param array $params parameters array + * @param \Smarty_Internal_Template $template + * + * @return int the item count + * @throws \InvalidArgumentException if a parameter is missing + * */ - public function theliaCount($params, $template) + public function theliaCount($params, /** @noinspection PhpUnusedParameterInspection */ $template) { $type = $this->getParam($params, 'type'); if (null == $type) { - throw new \InvalidArgumentException("Missing 'type' parameter in count arguments"); + throw new \InvalidArgumentException( + $this->translator->trans("Missing 'type' parameter in {count} loop arguments") + ); } $loop = $this->createLoopInstance($params); @@ -94,31 +104,39 @@ class TheliaLoop extends AbstractSmartyPlugin /** * Process {loop name="loop name" type="loop type" ... } ... {/loop} block * - * @param unknown $params - * @param unknown $content - * @param unknown $template - * @param unknown $repeat + * @param array $params + * @param string $content + * @param \Smarty_Internal_Template $template + * @param boolean $repeat + * * @throws \InvalidArgumentException - * @return string + * + * @return void|string */ public function theliaLoop($params, $content, $template, &$repeat) { $name = $this->getParam($params, 'name'); if (null == $name) { - throw new \InvalidArgumentException("Missing 'name' parameter in loop arguments"); + throw new \InvalidArgumentException( + $this->translator->trans("Missing 'name' parameter in loop arguments") + ); } $type = $this->getParam($params, 'type'); if (null == $type) { - throw new \InvalidArgumentException("Missing 'type' parameter in loop arguments"); + throw new \InvalidArgumentException( + $this->translator->trans("Missing 'type' parameter in loop arguments") + ); } if ($content === null) { // Check if a loop with the same name exists in the current scope, and abort if it's the case. if (array_key_exists($name, $this->varstack)) { - throw new \InvalidArgumentException("A loop named '$name' already exists in the current scope."); + throw new \InvalidArgumentException( + $this->translator->trans("A loop named '%name' already exists in the current scope.", ['%name' => $name]) + ); } $loop = $this->createLoopInstance($params); @@ -131,7 +149,7 @@ class TheliaLoop extends AbstractSmartyPlugin $this->loopstack[$name] = $loopResults; - // Pas de résultat ? la boucle est terminée, ne pas évaluer le contenu. + // No results ? The loop is terminated, do not evaluate loop text. if ($loopResults->isEmpty()) $repeat = false; } else { @@ -184,52 +202,56 @@ class TheliaLoop extends AbstractSmartyPlugin return $content; } + + return ''; } /** * Process {elseloop rel="loopname"} ... {/elseloop} block * - * @param unknown $params - * @param unknown $content - * @param unknown $template - * @param unknown $repeat - * @return Ambigous + * @param array $params loop parameters + * @param string $content loop text content + * @param \Smarty_Internal_Template $template the Smarty object + * @param boolean $repeat repeat indicator (see Smarty doc.) + * @return string the loop output */ - public function theliaElseloop($params, $content, $template, &$repeat) + public function theliaElseloop($params, $content, /** @noinspection PhpUnusedParameterInspection */ $template, &$repeat) { - - // When encoutering close tag, check if loop has results. + // When encountering close tag, check if loop has results. if ($repeat === false) { - return $this->checkEmptyLoop($params, $template) ? $content : ''; + return $this->checkEmptyLoop($params) ? $content : ''; } + + return ''; } /** * Process {ifloop rel="loopname"} ... {/ifloop} block * - * @param unknown $params - * @param unknown $content - * @param unknown $template - * @param unknown $repeat - * @return Ambigous + * @param array $params loop parameters + * @param string $content loop text content + * @param \Smarty_Internal_Template $template the Smarty object + * @param boolean $repeat repeat indicator (see Smarty doc.) + * @return string the loop output */ - public function theliaIfLoop($params, $content, $template, &$repeat) + public function theliaIfLoop($params, $content, /** @noinspection PhpUnusedParameterInspection */ $template, &$repeat) { // When encountering close tag, check if loop has results. if ($repeat === false) { - return $this->checkEmptyLoop($params, $template) ? '' : $content; + return $this->checkEmptyLoop($params) ? '' : $content; } + + return ''; } /** * Process {pageloop rel="loopname"} ... {/pageloop} block * - * @param $params - * @param $content - * @param $template - * @param $repeat - * - * @return string + * @param array $params loop parameters + * @param string $content loop text content + * @param \Smarty_Internal_Template $template the Smarty object + * @param boolean $repeat repeat indicator (see Smarty doc.) + * @return string the loop output * @throws \InvalidArgumentException */ public function theliaPageLoop($params, $content, $template, &$repeat) @@ -237,73 +259,102 @@ class TheliaLoop extends AbstractSmartyPlugin $loopName = $this->getParam($params, 'rel'); if (null == $loopName) - throw new \InvalidArgumentException("Missing 'rel' parameter in page loop"); + throw new \InvalidArgumentException($this->translator->trans("Missing 'rel' parameter in page loop")); // Find pagination $pagination = self::getPagination($loopName); - if ($pagination === null) { // loop has no result + if ($pagination === null || $pagination->getNbResults() == 0) { + // No need to paginate return ''; } - if ($pagination->getNbResults() == 0) { - return ''; - } + $startPage = intval($this->getParam($params, 'start-page', 1)); + $displayedPageCount = intval($this->getParam($params, 'limit', 10)); - $nbPage = $this->getParam($params, 'numPage', 10); - $maxPage = $pagination->getLastPage(); + if (intval($displayedPageCount) == 0) $displayedPageCount = PHP_INT_MAX; + $totalPageCount = $pagination->getLastPage(); if ($content === null) { - $page = $pagination->getPage(); - if ($maxPage > ($page + $nbPage)) { - $end = $page + $nbPage; - } else { - $end = $maxPage; + + // The current page + $currentPage = $pagination->getPage(); + + // Get the start page. + if ($totalPageCount > $displayedPageCount) { + $startPage = $currentPage - round($displayedPageCount / 2); + + if ($startPage < 0) $startPage = 1; } - $template->assign('PREV', $page > 1 ? $page-1: $page); - $template->assign('NEXT', $page < $maxPage ? $page+1 : $maxPage); - $template->assign('END', $end); - $template->assign('LAST', $pagination->getLastPage()); + + // This is the iterative page number, the one we're going to increment in this loop + $iterationPage = $startPage; + + // The last displayed page number + $endPage = $startPage + $displayedPageCount - 1; + + if ($endPage > $totalPageCount) { + $endPage = $totalPageCount; + } + + // The first displayed page number + $template->assign('START' , $startPage); + // The previous page number + $template->assign('PREV' , $currentPage > 1 ? $currentPage-1 : $currentPage); + // The next page number + $template->assign('NEXT' , $currentPage < $totalPageCount ? $currentPage+1 : $totalPageCount); + // The last displayed page number + $template->assign('END' , $endPage); + // The overall last page + $template->assign('LAST' , $totalPageCount); } else { - $page = $template->getTemplateVars('PAGE'); - $page++; + $iterationPage = $template->getTemplateVars('PAGE'); + + $iterationPage++; } + if ($iterationPage <= $template->getTemplateVars('END')) { + // The iterative page number + $template->assign('PAGE', $iterationPage); - if ($page <= $template->getTemplateVars('END')) { - $template->assign('PAGE', $page); + // The overall current page number $template->assign('CURRENT', $pagination->getPage()); - $repeat = true; } if ($content !== null) { return $content; } + + return ''; } /** * Check if a loop has returned results. The loop shoud have been executed before, or an * InvalidArgumentException is thrown * - * @param unknown $params - * @param unknown $template + * @param array $params + * + * @return boolean true if the loop is empty * @throws \InvalidArgumentException */ - protected function checkEmptyLoop($params, $template) + protected function checkEmptyLoop($params) { $loopName = $this->getParam($params, 'rel'); if (null == $loopName) - throw new \InvalidArgumentException("Missing 'rel' parameter in ifloop/elseloop arguments"); + throw new \InvalidArgumentException( + $this->translator->trans("Missing 'rel' parameter in ifloop/elseloop arguments") + ); - if (! isset($this->loopstack[$loopName])) { - throw new \InvalidArgumentException("Loop $loopName is not defined."); - } + if (! isset($this->loopstack[$loopName])) + throw new \InvalidArgumentException( + $this->translator->trans("Related loop name '%name'' is not defined.", ['%name' => $loopName]) + ); return $this->loopstack[$loopName]->isEmpty(); } @@ -320,14 +371,16 @@ class TheliaLoop extends AbstractSmartyPlugin $type = strtolower($smartyParams['type']); if (! isset($this->loopDefinition[$type])) { - throw new ElementNotFoundException(sprintf("'%s' loop type does not exists", $type)); + throw new ElementNotFoundException( + $this->translator->trans("Loop type '%type' is not defined.", ['%type' => $type])); } $class = new \ReflectionClass($this->loopDefinition[$type]); if ($class->isSubclassOf("Thelia\Core\Template\Element\BaseLoop") === false) { - throw new InvalidElementException(sprintf("'%s' Loop class should extends Thelia\Core\Template\Element\BaseLoop", - $type)); + throw new InvalidElementException( + $this->translator->trans("'%type' loop class should extends Thelia\Core\Template\Element\BaseLoop", ['%type' => $type]) + ); } $loop = $class->newInstance( @@ -361,7 +414,12 @@ class TheliaLoop extends AbstractSmartyPlugin { foreach ($loopDefinition as $name => $className) { if (array_key_exists($name, $this->loopDefinition)) { - throw new \InvalidArgumentException(sprintf("%s loop name already exists for %s class name", $name, $className)); + throw new \InvalidArgumentException( + $this->translator->trans("The loop name '%name' is already defined in %className class", [ + '%name' => $name, + '%className' => $className + ]) + ); } $this->loopDefinition[$name] = $className; @@ -371,7 +429,7 @@ class TheliaLoop extends AbstractSmartyPlugin /** * Defines the various smarty plugins hendled by this class * - * @return an array of smarty plugin descriptors + * @return SmartyPluginDescriptor[] smarty plugin descriptors */ public function getPluginDescriptors() { diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaSyntax.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaSyntax.php index 268055064..cc087a1e6 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaSyntax.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaSyntax.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core\Template\Smarty\Plugins; use Thelia\Core\Template\Smarty\SmartyPluginDescriptor; diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Translation.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Translation.php index be319b73b..aa66c114f 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Translation.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Translation.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Plugins; @@ -30,41 +19,59 @@ use Symfony\Component\Translation\TranslatorInterface; class Translation extends AbstractSmartyPlugin { protected $translator; + protected $defaultTranslationDomain = ''; public function __construct(TranslatorInterface $translator) { $this->translator = $translator; } + /** + * Set the default translation domain + * + * @param array $params + * @param \Smarty_Internal_Template $smarty + * @return string + */ + public function setDefaultTranslationDomain($params, &$smarty) + { + $this->defaultTranslationDomain = $this->getParam($params, 'domain'); + } + /** * Process translate function * - * @param unknown $params - * @param unknown $smarty + * @param array $params + * @param \Smarty_Internal_Template $smarty * @return string */ public function translate($params, &$smarty) { - // All parameters other than 'l' are supposed to be variables. Build an array of var => value pairs + // All parameters other than 'l' and 'd' are supposed to be variables. Build an array of var => value pairs // and pass it to the translator $vars = array(); foreach ($params as $name => $value) { - if ($name != 'l') $vars["%$name"] = $value; + if ($name != 'l' && $name != 'd') $vars["%$name"] = $value; } - return $this->translator->trans($this->getParam($params, 'l'), $vars); - } + return $this->translator->trans( + $this->getParam($params, 'l'), + $vars, + $this->getParam($params, 'd', $this->defaultTranslationDomain) + ); +} /** - * Define the various smarty plugins hendled by this class + * Define the various smarty plugins handled by this class * - * @return an array of smarty plugin descriptors + * @return SmartyPluginDescriptor[] an array of smarty plugin descriptors */ public function getPluginDescriptors() { return array( new SmartyPluginDescriptor('function', 'intl', $this, 'translate'), + new SmartyPluginDescriptor('function', 'default_translation_domain', $this, 'setDefaultTranslationDomain'), ); } } diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Type.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Type.php index cc42a6b21..b7282c51b 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Type.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Type.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Plugins; diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php index ce6e6eae0..03d605358 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty\Plugins; diff --git a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php index d2450fb43..bcc915018 100644 --- a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php +++ b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php @@ -1,4 +1,14 @@ getTemplate() . '/configs'; - $this->setConfigDir($configDirectory); + $this->addConfigDir($configDirectory, 0); /* add modules template directories */ $this->addTemplateDirectory( @@ -170,6 +180,7 @@ class SmartyParser extends Smarty implements ParserInterface if (isset($this->templateDirectories[$templateDefinition->getType()][$templateDefinition->getName()])) { foreach ($this->templateDirectories[$templateDefinition->getType()][$templateDefinition->getName()] as $key => $directory) { $this->addTemplateDir($directory, $key); + $this->addConfigDir($directory . "/configs", $key); } } } @@ -229,11 +240,28 @@ class SmartyParser extends Smarty implements ParserInterface */ public function render($realTemplateName, array $parameters = array()) { - if (false === $this->templateExists($realTemplateName)) { + if (false === $this->templateExists($realTemplateName) || false === $this->checkTemplate($realTemplateName)) { throw new ResourceNotFoundException(Translator::getInstance()->trans("Template file %file cannot be found.", array('%file' => $realTemplateName))); } return $this->internalRenderer('file', $realTemplateName, $parameters); + + } + + private function checkTemplate($fileName) + { + $templates = $this->getTemplateDir(); + + $found = true; + foreach ($templates as $key => $value) { + $absolutePath = rtrim(realpath(dirname($value.$fileName)), "/"); + $templateDir = rtrim(realpath($value), "/"); + if (!empty($absolutePath) && strpos($absolutePath, $templateDir) !== 0) { + $found = false; + } + } + + return $found; } /** diff --git a/core/lib/Thelia/Core/Template/Smarty/SmartyPluginDescriptor.php b/core/lib/Thelia/Core/Template/Smarty/SmartyPluginDescriptor.php index f3bdbb203..8572528ef 100644 --- a/core/lib/Thelia/Core/Template/Smarty/SmartyPluginDescriptor.php +++ b/core/lib/Thelia/Core/Template/Smarty/SmartyPluginDescriptor.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template\Smarty; diff --git a/core/lib/Thelia/Core/Template/TemplateDefinition.php b/core/lib/Thelia/Core/Template/TemplateDefinition.php index b511414a5..c4e2149b9 100644 --- a/core/lib/Thelia/Core/Template/TemplateDefinition.php +++ b/core/lib/Thelia/Core/Template/TemplateDefinition.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template; @@ -57,6 +46,8 @@ class TemplateDefinition */ protected $type; + protected $translationDomainPrefix; + public function __construct($name, $type) { $this->name = $name; @@ -65,22 +56,32 @@ class TemplateDefinition switch ($type) { case TemplateDefinition::FRONT_OFFICE: $this->path = self::FRONT_OFFICE_SUBDIR . DS . $name; + $this->translationDomainPrefix = 'fo.'; break; case TemplateDefinition::BACK_OFFICE: $this->path = self::BACK_OFFICE_SUBDIR . DS . $name; + $this->translationDomainPrefix = 'bo.'; break; case TemplateDefinition::PDF: $this->path = self::PDF_SUBDIR . DS . $name; + $this->translationDomainPrefix = 'pdf.'; break; case TemplateDefinition::EMAIL: $this->path = self::EMAIL_SUBDIR . DS . $name; + $this->translationDomainPrefix = 'email.'; break; default: $this->path = $name; + $this->translationDomainPrefix = 'generic.'; break; } } + public function getTranslationDomain() + { + return $this->translationDomainPrefix . strtolower($this->getName()); + } + public function getName() { return $this->name; diff --git a/core/lib/Thelia/Core/Template/TemplateHelper.php b/core/lib/Thelia/Core/Template/TemplateHelper.php index 4a5352f0a..ef6737890 100644 --- a/core/lib/Thelia/Core/Template/TemplateHelper.php +++ b/core/lib/Thelia/Core/Template/TemplateHelper.php @@ -1,28 +1,18 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core\Template; +use Symfony\Component\Filesystem\Filesystem; use Thelia\Model\ConfigQuery; use Thelia\Log\Tlog; use Thelia\Core\Translation\Translator; @@ -57,6 +47,31 @@ class TemplateHelper ); } + /** + * Check if a template definition is the current active template + * + * @param TemplateDefinition $tplDefinition + * @return bool true is the given template is the active template + */ + public function isActive(TemplateDefinition $tplDefinition) + { + switch ($tplDefinition->getType()) { + case TemplateDefinition::FRONT_OFFICE: + $tplVar = 'active-front-template'; + break; + case TemplateDefinition::BACK_OFFICE: + $tplVar = 'active-front-template'; + break; + case TemplateDefinition::PDF: + $tplVar = 'active-front-template'; + break; + case TemplateDefinition::EMAIL: + $tplVar = 'active-front-template'; + break; + } + + return $tplDefinition->getName() == ConfigQuery::read($tplVar, 'default'); + } /** * @return TemplateDefinition */ @@ -106,10 +121,11 @@ class TemplateHelper /** * Return a list of existing templates for a given template type * - * @param int $templateType the template type - * @return An array of \Thelia\Core\Template\TemplateDefinition + * @param int $templateType the template type + * @param string the template base (module or core, default to core). + * @return TemplateDefinition[] of \Thelia\Core\Template\TemplateDefinition */ - public function getList($templateType) + public function getList($templateType, $base = THELIA_TEMPLATE_DIR) { $list = $exclude = array(); @@ -119,24 +135,29 @@ class TemplateHelper if ($templateType == $type) { - $baseDir = THELIA_TEMPLATE_DIR.$subdir; + $baseDir = rtrim($base, DS).DS.$subdir; - // Every subdir of the basedir is supposed to be a template. - $di = new \DirectoryIterator($baseDir); + try { + // Every subdir of the basedir is supposed to be a template. + $di = new \DirectoryIterator($baseDir); - foreach ($di as $file) { - // Ignore 'dot' elements - if ($file->isDot() || ! $file->isDir()) continue; + /** @var \DirectoryIterator $file */ + foreach ($di as $file) { + // Ignore 'dot' elements + if ($file->isDot() || ! $file->isDir()) continue; - // Ignore reserved directory names - if (in_array($file->getFilename(), $exclude)) continue; + // Ignore reserved directory names + if (in_array($file->getFilename(), $exclude)) continue; - $list[] = new TemplateDefinition($file->getFilename(), $templateType); + $list[] = new TemplateDefinition($file->getFilename(), $templateType); + } + } catch (\UnexpectedValueException $ex) { + // Ignore the exception and continue } - - return $list; } } + + return $list; } protected function normalizePath($path) @@ -163,20 +184,21 @@ class TemplateHelper * @param string $walkMode type of file scanning: WALK_MODE_PHP or WALK_MODE_TEMPLATE * @param \Thelia\Core\Translation\Translator $translator the current translator * @param string $currentLocale the current locale + * @param string $domain the translation domain (fontoffice, backoffice, module, etc...) * @param array $strings the list of strings * @throws \InvalidArgumentException if $walkMode contains an invalid value * @return number the total number of translatable texts */ - public function walkDir($directory, $walkMode, Translator $translator, $currentLocale, &$strings) + public function walkDir($directory, $walkMode, Translator $translator, $currentLocale, $domain, &$strings) { $num_texts = 0; if ($walkMode == self::WALK_MODE_PHP) { - $prefix = '\-\>[\s]*trans[\s]*\('; + $prefix = '\-\>[\s]*trans[\s]*\([\s]*'; $allowed_exts = array('php'); } elseif ($walkMode == self::WALK_MODE_TEMPLATE) { - $prefix = '\{intl[\s]l='; + $prefix = '\{intl(?:.*?)l=[\s]*'; $allowed_exts = array('html', 'tpl', 'xml'); } else { @@ -189,11 +211,12 @@ class TemplateHelper Tlog::getInstance()->debug("Walking in $directory, in mode $walkMode"); + /** @var \DirectoryIterator $fileInfo */ foreach (new \DirectoryIterator($directory) as $fileInfo) { if ($fileInfo->isDot()) continue; - if ($fileInfo->isDir()) $num_texts += $this->walkDir($fileInfo->getPathName(), $walkMode, $translator, $currentLocale, $strings); + if ($fileInfo->isDir()) $num_texts += $this->walkDir($fileInfo->getPathName(), $walkMode, $translator, $currentLocale, $domain, $strings); if ($fileInfo->isFile()) { @@ -213,6 +236,8 @@ class TemplateHelper Tlog::getInstance()->debug("Strings found: ", $matches[2]); + $idx = 0; + foreach ($matches[2] as $match) { $hash = md5($match); @@ -224,16 +249,22 @@ class TemplateHelper } else { $num_texts++; - // remove \' - $match = str_replace("\\'", "'", $match); + // remove \' (or \"), that will prevent the translator to work properly, as + // "abc \def\" ghi" will be passed as abc "def" ghi to the translator. + + $quote = $matches[1][$idx]; + + $match = str_replace("\\$quote", $quote, $match); $strings[$hash] = array( 'files' => array($short_path), 'text' => $match, - 'translation' => $translator->trans($match, array(), 'messages', $currentLocale, false), + 'translation' => $translator->trans($match, array(), $domain, $currentLocale, false), 'dollar' => strstr($match, '$') !== false ); } + + $idx++; } } } @@ -244,13 +275,24 @@ class TemplateHelper return $num_texts; } catch (\UnexpectedValueException $ex) { - echo $ex; + // Directory does not exists => ignore/ } } - public function writeTranslation($file, $texts, $translations) + public function writeTranslation($file, $texts, $translations, $createIfNotExists = false) { + $fs = new Filesystem(); + + if (! $fs->exists($file) && true === $createIfNotExists) { + + $dir = dirname($file); + + if (! $fs->exists($file)) { + $fs->mkdir($dir); + } + } + if ($fp = @fopen($file, 'w')) { fwrite($fp, '<' . "?php\n\n"); diff --git a/core/lib/Thelia/Core/Thelia.php b/core/lib/Thelia/Core/Thelia.php index 15076211f..fb750c534 100644 --- a/core/lib/Thelia/Core/Thelia.php +++ b/core/lib/Thelia/Core/Thelia.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core; @@ -45,6 +34,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; use Thelia\Core\Event\TheliaEvents; use Thelia\Config\DatabaseConfiguration; use Thelia\Config\DefinePropel; +use Thelia\Core\Template\ParserInterface; use Thelia\Core\Template\TemplateDefinition; use Thelia\Core\DependencyInjection\Loader\XmlFileLoader; @@ -54,11 +44,12 @@ use Propel\Runtime\Propel; use Propel\Runtime\Connection\ConnectionManagerSingle; use Thelia\Core\Template\TemplateHelper; use Thelia\Log\Tlog; +use Thelia\Model\Module; class Thelia extends Kernel { - const THELIA_VERSION = '2.0.0-RC1'; + const THELIA_VERSION = '2.0.1'; public function init() { @@ -82,7 +73,7 @@ class Thelia extends Kernel $con = Propel::getConnection(\Thelia\Model\Map\ProductTableMap::DATABASE_NAME); $con->setAttribute(ConnectionWrapper::PROPEL_ATTR_CACHE_PREPARES, true); if ($this->isDebug()) { - $serviceContainer->setLogger('defaultLogger', \Thelia\Log\Tlog::getInstance()); + $serviceContainer->setLogger('defaultLogger', Tlog::getInstance()); $con->useDebug(true); } @@ -104,8 +95,8 @@ class Thelia extends Kernel /** * Add all module's standard templates to the parser environment * - * @param TheliaParser $parser the parser - * @param Module $module the Module. + * @param ParserInterface $parser the parser + * @param Module $module the Module. */ protected function addStandardModuleTemplatesToParserEnvironment($parser, $module) { @@ -119,10 +110,10 @@ class Thelia extends Kernel /** * Add a module template directory to the parser environment * - * @param TheliaParser $parser the parser - * @param Module $module the Module. - * @param string $templateType the template type (one of the TemplateDefinition type constants) - * @param string $templateSubdirName the template subdirectory name (one of the TemplateDefinition::XXX_SUBDIR constants) + * @param ParserInterface $parser the parser + * @param Module $module the Module. + * @param string $templateType the template type (one of the TemplateDefinition type constants) + * @param string $templateSubdirName the template subdirectory name (one of the TemplateDefinition::XXX_SUBDIR constants) */ protected function addModuleTemplateToParserEnvironment($parser, $module, $templateType, $templateSubdirName) { @@ -179,8 +170,11 @@ class Thelia extends Kernel $modules = \Thelia\Model\ModuleQuery::getActivated(); $translationDirs = array(); + + /** @var ParserInterface $parser */ $parser = $container->getDefinition('thelia.parser'); + /** @var Module $module */ foreach ($modules as $module) { try { @@ -201,33 +195,63 @@ class Thelia extends Kernel } else { $container->addCompilerPass($compiler); } - } $loader = new XmlFileLoader($container, new FileLocator($module->getAbsoluteConfigPath())); $loader->load("config.xml"); + // Core module translation if (is_dir($dir = $module->getAbsoluteI18nPath())) { - $translationDirs[] = $dir; + $translationDirs[$module->getTranslationDomain()] = $dir; } + // Admin includes translation + if (is_dir($dir = $module->getAbsoluteAdminIncludesI18nPath())) { + $translationDirs[$module->getAdminIncludesTranslationDomain()] = $dir; + } + + // Module back-office template, if any + $templates = + TemplateHelper::getInstance()->getList( + TemplateDefinition::BACK_OFFICE, + $module->getAbsoluteTemplateBasePath() + ); + + foreach ($templates as $template) { + $translationDirs[$module->getBackOfficeTemplateTranslationDomain($template->getName())] = + $module->getAbsoluteBackOfficeI18nTemplatePath($template->getName()); + } + + // Module front-office template, if any + $templates = + TemplateHelper::getInstance()->getList( + TemplateDefinition::FRONT_OFFICE, + $module->getAbsoluteTemplateBasePath() + ); + + foreach ($templates as $template) { + $translationDirs[$module->getFrontOfficeTemplateTranslationDomain($template->getName())] = + $module->getAbsoluteFrontOfficeI18nTemplatePath($template->getName()); + } $this->addStandardModuleTemplatesToParserEnvironment($parser, $module); } catch (\InvalidArgumentException $e) { - Tlog::getInstance()->addError(sprintf("Failed to load module %s: %s", $module->getCode(), $e->getMessage()), $e); + Tlog::getInstance()->addError( + sprintf("Failed to load module %s: %s", $module->getCode(), $e->getMessage()), $e + ); } } - // Load translation from templates - // core translation - $translationDirs[] = THELIA_ROOT . "core/lib/Thelia/Config/I18n"; + // Load core translation + $translationDirs['core'] = THELIA_ROOT . 'core'.DS.'lib'.DS.'Thelia'.DS.'Config'.DS.'I18n'; // Standard templates (front, back, pdf, mail) $th = TemplateHelper::getInstance(); + /** @var TemplateDefinition $templateDefinition */ foreach ($th->getStandardTemplateDefinitions() as $templateDefinition) { if (is_dir($dir = $templateDefinition->getAbsoluteI18nPath())) { - $translationDirs[] = $dir; + $translationDirs[$templateDefinition->getTranslationDomain()] = $dir; } } @@ -241,14 +265,24 @@ class Thelia extends Kernel { $translator = $container->getDefinition('thelia.translator'); - $finder = Finder::create() - ->files() - ->depth(0) - ->in($dirs); + foreach ($dirs as $domain => $dir) { - foreach ($finder as $file) { - list($locale, $format) = explode('.', $file->getBaseName(), 2); - $translator->addMethodCall('addResource', array($format, (string) $file, $locale)); + try { + $finder = Finder::create() + ->files() + ->depth(0) + ->in($dir); + + /** @var \DirectoryIterator $file */ + foreach ($finder as $file) { + list($locale, $format) = explode('.', $file->getBaseName(), 2); + + $translator->addMethodCall('addResource', array($format, (string) $file, $locale, $domain)); + } + } catch (\InvalidArgumentException $ex) { + // Ignore missing I18n directories + Tlog::getInstance()->addWarning("loadTranslation: missing $dir directory"); + } } } @@ -298,7 +332,7 @@ class Thelia extends Kernel public function getCacheDir() { if (defined('THELIA_ROOT')) { - return THELIA_ROOT.'cache/'.$this->environment; + return THELIA_CACHE_DIR.DS.$this->environment; } else { return parent::getCacheDir(); } @@ -315,7 +349,7 @@ class Thelia extends Kernel public function getLogDir() { if (defined('THELIA_ROOT')) { - return THELIA_ROOT.'log/'; + return THELIA_LOG_DIR; } else { return parent::getLogDir(); } diff --git a/core/lib/Thelia/Core/TheliaContainerBuilder.php b/core/lib/Thelia/Core/TheliaContainerBuilder.php index 6a1f896e9..b409a233d 100644 --- a/core/lib/Thelia/Core/TheliaContainerBuilder.php +++ b/core/lib/Thelia/Core/TheliaContainerBuilder.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Core; diff --git a/core/lib/Thelia/Core/TheliaHttpKernel.php b/core/lib/Thelia/Core/TheliaHttpKernel.php index 64577bfcb..060871a22 100644 --- a/core/lib/Thelia/Core/TheliaHttpKernel.php +++ b/core/lib/Thelia/Core/TheliaHttpKernel.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Core; use Propel\Runtime\ActiveQuery\ModelCriteria; @@ -32,7 +22,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\Session; -use Thelia\Core\Event\Currency\CurrencyEvent; +use Thelia\Core\Event\Currency\CurrencyChangeEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Model; @@ -152,7 +142,7 @@ class TheliaHttpKernel extends HttpKernel if ($request->query->has("currency")) { $currency = Model\CurrencyQuery::create()->findOneByCode($request->query->get("currency")); if ($currency) { - $this->container->get("event_dispatcher")->dispatch(TheliaEvents::CHANGE_DEFAULT_CURRENCY, new CurrencyEvent($currency)); + $this->container->get("event_dispatcher")->dispatch(TheliaEvents::CHANGE_DEFAULT_CURRENCY, new CurrencyChangeEvent($currency, $request)); } } else { $currency = $request->getSession()->getCurrency(false); diff --git a/core/lib/Thelia/Core/Translation/Translator.php b/core/lib/Thelia/Core/Translation/Translator.php index fc1c75de2..bad4d4d99 100644 --- a/core/lib/Thelia/Core/Translation/Translator.php +++ b/core/lib/Thelia/Core/Translation/Translator.php @@ -1,8 +1,20 @@ getLocale(); @@ -62,11 +74,19 @@ class Translator extends BaseTranslator $this->loadCatalogue($locale); } - if ($this->catalogues[$locale]->has((string) $id, $domain)) + if (! $this->catalogues[$locale]->has((string) $id, $domain)) { + + } + + if ($this->catalogues[$locale]->has((string) $id, $domain)) { return parent::trans($id, $parameters, $domain, $locale); - else if ($return_default_if_not_available) - return strtr($id, $parameters); - else - return ''; + } else { + //Tlog::getInstance()->addWarning("Undefined translation: locale: $locale, domain: $domain, ID: $id"); + + if ($return_default_if_not_available) + return strtr($id, $parameters); + else + return ''; + } } } diff --git a/core/lib/Thelia/Coupon/BaseFacade.php b/core/lib/Thelia/Coupon/BaseFacade.php index b8f5c9a7f..bdc87261d 100644 --- a/core/lib/Thelia/Coupon/BaseFacade.php +++ b/core/lib/Thelia/Coupon/BaseFacade.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon; @@ -29,6 +18,8 @@ use Symfony\Component\Translation\Translator; use Symfony\Component\Translation\TranslatorInterface; use Thelia\Condition\ConditionEvaluator; use Thelia\Core\HttpFoundation\Request; +use Thelia\Core\Template\ParserInterface; +use Thelia\Core\Template\TemplateHelper; use Thelia\Model\Coupon; use Thelia\Model\CouponQuery; use Thelia\Cart\CartTrait; @@ -54,6 +45,9 @@ class BaseFacade implements FacadeInterface /** @var Translator Service Translator */ protected $translator = null; + /** @var ParserInterface The thelia parser */ + private $parser = null; + /** * Constructor * @@ -208,6 +202,23 @@ class BaseFacade implements FacadeInterface return $this->container->get('thelia.translator'); } + /** + * Return platform Parser + * + * @return ParserInterface + */ + public function getParser() + { + if ($this->parser == null) { + $this->parser = $this->container->get('thelia.parser'); + + // Define the current back-office template that should be used + $this->parser->setTemplateDefinition(TemplateHelper::getInstance()->getActiveAdminTemplate()); + } + + return $this->parser; + } + /** * Return the main currency * THe one used to set prices in BackOffice diff --git a/core/lib/Thelia/Coupon/CouponFactory.php b/core/lib/Thelia/Coupon/CouponFactory.php index 69eb75162..e577061b7 100644 --- a/core/lib/Thelia/Coupon/CouponFactory.php +++ b/core/lib/Thelia/Coupon/CouponFactory.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon; diff --git a/core/lib/Thelia/Coupon/CouponManager.php b/core/lib/Thelia/Coupon/CouponManager.php index f072ad69b..daf1ca9d2 100644 --- a/core/lib/Thelia/Coupon/CouponManager.php +++ b/core/lib/Thelia/Coupon/CouponManager.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon; diff --git a/core/lib/Thelia/Coupon/FacadeInterface.php b/core/lib/Thelia/Coupon/FacadeInterface.php index 1b2d01a5b..40e4e2948 100644 --- a/core/lib/Thelia/Coupon/FacadeInterface.php +++ b/core/lib/Thelia/Coupon/FacadeInterface.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon; @@ -28,6 +17,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Translation\TranslatorInterface; use Thelia\Condition\ConditionEvaluator; use Thelia\Core\HttpFoundation\Request; +use Thelia\Core\Template\ParserInterface; use Thelia\Model\Coupon; /** @@ -140,6 +130,12 @@ interface FacadeInterface * @return TranslatorInterface */ public function getTranslator(); + /** + * Return platform ParserInterface + * + * @return ParserInterface + */ + public function getParser(); /** * Return the main currency diff --git a/core/lib/Thelia/Coupon/Type/CouponAbstract.php b/core/lib/Thelia/Coupon/Type/CouponAbstract.php index 9518c3214..5a2c5f03a 100644 --- a/core/lib/Thelia/Coupon/Type/CouponAbstract.php +++ b/core/lib/Thelia/Coupon/Type/CouponAbstract.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon\Type; @@ -361,22 +350,16 @@ abstract class CouponAbstract implements CouponInterface /** * Draw the input displayed in the BackOffice * allowing Admin to set its Coupon effect + * Override this method to do something useful * * @return string HTML string */ - public function drawBackOfficeInputs() - { - $label = $this->getInputName(); - $value = $this->amount; - - $html = ' -
- - -
- '; - - return $html; + public function drawBackOfficeInputs() { + return $this->facade->getParser()->render('coupon/type-fragments/remove-x.html', [ + 'label' => $this->getInputName(), + 'fieldName' => self::INPUT_AMOUNT_NAME, + 'value' => $this->amount + ]); } /** diff --git a/core/lib/Thelia/Coupon/Type/CouponInterface.php b/core/lib/Thelia/Coupon/Type/CouponInterface.php index 822af01c9..12b54db15 100644 --- a/core/lib/Thelia/Coupon/Type/CouponInterface.php +++ b/core/lib/Thelia/Coupon/Type/CouponInterface.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon\Type; diff --git a/core/lib/Thelia/Coupon/Type/RemoveXAmount.php b/core/lib/Thelia/Coupon/Type/RemoveXAmount.php index e9d7b208e..c644706a2 100644 --- a/core/lib/Thelia/Coupon/Type/RemoveXAmount.php +++ b/core/lib/Thelia/Coupon/Type/RemoveXAmount.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon\Type; @@ -44,7 +33,7 @@ class RemoveXAmount extends CouponAbstract { return $this->facade ->getTranslator() - ->trans('Remove X amount to total cart', array(), 'coupon'); + ->trans('Fixed Amount Discount', array(), 'coupon'); } /** @@ -56,7 +45,7 @@ class RemoveXAmount extends CouponAbstract { return $this->facade ->getTranslator() - ->trans('Amount removed from the cart', array(), 'coupon'); + ->trans('Discount amount', array(), 'coupon'); } /** @@ -69,11 +58,20 @@ class RemoveXAmount extends CouponAbstract $toolTip = $this->facade ->getTranslator() ->trans( - 'This coupon will remove the entered amount to the customer total checkout. If the discount is superior to the total checkout price the customer will only pay the postage. Unless if the coupon is set to remove postage too.', + 'This coupon will subtracts a set amount from the total cost of an order. If the discount is greater than the total order corst, the customer will only pay the shipping, or nothing if the coupon also provides free shipping.', array(), 'coupon' ); return $toolTip; } + + public function drawBackOfficeInputs() + { + return $this->facade->getParser()->render('coupon/type-fragments/remove-x-amount.html', [ + 'label' => $this->getInputName(), + 'fieldName' => self::INPUT_AMOUNT_NAME, + 'value' => $this->amount + ]); + } } diff --git a/core/lib/Thelia/Coupon/Type/RemoveXPercent.php b/core/lib/Thelia/Coupon/Type/RemoveXPercent.php index 747d55a72..83c625d9c 100644 --- a/core/lib/Thelia/Coupon/Type/RemoveXPercent.php +++ b/core/lib/Thelia/Coupon/Type/RemoveXPercent.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon\Type; @@ -127,7 +116,7 @@ class RemoveXPercent extends CouponAbstract { return $this->facade ->getTranslator() - ->trans('Percentage removed from the cart', array(), 'coupon'); + ->trans('Percent Discount', array(), 'coupon'); } /** @@ -140,7 +129,7 @@ class RemoveXPercent extends CouponAbstract $toolTip = $this->facade ->getTranslator() ->trans( - 'This coupon will remove the entered percentage to the customer total checkout. If the discount is superior to the total checkout price the customer will only pay the postage. Unless if the coupon is set to remove postage too.', + 'This coupon will offert a flat percentage off a shopper\'s entire order (not applied to shipping costs or tax rates). If the discount is greater than the total order corst, the customer will only pay the shipping, or nothing if the coupon also provides free shipping.', array(), 'coupon' ); @@ -156,17 +145,12 @@ class RemoveXPercent extends CouponAbstract */ public function drawBackOfficeInputs() { - $labelPercentage = $this->getInputName(); - - $html = ' - -
- - -
- '; - - return $html; + return $this->facade->getParser()->render('coupon/type-fragments/remove-x-percent.html', [ + 'label' => $this->getInputName(), + 'typeKey' => self::INPUT_AMOUNT_NAME, + 'fieldId' => self::INPUT_PERCENTAGE_NAME, + 'fieldName' => self::INPUT_EXTENDED__NAME, + 'value' => $this->percentage + ]); } - } diff --git a/core/lib/Thelia/Exception/AdminAccessDenied.php b/core/lib/Thelia/Exception/AdminAccessDenied.php index a0f9fc14a..fd620b474 100644 --- a/core/lib/Thelia/Exception/AdminAccessDenied.php +++ b/core/lib/Thelia/Exception/AdminAccessDenied.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/CouponExpiredException.php b/core/lib/Thelia/Exception/CouponExpiredException.php index 3aa912549..499ea7dae 100644 --- a/core/lib/Thelia/Exception/CouponExpiredException.php +++ b/core/lib/Thelia/Exception/CouponExpiredException.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/CustomerException.php b/core/lib/Thelia/Exception/CustomerException.php index e2381ca26..ef1f1a591 100644 --- a/core/lib/Thelia/Exception/CustomerException.php +++ b/core/lib/Thelia/Exception/CustomerException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/DocumentException.php b/core/lib/Thelia/Exception/DocumentException.php index 9727a4267..80aed3559 100644 --- a/core/lib/Thelia/Exception/DocumentException.php +++ b/core/lib/Thelia/Exception/DocumentException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/ImageException.php b/core/lib/Thelia/Exception/ImageException.php index 948ee07f0..ec8bbb673 100644 --- a/core/lib/Thelia/Exception/ImageException.php +++ b/core/lib/Thelia/Exception/ImageException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/InvalidCartException.php b/core/lib/Thelia/Exception/InvalidCartException.php index 67269df7b..a071ca900 100644 --- a/core/lib/Thelia/Exception/InvalidCartException.php +++ b/core/lib/Thelia/Exception/InvalidCartException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/InvalidConditionException.php b/core/lib/Thelia/Exception/InvalidConditionException.php index 89d01a7be..4303c9416 100644 --- a/core/lib/Thelia/Exception/InvalidConditionException.php +++ b/core/lib/Thelia/Exception/InvalidConditionException.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/InvalidConditionOperatorException.php b/core/lib/Thelia/Exception/InvalidConditionOperatorException.php index b336aac9a..4d2dc8dc0 100644 --- a/core/lib/Thelia/Exception/InvalidConditionOperatorException.php +++ b/core/lib/Thelia/Exception/InvalidConditionOperatorException.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/InvalidConditionValueException.php b/core/lib/Thelia/Exception/InvalidConditionValueException.php index 65f94ae3a..282cfc333 100644 --- a/core/lib/Thelia/Exception/InvalidConditionValueException.php +++ b/core/lib/Thelia/Exception/InvalidConditionValueException.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/MemberAccessException.php b/core/lib/Thelia/Exception/MemberAccessException.php index e1f65e590..bd6d269d3 100644 --- a/core/lib/Thelia/Exception/MemberAccessException.php +++ b/core/lib/Thelia/Exception/MemberAccessException.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Exception; class MemberAccessException extends \LogicException diff --git a/core/lib/Thelia/Exception/MissingFacadeException.php b/core/lib/Thelia/Exception/MissingFacadeException.php index e717b1457..06845e0d2 100644 --- a/core/lib/Thelia/Exception/MissingFacadeException.php +++ b/core/lib/Thelia/Exception/MissingFacadeException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/ModuleException.php b/core/lib/Thelia/Exception/ModuleException.php index 263a071b0..be581cf51 100644 --- a/core/lib/Thelia/Exception/ModuleException.php +++ b/core/lib/Thelia/Exception/ModuleException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/NotImplementedException.php b/core/lib/Thelia/Exception/NotImplementedException.php index 96b2117c8..31b263f14 100644 --- a/core/lib/Thelia/Exception/NotImplementedException.php +++ b/core/lib/Thelia/Exception/NotImplementedException.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/OrderException.php b/core/lib/Thelia/Exception/OrderException.php index 8654277c5..1a216e9cf 100644 --- a/core/lib/Thelia/Exception/OrderException.php +++ b/core/lib/Thelia/Exception/OrderException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/TaxEngineException.php b/core/lib/Thelia/Exception/TaxEngineException.php index 8150d7169..b9b2363aa 100644 --- a/core/lib/Thelia/Exception/TaxEngineException.php +++ b/core/lib/Thelia/Exception/TaxEngineException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/TheliaProcessException.php b/core/lib/Thelia/Exception/TheliaProcessException.php index f61224dea..2fbee5087 100644 --- a/core/lib/Thelia/Exception/TheliaProcessException.php +++ b/core/lib/Thelia/Exception/TheliaProcessException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/TypeException.php b/core/lib/Thelia/Exception/TypeException.php index 442fffe3e..bb8e3f159 100644 --- a/core/lib/Thelia/Exception/TypeException.php +++ b/core/lib/Thelia/Exception/TypeException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Exception/UrlRewritingException.php b/core/lib/Thelia/Exception/UrlRewritingException.php index 4d84a0193..0ff0a3864 100644 --- a/core/lib/Thelia/Exception/UrlRewritingException.php +++ b/core/lib/Thelia/Exception/UrlRewritingException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Form/AddressCreateForm.php b/core/lib/Thelia/Form/AddressCreateForm.php index 7dcdff4d8..289d809dd 100644 --- a/core/lib/Thelia/Form/AddressCreateForm.php +++ b/core/lib/Thelia/Form/AddressCreateForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/AddressUpdateForm.php b/core/lib/Thelia/Form/AddressUpdateForm.php index 258fbc357..c79ec97c8 100644 --- a/core/lib/Thelia/Form/AddressUpdateForm.php +++ b/core/lib/Thelia/Form/AddressUpdateForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/AdminLogin.php b/core/lib/Thelia/Form/AdminLogin.php index ff26bdc8d..d5ecb0563 100644 --- a/core/lib/Thelia/Form/AdminLogin.php +++ b/core/lib/Thelia/Form/AdminLogin.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\Length; diff --git a/core/lib/Thelia/Form/AdministratorCreationForm.php b/core/lib/Thelia/Form/AdministratorCreationForm.php index 669b72a9a..58df8f000 100644 --- a/core/lib/Thelia/Form/AdministratorCreationForm.php +++ b/core/lib/Thelia/Form/AdministratorCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/AdministratorModificationForm.php b/core/lib/Thelia/Form/AdministratorModificationForm.php index d9dae7ce4..cfc9d0bd4 100644 --- a/core/lib/Thelia/Form/AdministratorModificationForm.php +++ b/core/lib/Thelia/Form/AdministratorModificationForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/Area/AreaCountryForm.php b/core/lib/Thelia/Form/Area/AreaCountryForm.php index b3f09ae06..fcde947b7 100644 --- a/core/lib/Thelia/Form/Area/AreaCountryForm.php +++ b/core/lib/Thelia/Form/Area/AreaCountryForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Area; diff --git a/core/lib/Thelia/Form/Area/AreaCreateForm.php b/core/lib/Thelia/Form/Area/AreaCreateForm.php index 79fc4b2a2..adbae921b 100644 --- a/core/lib/Thelia/Form/Area/AreaCreateForm.php +++ b/core/lib/Thelia/Form/Area/AreaCreateForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Area; @@ -62,7 +51,7 @@ class AreaCreateForm extends BaseForm new NotBlank() ), 'label_attr' => array('for' => 'shipping_name'), - 'label' => Translator::getInstance()->trans('shipping area name') + 'label' => Translator::getInstance()->trans('Shipping zone name') )) ; diff --git a/core/lib/Thelia/Form/Area/AreaModificationForm.php b/core/lib/Thelia/Form/Area/AreaModificationForm.php index 6c9d52f7f..86ac8a364 100644 --- a/core/lib/Thelia/Form/Area/AreaModificationForm.php +++ b/core/lib/Thelia/Form/Area/AreaModificationForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Area; diff --git a/core/lib/Thelia/Form/Area/AreaPostageForm.php b/core/lib/Thelia/Form/Area/AreaPostageForm.php index fa22ab908..d885ba517 100644 --- a/core/lib/Thelia/Form/Area/AreaPostageForm.php +++ b/core/lib/Thelia/Form/Area/AreaPostageForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Area; diff --git a/core/lib/Thelia/Form/AttributeAvCreationForm.php b/core/lib/Thelia/Form/AttributeAvCreationForm.php index 513fc0c6b..e14190435 100644 --- a/core/lib/Thelia/Form/AttributeAvCreationForm.php +++ b/core/lib/Thelia/Form/AttributeAvCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/AttributeCreationForm.php b/core/lib/Thelia/Form/AttributeCreationForm.php index db638fb29..81f92683f 100644 --- a/core/lib/Thelia/Form/AttributeCreationForm.php +++ b/core/lib/Thelia/Form/AttributeCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/AttributeModificationForm.php b/core/lib/Thelia/Form/AttributeModificationForm.php index cd6ea2a76..fda1a679b 100644 --- a/core/lib/Thelia/Form/AttributeModificationForm.php +++ b/core/lib/Thelia/Form/AttributeModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/BaseForm.php b/core/lib/Thelia/Form/BaseForm.php index 8dff18cfc..332d8eff6 100644 --- a/core/lib/Thelia/Form/BaseForm.php +++ b/core/lib/Thelia/Form/BaseForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Form\Extension\Validator\ValidatorExtension; @@ -189,7 +179,7 @@ abstract class BaseForm /** * Set the error message related to global form error * - * @param unknown $message + * @param string $message */ public function setErrorMessage($message) { diff --git a/core/lib/Thelia/Form/Cache/AssetsFlushForm.php b/core/lib/Thelia/Form/Cache/AssetsFlushForm.php new file mode 100644 index 000000000..4847208f9 --- /dev/null +++ b/core/lib/Thelia/Form/Cache/AssetsFlushForm.php @@ -0,0 +1,40 @@ + + */ +class AssetsFlushForm extends BaseForm +{ + + /** + * @inheritdoc + */ + protected function buildForm() + { + //Nothing, we just want CSRF protection + } + + /** + * @inheritdoc + */ + public function getName() + { + return "assets_flush"; + } +} diff --git a/core/lib/Thelia/Form/Cache/CacheFlushForm.php b/core/lib/Thelia/Form/Cache/CacheFlushForm.php new file mode 100644 index 000000000..b68b418f9 --- /dev/null +++ b/core/lib/Thelia/Form/Cache/CacheFlushForm.php @@ -0,0 +1,40 @@ + + */ +class CacheFlushForm extends BaseForm +{ + + /** + * @inheritdoc + */ + protected function buildForm() + { + //Nothing, we just want CSRF protection + } + + /** + * @inheritdoc + */ + public function getName() + { + return "cache_flush"; + } +} diff --git a/core/lib/Thelia/Form/Cache/ImagesAndDocumentsCacheFlushForm.php b/core/lib/Thelia/Form/Cache/ImagesAndDocumentsCacheFlushForm.php new file mode 100644 index 000000000..ef29944e9 --- /dev/null +++ b/core/lib/Thelia/Form/Cache/ImagesAndDocumentsCacheFlushForm.php @@ -0,0 +1,40 @@ + + */ +class ImagesAndDocumentsCacheFlushForm extends BaseForm +{ + + /** + * @inheritdoc + */ + protected function buildForm() + { + //Nothing, we just want CSRF protection + } + + /** + * @inheritdoc + */ + public function getName() + { + return "images_and_documents_cache_flush"; + } +} diff --git a/core/lib/Thelia/Form/CartAdd.php b/core/lib/Thelia/Form/CartAdd.php index 7b750b40d..688394ee3 100644 --- a/core/lib/Thelia/Form/CartAdd.php +++ b/core/lib/Thelia/Form/CartAdd.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/CategoryCreationForm.php b/core/lib/Thelia/Form/CategoryCreationForm.php index 6a0172180..8db602d33 100644 --- a/core/lib/Thelia/Form/CategoryCreationForm.php +++ b/core/lib/Thelia/Form/CategoryCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\NotBlank; diff --git a/core/lib/Thelia/Form/CategoryDocumentModification.php b/core/lib/Thelia/Form/CategoryDocumentModification.php index 9ad7ba890..b7def3b50 100644 --- a/core/lib/Thelia/Form/CategoryDocumentModification.php +++ b/core/lib/Thelia/Form/CategoryDocumentModification.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Thelia\Form\Image\DocumentModification; diff --git a/core/lib/Thelia/Form/CategoryImageModification.php b/core/lib/Thelia/Form/CategoryImageModification.php index 6f24263eb..2348c2fe9 100644 --- a/core/lib/Thelia/Form/CategoryImageModification.php +++ b/core/lib/Thelia/Form/CategoryImageModification.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Thelia\Form\Image\ImageModification; diff --git a/core/lib/Thelia/Form/CategoryModificationForm.php b/core/lib/Thelia/Form/CategoryModificationForm.php index 1ce877803..6611f5f1d 100644 --- a/core/lib/Thelia/Form/CategoryModificationForm.php +++ b/core/lib/Thelia/Form/CategoryModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; diff --git a/core/lib/Thelia/Form/ConfigCreationForm.php b/core/lib/Thelia/Form/ConfigCreationForm.php index 56df63f8a..55e6abf70 100644 --- a/core/lib/Thelia/Form/ConfigCreationForm.php +++ b/core/lib/Thelia/Form/ConfigCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/ConfigModificationForm.php b/core/lib/Thelia/Form/ConfigModificationForm.php index 318da7185..ed5cec2b7 100644 --- a/core/lib/Thelia/Form/ConfigModificationForm.php +++ b/core/lib/Thelia/Form/ConfigModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\NotBlank; diff --git a/core/lib/Thelia/Form/ConfigStoreForm.php b/core/lib/Thelia/Form/ConfigStoreForm.php index 382e91c4d..b7b49b2a0 100644 --- a/core/lib/Thelia/Form/ConfigStoreForm.php +++ b/core/lib/Thelia/Form/ConfigStoreForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/ContactForm.php b/core/lib/Thelia/Form/ContactForm.php index 8497a2222..1d8366806 100644 --- a/core/lib/Thelia/Form/ContactForm.php +++ b/core/lib/Thelia/Form/ContactForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/ContentCreationForm.php b/core/lib/Thelia/Form/ContentCreationForm.php index 663ed4c1b..c5d65f757 100644 --- a/core/lib/Thelia/Form/ContentCreationForm.php +++ b/core/lib/Thelia/Form/ContentCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\NotBlank; diff --git a/core/lib/Thelia/Form/ContentDocumentModification.php b/core/lib/Thelia/Form/ContentDocumentModification.php index d9d7c0571..020639fae 100644 --- a/core/lib/Thelia/Form/ContentDocumentModification.php +++ b/core/lib/Thelia/Form/ContentDocumentModification.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Thelia\Form\Image\DocumentModification; diff --git a/core/lib/Thelia/Form/ContentImageModification.php b/core/lib/Thelia/Form/ContentImageModification.php index d80e47224..d6768eed0 100644 --- a/core/lib/Thelia/Form/ContentImageModification.php +++ b/core/lib/Thelia/Form/ContentImageModification.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Thelia\Form\Image\ImageModification; diff --git a/core/lib/Thelia/Form/ContentModificationForm.php b/core/lib/Thelia/Form/ContentModificationForm.php index dbe427b9f..a04aeefef 100644 --- a/core/lib/Thelia/Form/ContentModificationForm.php +++ b/core/lib/Thelia/Form/ContentModificationForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/CountryCreationForm.php b/core/lib/Thelia/Form/CountryCreationForm.php index fe7486852..8641f0850 100644 --- a/core/lib/Thelia/Form/CountryCreationForm.php +++ b/core/lib/Thelia/Form/CountryCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\NotBlank; diff --git a/core/lib/Thelia/Form/CountryModificationForm.php b/core/lib/Thelia/Form/CountryModificationForm.php index 99c404e62..e2efad398 100644 --- a/core/lib/Thelia/Form/CountryModificationForm.php +++ b/core/lib/Thelia/Form/CountryModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; diff --git a/core/lib/Thelia/Form/CouponCode.php b/core/lib/Thelia/Form/CouponCode.php index 1319c1fb8..b72959741 100644 --- a/core/lib/Thelia/Form/CouponCode.php +++ b/core/lib/Thelia/Form/CouponCode.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/CouponCreationForm.php b/core/lib/Thelia/Form/CouponCreationForm.php index 279063329..a42ad85da 100644 --- a/core/lib/Thelia/Form/CouponCreationForm.php +++ b/core/lib/Thelia/Form/CouponCreationForm.php @@ -1,32 +1,24 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Form; -use Symfony\Component\Validator\Constraints\Date; +use Symfony\Component\Validator\Constraints\Callback; use Symfony\Component\Validator\Constraints\GreaterThanOrEqual; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotEqualTo; +use Symfony\Component\Validator\ExecutionContextInterface; +use Thelia\Core\Translation\Translator; +use Thelia\Model\Base\LangQuery; /** * Allow to build a form Coupon @@ -106,7 +98,11 @@ class CouponCreationForm extends BaseForm array( 'constraints' => array( new NotBlank(), - new Date() + new Callback(array( + "methods" => array( + array($this, "checkLocalizedDate"), + ), + )) ) ) ) @@ -131,11 +127,7 @@ class CouponCreationForm extends BaseForm array( 'constraints' => array( new NotBlank(), - new GreaterThanOrEqual( - array( - 'value' => -1 - ) - ) + new GreaterThanOrEqual(['value' => -1]) ) ) ) @@ -150,6 +142,24 @@ class CouponCreationForm extends BaseForm ); } + /** + * Validate a date entered with the default Language date format. + * + * @param string $value + * @param ExecutionContextInterface $context + */ + public function checkLocalizedDate($value, ExecutionContextInterface $context) + { + $format = LangQuery::create()->findOneByByDefault(true)->getDateFormat(); + + if (false === \DateTime::createFromFormat($format, $value)) { + $context->addViolation(Translator::getInstance()->trans("Date '%date' is invalid, please enter a valid date using %fmt format", [ + '%fmt' => $format, + '%date' => $value + ])); + } + } + /** * Get form name * diff --git a/core/lib/Thelia/Form/CurrencyCreationForm.php b/core/lib/Thelia/Form/CurrencyCreationForm.php index 9872d100c..0c3a8c3bf 100644 --- a/core/lib/Thelia/Form/CurrencyCreationForm.php +++ b/core/lib/Thelia/Form/CurrencyCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/CurrencyModificationForm.php b/core/lib/Thelia/Form/CurrencyModificationForm.php index c56791e3d..1f5901a57 100644 --- a/core/lib/Thelia/Form/CurrencyModificationForm.php +++ b/core/lib/Thelia/Form/CurrencyModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; diff --git a/core/lib/Thelia/Form/CustomerCreateForm.php b/core/lib/Thelia/Form/CustomerCreateForm.php index 2da01fe48..d0e915657 100644 --- a/core/lib/Thelia/Form/CustomerCreateForm.php +++ b/core/lib/Thelia/Form/CustomerCreateForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/CustomerLogin.php b/core/lib/Thelia/Form/CustomerLogin.php index 8c2f2fa6d..12ba68696 100644 --- a/core/lib/Thelia/Form/CustomerLogin.php +++ b/core/lib/Thelia/Form/CustomerLogin.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/CustomerLostPasswordForm.php b/core/lib/Thelia/Form/CustomerLostPasswordForm.php index ee26fd2c1..3d29605e9 100644 --- a/core/lib/Thelia/Form/CustomerLostPasswordForm.php +++ b/core/lib/Thelia/Form/CustomerLostPasswordForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/CustomerPasswordUpdateForm.php b/core/lib/Thelia/Form/CustomerPasswordUpdateForm.php index 50f49261a..9fece619c 100644 --- a/core/lib/Thelia/Form/CustomerPasswordUpdateForm.php +++ b/core/lib/Thelia/Form/CustomerPasswordUpdateForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/CustomerProfileUpdateForm.php b/core/lib/Thelia/Form/CustomerProfileUpdateForm.php index 9b075abe8..1d4d07b30 100644 --- a/core/lib/Thelia/Form/CustomerProfileUpdateForm.php +++ b/core/lib/Thelia/Form/CustomerProfileUpdateForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\ExecutionContextInterface; diff --git a/core/lib/Thelia/Form/CustomerUpdateForm.php b/core/lib/Thelia/Form/CustomerUpdateForm.php index 6f4411113..ae7f446a7 100644 --- a/core/lib/Thelia/Form/CustomerUpdateForm.php +++ b/core/lib/Thelia/Form/CustomerUpdateForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; @@ -169,6 +158,12 @@ class CustomerUpdateForm extends BaseForm "for" => "title" ) )) + ->add('discount', 'text', array( + 'label' => Translator::getInstance()->trans('permanent discount (in percent)'), + 'label_attr' => array( + 'for' => 'discount' + ) + )) ; } diff --git a/core/lib/Thelia/Form/Exception/FormValidationException.php b/core/lib/Thelia/Form/Exception/FormValidationException.php index c955b03f0..9547ec872 100644 --- a/core/lib/Thelia/Form/Exception/FormValidationException.php +++ b/core/lib/Thelia/Form/Exception/FormValidationException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Exception; diff --git a/core/lib/Thelia/Form/Exception/ProductNotFoundException.php b/core/lib/Thelia/Form/Exception/ProductNotFoundException.php index 480aec433..3c786cfd8 100644 --- a/core/lib/Thelia/Form/Exception/ProductNotFoundException.php +++ b/core/lib/Thelia/Form/Exception/ProductNotFoundException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Exception; diff --git a/core/lib/Thelia/Form/Exception/StockNotFoundException.php b/core/lib/Thelia/Form/Exception/StockNotFoundException.php index 47c5740da..cc3bdbbbe 100644 --- a/core/lib/Thelia/Form/Exception/StockNotFoundException.php +++ b/core/lib/Thelia/Form/Exception/StockNotFoundException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Exception; diff --git a/core/lib/Thelia/Form/FeatureAvCreationForm.php b/core/lib/Thelia/Form/FeatureAvCreationForm.php index 9245bf28d..77b4ec410 100644 --- a/core/lib/Thelia/Form/FeatureAvCreationForm.php +++ b/core/lib/Thelia/Form/FeatureAvCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/FeatureCreationForm.php b/core/lib/Thelia/Form/FeatureCreationForm.php index b436ca917..747d504aa 100644 --- a/core/lib/Thelia/Form/FeatureCreationForm.php +++ b/core/lib/Thelia/Form/FeatureCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/FeatureModificationForm.php b/core/lib/Thelia/Form/FeatureModificationForm.php index 5b20bd337..6b08d185b 100644 --- a/core/lib/Thelia/Form/FeatureModificationForm.php +++ b/core/lib/Thelia/Form/FeatureModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/FolderCreationForm.php b/core/lib/Thelia/Form/FolderCreationForm.php index ac7b10376..27386a8b5 100644 --- a/core/lib/Thelia/Form/FolderCreationForm.php +++ b/core/lib/Thelia/Form/FolderCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\NotBlank; diff --git a/core/lib/Thelia/Form/FolderDocumentModification.php b/core/lib/Thelia/Form/FolderDocumentModification.php index 47bcd7c7f..76263bf76 100644 --- a/core/lib/Thelia/Form/FolderDocumentModification.php +++ b/core/lib/Thelia/Form/FolderDocumentModification.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Thelia\Form\Image\DocumentModification; diff --git a/core/lib/Thelia/Form/FolderImageModification.php b/core/lib/Thelia/Form/FolderImageModification.php index 004c4676b..fbb02e028 100644 --- a/core/lib/Thelia/Form/FolderImageModification.php +++ b/core/lib/Thelia/Form/FolderImageModification.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Thelia\Form\Image\ImageModification; diff --git a/core/lib/Thelia/Form/FolderModificationForm.php b/core/lib/Thelia/Form/FolderModificationForm.php index daab3b5ad..156662bcd 100644 --- a/core/lib/Thelia/Form/FolderModificationForm.php +++ b/core/lib/Thelia/Form/FolderModificationForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/Image/DocumentModification.php b/core/lib/Thelia/Form/Image/DocumentModification.php index 199a874b4..6af9a5d12 100644 --- a/core/lib/Thelia/Form/Image/DocumentModification.php +++ b/core/lib/Thelia/Form/Image/DocumentModification.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form\Image; use Symfony\Component\Validator\Constraints\NotBlank; diff --git a/core/lib/Thelia/Form/Image/ImageModification.php b/core/lib/Thelia/Form/Image/ImageModification.php index 93b8f9898..472deb4fb 100644 --- a/core/lib/Thelia/Form/Image/ImageModification.php +++ b/core/lib/Thelia/Form/Image/ImageModification.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form\Image; use Symfony\Component\Validator\Constraints\Image; diff --git a/core/lib/Thelia/Form/InstallStep3Form.php b/core/lib/Thelia/Form/InstallStep3Form.php index 9388f14db..4cfefba7e 100644 --- a/core/lib/Thelia/Form/InstallStep3Form.php +++ b/core/lib/Thelia/Form/InstallStep3Form.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/Lang/LangCreateForm.php b/core/lib/Thelia/Form/Lang/LangCreateForm.php index d41c45641..44c149511 100644 --- a/core/lib/Thelia/Form/Lang/LangCreateForm.php +++ b/core/lib/Thelia/Form/Lang/LangCreateForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Lang; @@ -102,6 +91,30 @@ class LangCreateForm extends BaseForm 'for' => 'time_lang' ) )) + ->add('decimal_separator', 'text', array( + 'constraints' => array( + new NotBlank() + ), + 'label' => Translator::getInstance()->trans('decimal separator'), + 'label_attr' => array( + 'for' => 'decimal_separator' + ) + )) + ->add('thousands_separator', 'text', array( + 'label' => Translator::getInstance()->trans('thousands separator'), + 'label_attr' => array( + 'for' => 'thousands_separator' + ) + )) + ->add('decimals', 'text', array( + 'constraints' => array( + new NotBlank() + ), + 'label' => Translator::getInstance()->trans('Sets the number of decimal points'), + 'label_attr' => array( + 'for' => 'decimals' + ) + )) ; } diff --git a/core/lib/Thelia/Form/Lang/LangDefaultBehaviorForm.php b/core/lib/Thelia/Form/Lang/LangDefaultBehaviorForm.php index 38a48a007..3d29e86ad 100644 --- a/core/lib/Thelia/Form/Lang/LangDefaultBehaviorForm.php +++ b/core/lib/Thelia/Form/Lang/LangDefaultBehaviorForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Lang; diff --git a/core/lib/Thelia/Form/Lang/LangUpdateForm.php b/core/lib/Thelia/Form/Lang/LangUpdateForm.php index e0c572797..6491013e1 100644 --- a/core/lib/Thelia/Form/Lang/LangUpdateForm.php +++ b/core/lib/Thelia/Form/Lang/LangUpdateForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Lang; diff --git a/core/lib/Thelia/Form/Lang/LangUrlEvent.php b/core/lib/Thelia/Form/Lang/LangUrlEvent.php index 18366f094..018a7156f 100644 --- a/core/lib/Thelia/Form/Lang/LangUrlEvent.php +++ b/core/lib/Thelia/Form/Lang/LangUrlEvent.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Lang; diff --git a/core/lib/Thelia/Form/Lang/LangUrlForm.php b/core/lib/Thelia/Form/Lang/LangUrlForm.php index 784924728..27cc2623f 100644 --- a/core/lib/Thelia/Form/Lang/LangUrlForm.php +++ b/core/lib/Thelia/Form/Lang/LangUrlForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\Lang; diff --git a/core/lib/Thelia/Form/MailingSystemModificationForm.php b/core/lib/Thelia/Form/MailingSystemModificationForm.php index 2ae325b20..14bf6c1ed 100644 --- a/core/lib/Thelia/Form/MailingSystemModificationForm.php +++ b/core/lib/Thelia/Form/MailingSystemModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Thelia\Core\Translation\Translator; diff --git a/core/lib/Thelia/Form/MessageCreationForm.php b/core/lib/Thelia/Form/MessageCreationForm.php index 288de1d36..e0187b797 100644 --- a/core/lib/Thelia/Form/MessageCreationForm.php +++ b/core/lib/Thelia/Form/MessageCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/MessageModificationForm.php b/core/lib/Thelia/Form/MessageModificationForm.php index 231c605b8..26b5b87e0 100644 --- a/core/lib/Thelia/Form/MessageModificationForm.php +++ b/core/lib/Thelia/Form/MessageModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\NotBlank; diff --git a/core/lib/Thelia/Form/ModuleModificationForm.php b/core/lib/Thelia/Form/ModuleModificationForm.php index 2d0e6eea7..14272151b 100644 --- a/core/lib/Thelia/Form/ModuleModificationForm.php +++ b/core/lib/Thelia/Form/ModuleModificationForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/NewsletterForm.php b/core/lib/Thelia/Form/NewsletterForm.php index aa90138b1..4bdf97046 100644 --- a/core/lib/Thelia/Form/NewsletterForm.php +++ b/core/lib/Thelia/Form/NewsletterForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/OrderDelivery.php b/core/lib/Thelia/Form/OrderDelivery.php index 37172612a..74ad75f33 100644 --- a/core/lib/Thelia/Form/OrderDelivery.php +++ b/core/lib/Thelia/Form/OrderDelivery.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; @@ -83,13 +73,12 @@ class OrderDelivery extends BaseForm if (null === $module) { $context->addViolation(Translator::getInstance()->trans("Delivery module ID not found")); - } - - $moduleReflection = new \ReflectionClass($module->getFullNamespace()); - if ($moduleReflection->isSubclassOf("Thelia\Module\DeliveryModuleInterface") === false) { - $context->addViolation( - sprintf(Translator::getInstance()->trans("delivery module %s is not a Thelia\Module\DeliveryModuleInterface"), $module->getCode()) - ); + } else { + if (! $module->isDeliveryModule()) { + $context->addViolation( + sprintf(Translator::getInstance()->trans("delivery module %s is not a Thelia\Module\DeliveryModuleInterface"), $module->getCode()) + ); + } } } diff --git a/core/lib/Thelia/Form/OrderPayment.php b/core/lib/Thelia/Form/OrderPayment.php index 1ae4fa06c..9353eee37 100644 --- a/core/lib/Thelia/Form/OrderPayment.php +++ b/core/lib/Thelia/Form/OrderPayment.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; @@ -85,10 +75,9 @@ class OrderPayment extends BaseForm $context->addViolation("Payment module ID not found"); } - $moduleReflection = new \ReflectionClass($module->getFullNamespace()); - if ($moduleReflection->isSubclassOf("Thelia\Module\PaymentModuleInterface") === false) { + if (! $module->isPayementModule()) { $context->addViolation( - sprintf(Translator::getInstance()->trans("delivery module %s is not a Thelia\Module\PaymentModuleInterface"), $module->getCode()) + sprintf(Translator::getInstance()->trans("payment module %s is not a Thelia\Module\PaymentModuleInterface"), $module->getCode()) ); } } diff --git a/core/lib/Thelia/Form/OrderUpdateAddress.php b/core/lib/Thelia/Form/OrderUpdateAddress.php index 9c4bfaa37..da8cbf469 100644 --- a/core/lib/Thelia/Form/OrderUpdateAddress.php +++ b/core/lib/Thelia/Form/OrderUpdateAddress.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/ProductCombinationGenerationForm.php b/core/lib/Thelia/Form/ProductCombinationGenerationForm.php index 82df0e09a..b1e3404ea 100644 --- a/core/lib/Thelia/Form/ProductCombinationGenerationForm.php +++ b/core/lib/Thelia/Form/ProductCombinationGenerationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; diff --git a/core/lib/Thelia/Form/ProductCreationForm.php b/core/lib/Thelia/Form/ProductCreationForm.php index de683e27a..d74529509 100644 --- a/core/lib/Thelia/Form/ProductCreationForm.php +++ b/core/lib/Thelia/Form/ProductCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\NotBlank; @@ -70,8 +60,12 @@ class ProductCreationForm extends BaseForm ->add("price", "number", array( "constraints" => array(new NotBlank()), "label" => Translator::getInstance()->trans("Product base price excluding taxes *"), - "label_attr" => array("for" => "price_field") + "label_attr" => array("for" => "price_without_tax") )) + ->add("tax_price", "number", array( + "label" => Translator::getInstance()->trans("Product base price with taxes"), + "label_attr" => array("for" => "price_with_tax") + )) ->add("currency", "integer", array( "constraints" => array(new NotBlank()), "label" => Translator::getInstance()->trans("Price currency *"), @@ -83,8 +77,7 @@ class ProductCreationForm extends BaseForm "label_attr" => array("for" => "tax_rule_field") )) ->add("weight", "number", array( - "constraints" => array(new NotBlank()), - "label" => Translator::getInstance()->trans("Weight *"), + "label" => Translator::getInstance()->trans("Weight"), "label_attr" => array("for" => "weight_field") )) ; diff --git a/core/lib/Thelia/Form/ProductDefaultSaleElementUpdateForm.php b/core/lib/Thelia/Form/ProductDefaultSaleElementUpdateForm.php index 54fb2fdc1..49f3553d6 100644 --- a/core/lib/Thelia/Form/ProductDefaultSaleElementUpdateForm.php +++ b/core/lib/Thelia/Form/ProductDefaultSaleElementUpdateForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; @@ -65,8 +55,7 @@ class ProductDefaultSaleElementUpdateForm extends ProductSaleElementUpdateForm "label_attr" => array("for" => "tax_rule_field") )) ->add("weight", "number", array( - "constraints" => array(new NotBlank()), - "label" => Translator::getInstance()->trans("Weight *"), + "label" => Translator::getInstance()->trans("Weight"), "label_attr" => array("for" => "weight_field") )) ->add("quantity", "number", array( diff --git a/core/lib/Thelia/Form/ProductDocumentModification.php b/core/lib/Thelia/Form/ProductDocumentModification.php index a9d7617e4..412beca6a 100644 --- a/core/lib/Thelia/Form/ProductDocumentModification.php +++ b/core/lib/Thelia/Form/ProductDocumentModification.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Thelia\Form\Image\DocumentModification; diff --git a/core/lib/Thelia/Form/ProductImageModification.php b/core/lib/Thelia/Form/ProductImageModification.php index 9c81ca839..decc297da 100644 --- a/core/lib/Thelia/Form/ProductImageModification.php +++ b/core/lib/Thelia/Form/ProductImageModification.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Thelia\Form\Image\ImageModification; diff --git a/core/lib/Thelia/Form/ProductModificationForm.php b/core/lib/Thelia/Form/ProductModificationForm.php index d2819737c..b3b362f8a 100644 --- a/core/lib/Thelia/Form/ProductModificationForm.php +++ b/core/lib/Thelia/Form/ProductModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; diff --git a/core/lib/Thelia/Form/ProductSaleElementUpdateForm.php b/core/lib/Thelia/Form/ProductSaleElementUpdateForm.php index cda72cc72..1c0643c05 100644 --- a/core/lib/Thelia/Form/ProductSaleElementUpdateForm.php +++ b/core/lib/Thelia/Form/ProductSaleElementUpdateForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; @@ -91,13 +81,10 @@ class ProductSaleElementUpdateForm extends BaseForm )) ->add('weight', 'collection', array( 'type' => 'number', - 'label' => Translator::getInstance()->trans('Weight *'), + 'label' => Translator::getInstance()->trans('Weight'), 'label_attr' => array('for' => 'weight_field'), 'allow_add' => true, - 'allow_delete' => true, - 'options' => array( - 'constraints' => array(new NotBlank()), - ) + 'allow_delete' => true )) ->add('quantity', 'collection', array( 'type' => 'number', diff --git a/core/lib/Thelia/Form/ProfileCreationForm.php b/core/lib/Thelia/Form/ProfileCreationForm.php index 8a70b68bd..c7faa6d2f 100644 --- a/core/lib/Thelia/Form/ProfileCreationForm.php +++ b/core/lib/Thelia/Form/ProfileCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/ProfileModificationForm.php b/core/lib/Thelia/Form/ProfileModificationForm.php index 9ac186283..a7e8dae39 100644 --- a/core/lib/Thelia/Form/ProfileModificationForm.php +++ b/core/lib/Thelia/Form/ProfileModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/ProfileUpdateModuleAccessForm.php b/core/lib/Thelia/Form/ProfileUpdateModuleAccessForm.php index 6e1ee9c3e..08384572c 100644 --- a/core/lib/Thelia/Form/ProfileUpdateModuleAccessForm.php +++ b/core/lib/Thelia/Form/ProfileUpdateModuleAccessForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/ProfileUpdateResourceAccessForm.php b/core/lib/Thelia/Form/ProfileUpdateResourceAccessForm.php index 5bd8eeca4..b1c52c272 100644 --- a/core/lib/Thelia/Form/ProfileUpdateResourceAccessForm.php +++ b/core/lib/Thelia/Form/ProfileUpdateResourceAccessForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/SeoFieldsTrait.php b/core/lib/Thelia/Form/SeoFieldsTrait.php index 95ce487fc..cb64ad6c0 100644 --- a/core/lib/Thelia/Form/SeoFieldsTrait.php +++ b/core/lib/Thelia/Form/SeoFieldsTrait.php @@ -1,28 +1,17 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; -use Symfony\Component\Validator\Constraints\NotBlank; use Thelia\Core\Translation\Translator; /** @@ -54,13 +43,11 @@ trait SeoFieldsTrait if (! in_array('meta_title', $exclude)) $this->formBuilder ->add('meta_title', 'text', array( - 'constraints' => array( - new NotBlank() - ), 'label' => Translator::getInstance()->trans('Page Title'), 'label_attr' => array( 'for' => 'meta_title' - ) + ), + 'required' => false ) ); diff --git a/core/lib/Thelia/Form/SeoForm.php b/core/lib/Thelia/Form/SeoForm.php index 28c90c9ba..acdb577ef 100644 --- a/core/lib/Thelia/Form/SeoForm.php +++ b/core/lib/Thelia/Form/SeoForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; diff --git a/core/lib/Thelia/Form/ShippingZone/ShippingZoneAddArea.php b/core/lib/Thelia/Form/ShippingZone/ShippingZoneAddArea.php index ea31b696b..8e2433fba 100644 --- a/core/lib/Thelia/Form/ShippingZone/ShippingZoneAddArea.php +++ b/core/lib/Thelia/Form/ShippingZone/ShippingZoneAddArea.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\ShippingZone; @@ -65,7 +54,7 @@ class ShippingZoneAddArea extends BaseForm new GreaterThan(array('value' => 0)) ), 'label_attr' => array('for' => 'shipping_area'), - 'label' => Translator::getInstance()->trans('Area') + 'label' => Translator::getInstance()->trans('Available shipping zones') )) ->add('shipping_zone_id', 'integer', array( 'constraints' => array( diff --git a/core/lib/Thelia/Form/ShippingZone/ShippingZoneRemoveArea.php b/core/lib/Thelia/Form/ShippingZone/ShippingZoneRemoveArea.php index dfa568334..355ac79c4 100644 --- a/core/lib/Thelia/Form/ShippingZone/ShippingZoneRemoveArea.php +++ b/core/lib/Thelia/Form/ShippingZone/ShippingZoneRemoveArea.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form\ShippingZone; diff --git a/core/lib/Thelia/Form/StandardDescriptionFieldsTrait.php b/core/lib/Thelia/Form/StandardDescriptionFieldsTrait.php index f204e7254..e050cce1f 100644 --- a/core/lib/Thelia/Form/StandardDescriptionFieldsTrait.php +++ b/core/lib/Thelia/Form/StandardDescriptionFieldsTrait.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints\NotBlank; diff --git a/core/lib/Thelia/Form/SystemLogConfigurationForm.php b/core/lib/Thelia/Form/SystemLogConfigurationForm.php index f4eb62285..0f6a4dde3 100644 --- a/core/lib/Thelia/Form/SystemLogConfigurationForm.php +++ b/core/lib/Thelia/Form/SystemLogConfigurationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/TaxCreationForm.php b/core/lib/Thelia/Form/TaxCreationForm.php index 8d91bdc4a..bd58e1367 100644 --- a/core/lib/Thelia/Form/TaxCreationForm.php +++ b/core/lib/Thelia/Form/TaxCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/TaxModificationForm.php b/core/lib/Thelia/Form/TaxModificationForm.php index 8cfacdd0c..24ab90acb 100644 --- a/core/lib/Thelia/Form/TaxModificationForm.php +++ b/core/lib/Thelia/Form/TaxModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/TaxRuleCreationForm.php b/core/lib/Thelia/Form/TaxRuleCreationForm.php index a5dcc1999..29d81d3fd 100644 --- a/core/lib/Thelia/Form/TaxRuleCreationForm.php +++ b/core/lib/Thelia/Form/TaxRuleCreationForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/TaxRuleModificationForm.php b/core/lib/Thelia/Form/TaxRuleModificationForm.php index 0a75f810b..febc5327d 100644 --- a/core/lib/Thelia/Form/TaxRuleModificationForm.php +++ b/core/lib/Thelia/Form/TaxRuleModificationForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/TaxRuleTaxListUpdateForm.php b/core/lib/Thelia/Form/TaxRuleTaxListUpdateForm.php index a48dea678..b3d29f489 100644 --- a/core/lib/Thelia/Form/TaxRuleTaxListUpdateForm.php +++ b/core/lib/Thelia/Form/TaxRuleTaxListUpdateForm.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Form; diff --git a/core/lib/Thelia/Form/TemplateCreationForm.php b/core/lib/Thelia/Form/TemplateCreationForm.php index 82d3560eb..1b3ac55a5 100644 --- a/core/lib/Thelia/Form/TemplateCreationForm.php +++ b/core/lib/Thelia/Form/TemplateCreationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Form/TemplateModificationForm.php b/core/lib/Thelia/Form/TemplateModificationForm.php index 96e681350..af7daba1b 100644 --- a/core/lib/Thelia/Form/TemplateModificationForm.php +++ b/core/lib/Thelia/Form/TemplateModificationForm.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Form; use Symfony\Component\Validator\Constraints; diff --git a/core/lib/Thelia/Install/BaseInstall.php b/core/lib/Thelia/Install/BaseInstall.php index 2e602b1b6..ec8feaefa 100644 --- a/core/lib/Thelia/Install/BaseInstall.php +++ b/core/lib/Thelia/Install/BaseInstall.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Install; use Thelia\Install\Exception\AlreadyInstallException; diff --git a/core/lib/Thelia/Install/CheckDatabaseConnection.php b/core/lib/Thelia/Install/CheckDatabaseConnection.php index 4a6d4a33b..26e8450ee 100644 --- a/core/lib/Thelia/Install/CheckDatabaseConnection.php +++ b/core/lib/Thelia/Install/CheckDatabaseConnection.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Install; diff --git a/core/lib/Thelia/Install/CheckPermission.php b/core/lib/Thelia/Install/CheckPermission.php index a0e1c3db8..9cc1261f2 100644 --- a/core/lib/Thelia/Install/CheckPermission.php +++ b/core/lib/Thelia/Install/CheckPermission.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Install; diff --git a/core/lib/Thelia/Install/Database.php b/core/lib/Thelia/Install/Database.php index cefd3ef65..9f45e9253 100644 --- a/core/lib/Thelia/Install/Database.php +++ b/core/lib/Thelia/Install/Database.php @@ -1,28 +1,22 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Install; +use Propel\Runtime\Connection\ConnectionInterface; +use Propel\Runtime\Connection\ConnectionWrapper; +use Propel\Runtime\Propel; +use Propel\Runtime\ServiceContainer\ServiceContainerInterface; + /** * Class Database * @package Thelia\Install @@ -30,10 +24,34 @@ namespace Thelia\Install; */ class Database { - public $connection; + /** + * @var \PDO + */ + protected $connection; - public function __construct(\PDO $connection) + /** + * Create a new instance, using the provided connection information, either none for + * automatically a connection, a ConnectionWrapper instance (through ConnectionInterface) or a PDO connection. + * + * @param ConnectionInterface|\PDO|null $connection the connection object + * @throws \InvalidArgumentException if $connection is not of the suitable type. + */ + public function __construct($connection = null) { + // Get a connection from Propel if we don't have one + if (null == $connection) { + $connection = Propel::getConnection(ServiceContainerInterface::CONNECTION_WRITE); + } + + // Get the PDO connection from an + if ($connection instanceof ConnectionWrapper) { + $connection = $connection->getWrappedConnection(); + } + + if (!$connection instanceof \PDO) { + throw new \InvalidArgumentException("A PDO connection shoud be provided"); + } + $this->connection = $connection; } @@ -55,8 +73,8 @@ class Database if (null === $extraSqlFiles) { $sql = array_merge( $sql, - $this->prepareSql(file_get_contents(THELIA_ROOT . '/install/thelia.sql')), - $this->prepareSql(file_get_contents(THELIA_ROOT . '/install/insert.sql')) + $this->prepareSql(file_get_contents(THELIA_ROOT . '/setup/thelia.sql')), + $this->prepareSql(file_get_contents(THELIA_ROOT . '/setup/insert.sql')) ); } else { foreach ($extraSqlFiles as $fileToInsert) { @@ -67,13 +85,35 @@ class Database } } $size = count($sql); - for ($i = 0; $i < $size; $i ++) { + for ($i = 0; $i < $size; $i++) { if (!empty($sql[$i])) { - $this->connection->query($sql[$i]); + $this->execute($sql[$i]); } } } + /** + * A simple wrapper around PDO::exec + * + * @param string $sql SQL query + * @param array $args SQL request parameters (PDO style) + * @throws \RuntimeException|\PDOException if something goes wrong. + */ + public function execute($sql, $args = array()) + { + $stmt = $this->connection->prepare($sql); + + if ($stmt === false) { + throw new \RuntimeException("Failed to prepare statement for $sql: " . print_r($this->connection->errorInfo(), 1)); + } + + $success = $stmt->execute($args); + + if ($success === false || $stmt->errorCode() != 0) { + throw new \RuntimeException("Failed to execute SQL '$sql', arguments:" . print_r($args,1).", error:".print_r($stmt->errorInfo(), 1)); + } + } + /** * Separate each sql instruction in an array * @@ -88,7 +128,7 @@ class Database $tab = explode(";\n", $sql); $size = count($tab); - for ($i=0; $i<$size; $i++) { + for ($i = 0; $i < $size; $i++) { $queryTemp = str_replace("-CODE-", ";',", $tab[$i]); $queryTemp = str_replace("|", ";", $queryTemp); $query[] = $queryTemp; @@ -104,7 +144,7 @@ class Database */ public function createDatabase($dbName) { - $this->connection->exec( + $this->execute( sprintf( "CREATE DATABASE IF NOT EXISTS %s CHARACTER SET utf8", $dbName diff --git a/core/lib/Thelia/Install/Exception/AlreadyInstallException.php b/core/lib/Thelia/Install/Exception/AlreadyInstallException.php index b2ff1555e..b1c6af986 100644 --- a/core/lib/Thelia/Install/Exception/AlreadyInstallException.php +++ b/core/lib/Thelia/Install/Exception/AlreadyInstallException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Install\Exception; diff --git a/core/lib/Thelia/Install/Exception/InstallException.php b/core/lib/Thelia/Install/Exception/InstallException.php index 2d0f45fe4..208953242 100644 --- a/core/lib/Thelia/Install/Exception/InstallException.php +++ b/core/lib/Thelia/Install/Exception/InstallException.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Install\Exception; /** diff --git a/core/lib/Thelia/Install/Exception/UpToDateException.php b/core/lib/Thelia/Install/Exception/UpToDateException.php index e7401fe88..f28dbbf78 100644 --- a/core/lib/Thelia/Install/Exception/UpToDateException.php +++ b/core/lib/Thelia/Install/Exception/UpToDateException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Install\Exception; diff --git a/core/lib/Thelia/Install/Update.php b/core/lib/Thelia/Install/Update.php index d80fe294a..4deb768d2 100644 --- a/core/lib/Thelia/Install/Update.php +++ b/core/lib/Thelia/Install/Update.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Install; @@ -42,6 +31,8 @@ class Update '2' => '2.0.0-beta3', '3' => '2.0.0-beta4', '4' => '2.0.0-RC1', + '5' => '2.0.0', + '6' => '2.0.1', ); protected function isLatestVersion($version) @@ -93,9 +84,9 @@ class Update protected function updateToVersion($version, Database $database,Tlog $logger) { - if (file_exists(THELIA_ROOT . '/install/update/'.$version.'.sql')) { + if (file_exists(THELIA_ROOT . '/setup/update/'.$version.'.sql')) { $logger->debug(sprintf('inserting file %s', $version.'$sql')); - $database->insertSql(null, array(THELIA_ROOT . '/install/update/'.$version.'.sql')); + $database->insertSql(null, array(THELIA_ROOT . '/setup/update/'.$version.'.sql')); $logger->debug(sprintf('end inserting file %s', $version.'$sql')); } diff --git a/core/lib/Thelia/Log/AbstractTlogDestination.php b/core/lib/Thelia/Log/AbstractTlogDestination.php index 6c4fd2aff..400c8b911 100644 --- a/core/lib/Thelia/Log/AbstractTlogDestination.php +++ b/core/lib/Thelia/Log/AbstractTlogDestination.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Log; diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationFile.php b/core/lib/Thelia/Log/Destination/TlogDestinationFile.php index ff5119131..b49d36710 100644 --- a/core/lib/Thelia/Log/Destination/TlogDestinationFile.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationFile.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Log\Destination; diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationHtml.php b/core/lib/Thelia/Log/Destination/TlogDestinationHtml.php index 7d0be3fa8..0010ccc6f 100644 --- a/core/lib/Thelia/Log/Destination/TlogDestinationHtml.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationHtml.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Log\Destination; diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php b/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php index e1f3444a5..b781769d3 100644 --- a/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php @@ -1,24 +1,13 @@ . */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ /* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Log\Destination; diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationNull.php b/core/lib/Thelia/Log/Destination/TlogDestinationNull.php index b78d24258..bdfa786eb 100644 --- a/core/lib/Thelia/Log/Destination/TlogDestinationNull.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationNull.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Log\Destination; diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php b/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php index 547a24c85..2aacfb0d9 100644 --- a/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php @@ -1,24 +1,13 @@ . */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ /* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Log\Destination; diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationRotatingFile.php b/core/lib/Thelia/Log/Destination/TlogDestinationRotatingFile.php index 4e0c3e94e..30e10de3c 100644 --- a/core/lib/Thelia/Log/Destination/TlogDestinationRotatingFile.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationRotatingFile.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Log\Destination; diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationText.php b/core/lib/Thelia/Log/Destination/TlogDestinationText.php index 00dca3ddd..7df20c0b7 100644 --- a/core/lib/Thelia/Log/Destination/TlogDestinationText.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationText.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Log\Destination; diff --git a/core/lib/Thelia/Log/Tlog.php b/core/lib/Thelia/Log/Tlog.php index 1eaf64350..1aade8a5c 100644 --- a/core/lib/Thelia/Log/Tlog.php +++ b/core/lib/Thelia/Log/Tlog.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Log; @@ -124,6 +113,20 @@ class Tlog Implements LoggerInterface return self::$instance; } + /** + * Create a new Tlog instance, that could be configured without interfering with the "main" instance + * + * @return Tlog a new Tlog instance. + */ + public static function getNewInstance() + { + $instance = new Tlog(); + + $instance->init(); + + return $instance; + } + /** * initialize default configuration */ diff --git a/core/lib/Thelia/Log/TlogDestinationConfig.php b/core/lib/Thelia/Log/TlogDestinationConfig.php index cbc56fd33..9a6938c50 100644 --- a/core/lib/Thelia/Log/TlogDestinationConfig.php +++ b/core/lib/Thelia/Log/TlogDestinationConfig.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Log; diff --git a/core/lib/Thelia/Log/TlogInterface.php b/core/lib/Thelia/Log/TlogInterface.php deleted file mode 100644 index 8dfe9e7c1..000000000 --- a/core/lib/Thelia/Log/TlogInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -. */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Mailer; diff --git a/core/lib/Thelia/Model/Admin.php b/core/lib/Thelia/Model/Admin.php index 355258336..bba191cd1 100644 --- a/core/lib/Thelia/Model/Admin.php +++ b/core/lib/Thelia/Model/Admin.php @@ -27,6 +27,11 @@ class Admin extends BaseAdmin implements UserInterface { use ModelEventDispatcherTrait; + /** + * Retrieve all permissions for the current admin + * + * @return array|string + */ public function getPermissions() { $profileId = $this->getProfileId(); @@ -105,7 +110,7 @@ class Admin extends BaseAdmin implements UserInterface */ public function eraseCredentials() { - $this->setPassword(null); + parent::setPassword(null); } /** diff --git a/core/lib/Thelia/Model/AreaDeliveryModule.php b/core/lib/Thelia/Model/AreaDeliveryModule.php index 206625a12..39aed03e3 100644 --- a/core/lib/Thelia/Model/AreaDeliveryModule.php +++ b/core/lib/Thelia/Model/AreaDeliveryModule.php @@ -4,7 +4,7 @@ namespace Thelia\Model; use Thelia\Model\Base\AreaDeliveryModule as BaseAreaDeliveryModule; - class AreaDeliveryModule extends BaseAreaDeliveryModule +class AreaDeliveryModule extends BaseAreaDeliveryModule { } diff --git a/core/lib/Thelia/Model/AreaDeliveryModuleQuery.php b/core/lib/Thelia/Model/AreaDeliveryModuleQuery.php index 416daa8c9..dfb58e863 100644 --- a/core/lib/Thelia/Model/AreaDeliveryModuleQuery.php +++ b/core/lib/Thelia/Model/AreaDeliveryModuleQuery.php @@ -17,4 +17,19 @@ use Thelia\Model\Base\AreaDeliveryModuleQuery as BaseAreaDeliveryModuleQuery; class AreaDeliveryModuleQuery extends BaseAreaDeliveryModuleQuery { + + public function findByCountryAndModule(Country $country, Module $module) + { + $response = null; + + if (null !== $country->getAreaId()) { + $response = $this->filterByAreaId($country->getAreaId()) + ->filterByModule($module) + ->findOne(); + + } + + return $response; + } + } // AreaDeliveryModuleQuery diff --git a/core/lib/Thelia/Model/Cart.php b/core/lib/Thelia/Model/Cart.php index 7cf66eeb3..aab17db46 100644 --- a/core/lib/Thelia/Model/Cart.php +++ b/core/lib/Thelia/Model/Cart.php @@ -4,11 +4,21 @@ namespace Thelia\Model; use Propel\Runtime\ActiveQuery\Criteria; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Thelia\Core\Event\Cart\CartItemDuplicationItem; +use Thelia\Core\Event\TheliaEvents; use Thelia\Model\Base\Cart as BaseCart; class Cart extends BaseCart { - public function duplicate($token, Customer $customer = null) + /** + * Duplicate the current existing cart. Only the token is changed + * + * @param $token + * @param Customer $customer + * @return Cart + */ + public function duplicate($token, Customer $customer = null, Currency $currency = null, EventDispatcherInterface $dispatcher) { $cartItems = $this->getCartItems(); @@ -16,11 +26,21 @@ class Cart extends BaseCart $cart->setAddressDeliveryId($this->getAddressDeliveryId()); $cart->setAddressInvoiceId($this->getAddressInvoiceId()); $cart->setToken($token); - // TODO : set current Currency - $cart->setCurrencyId($this->getCurrencyId()); + $discount = 0; + + if (null === $currency) { + $currencyQuery = CurrencyQuery::create(); + $currency = $currencyQuery->findPk($this->getCurrencyId()) ?: $currencyQuery->findOneByByDefault(1); + } + + $cart->setCurrency($currency); if ($customer) { $cart->setCustomer($customer); + + if ($customer->getDiscount() > 0) { + $discount = $customer->getDiscount(); + } } $cart->save(); @@ -40,28 +60,27 @@ class Cart extends BaseCart $item->setProductId($cartItem->getProductId()); $item->setQuantity($cartItem->getQuantity()); $item->setProductSaleElements($productSaleElements); - if ($currentDateTime <= $cartItem->getPriceEndOfLife()) { - $item->setPrice($cartItem->getPrice()) - ->setPromoPrice($cartItem->getPromoPrice()) - ->setPromo($productSaleElements->getPromo()) - // TODO : new price EOF or duplicate current priceEOF from $cartItem ? - ->setPriceEndOfLife($cartItem->getPriceEndOfLife()); - } else { - $productPrices = ProductPriceQuery::create()->filterByProductSaleElements($productSaleElements)->findOne(); + $prices = $productSaleElements->getPricesByCurrency($currency, $discount); + $item + ->setPrice($prices->getPrice()) + ->setPromoPrice($prices->getPromoPrice()) + ->setPromo($productSaleElements->getPromo()); - $item->setPrice($productPrices->getPrice()) - ->setPromoPrice($productPrices->getPromoPrice()) - ->setPromo($productSaleElements->getPromo()) - ->setPriceEndOfLife(time() + ConfigQuery::read("cart.priceEOF", 60*60*24*30)); - } $item->save(); + $dispatcher->dispatch(TheliaEvents::CART_ITEM_DUPLICATE, new CartItemDuplicationItem($item, $cartItem)); } } + $this->delete(); return $cart; } + /** + * Retrieve the last item added in the cart + * + * @return CartItem + */ public function getLastCartItemAdded() { return CartItemQuery::create() @@ -71,6 +90,18 @@ class Cart extends BaseCart ; } + /** + * + * Retrieve the total taxed amount. + * + * By default, the total include the discount + * + * /!\ The postage amount is not available so it's the total with or without discount an without postage + * + * @param Country $country + * @param bool $discount + * @return float|int + */ public function getTaxedAmount(Country $country, $discount = true) { $total = 0; @@ -86,7 +117,13 @@ class Cart extends BaseCart return $total; } - public function getTotalAmount() + /** + * + * @see getTaxedAmount same as this method but the amount is without taxes + * @param bool $discount + * @return float|int + */ + public function getTotalAmount($discount = true) { $total = 0; @@ -97,11 +134,18 @@ class Cart extends BaseCart $total += $subtotal; } - $total -= $this->getDiscount(); + if ($discount) { + $total -= $this->getDiscount(); + } return $total; } + /** + * Retrieve the total weight for all products in cart + * + * @return float|int + */ public function getWeight() { $weight = 0; diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php index 82f029e61..c5ab471a5 100644 --- a/core/lib/Thelia/Model/Category.php +++ b/core/lib/Thelia/Model/Category.php @@ -36,6 +36,8 @@ class Category extends BaseCategory * * count all products for current category and sub categories * + * /!\ the number of queries is exponential, use it with caution + * * @return int */ public function countAllProducts() diff --git a/core/lib/Thelia/Model/CategoryImageI18n.php b/core/lib/Thelia/Model/CategoryImageI18n.php index 5cfb7577b..3d001c6ad 100644 --- a/core/lib/Thelia/Model/CategoryImageI18n.php +++ b/core/lib/Thelia/Model/CategoryImageI18n.php @@ -4,7 +4,7 @@ namespace Thelia\Model; use Thelia\Model\Base\CategoryImageI18n as BaseCategoryImageI18n; - class CategoryImageI18n extends BaseCategoryImageI18n +class CategoryImageI18n extends BaseCategoryImageI18n { } diff --git a/core/lib/Thelia/Model/ConfigQuery.php b/core/lib/Thelia/Model/ConfigQuery.php index 77653ade1..31c56e229 100644 --- a/core/lib/Thelia/Model/ConfigQuery.php +++ b/core/lib/Thelia/Model/ConfigQuery.php @@ -18,6 +18,16 @@ class ConfigQuery extends BaseConfigQuery { protected static $cache = array(); + /** + * + * Find a config variable and return the value or default value if not founded. + * + * Use this method for better performance, a cache is created for each variable already searched + * + * @param $search + * @param null $default + * @return mixed + */ public static function read($search, $default = null) { if (array_key_exists($search, self::$cache)) { @@ -125,12 +135,12 @@ class ConfigQuery extends BaseConfigQuery public static function getSmtpPassword() { - return self::read('smtp.authmode'); + return self::read('smtp.password'); } public static function getSmtpAuthMode() { - return self::read('smtp.host'); + return self::read('smtp.authmode'); } public static function getSmtpTimeout() diff --git a/core/lib/Thelia/Model/Content.php b/core/lib/Thelia/Model/Content.php index 983580540..d40ba286a 100644 --- a/core/lib/Thelia/Model/Content.php +++ b/core/lib/Thelia/Model/Content.php @@ -2,6 +2,7 @@ namespace Thelia\Model; +use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\Propel; use Thelia\Core\Event\Content\ContentEvent; use Thelia\Core\Event\TheliaEvents; @@ -32,8 +33,14 @@ class Content extends BaseContent */ protected function addCriteriaToPositionQuery($query) { - // TODO: Find the default folder for this content, - // and generate the position relative to this folder + $contents = ContentFolderQuery::create() + ->filterByFolderId($this->getDefaultFolderId()) + ->filterByDefaultFolder(true) + ->select('content_id') + ->find(); + + // Filtrer la requete sur ces produits + if ($contents != null) $query->filterById($contents, Criteria::IN); } public function getDefaultFolderId() diff --git a/core/lib/Thelia/Model/Country.php b/core/lib/Thelia/Model/Country.php index 1e7748f75..038bd5a61 100644 --- a/core/lib/Thelia/Model/Country.php +++ b/core/lib/Thelia/Model/Country.php @@ -16,6 +16,14 @@ class Country extends BaseCountry { use \Thelia\Model\Tools\ModelEventDispatcherTrait; + /** + * + * Put the current country as the default one. + * + * @throws \RuntimeException + * @throws \Exception + * @throws \Propel\Runtime\Exception\PropelException + */ public function toggleDefault() { if ($this->getId() === null) { diff --git a/core/lib/Thelia/Model/Coupon.php b/core/lib/Thelia/Model/Coupon.php index b0d860ba4..cced6beb7 100644 --- a/core/lib/Thelia/Model/Coupon.php +++ b/core/lib/Thelia/Model/Coupon.php @@ -1,223 +1,203 @@ -. */ -/* */ -/**********************************************************************************/ - -namespace Thelia\Model; - -use Propel\Runtime\Propel; -use Thelia\Model\Base\Coupon as BaseCoupon; -use Thelia\Model\Exception\InvalidArgumentException; -use Thelia\Model\Map\CouponTableMap; - -/** - * Used to provide an effect (mostly a discount) - * at the end of the Customer checkout tunnel - * It will be usable for a Customer only if it matches the Coupon criteria (Rules) - * - * @package Coupon - * @author Guillaume MOREL - * - */ -class Coupon extends BaseCoupon -{ - - use \Thelia\Model\Tools\ModelEventDispatcherTrait; - - /** - * Create or Update this Coupon - * - * @param string $code Coupon Code - * @param string $title Coupon title - * @param array $effects Ready to be serialized in JSON effect params - * @param string $type Coupon type - * @param bool $isRemovingPostage Is removing Postage - * @param string $shortDescription Coupon short description - * @param string $description Coupon description - * @param boolean $isEnabled Enable/Disable - * @param \DateTime $expirationDate Coupon expiration date - * @param boolean $isAvailableOnSpecialOffers Is available on special offers - * @param boolean $isCumulative Is cumulative - * @param int $maxUsage Coupon quantity - * @param string $defaultSerializedRule Serialized default rule added if none found - * @param string $locale Coupon Language code ISO (ex: fr_FR) - * - * @throws \Exception - */ - public function createOrUpdate($code, $title, array $effects, $type, $isRemovingPostage, $shortDescription, $description, $isEnabled, $expirationDate, $isAvailableOnSpecialOffers, $isCumulative, $maxUsage, $defaultSerializedRule, $locale = null) - { - $this->setCode($code) - ->setType($type) - ->setEffects($effects) - ->setIsRemovingPostage($isRemovingPostage) - ->setIsEnabled($isEnabled) - ->setExpirationDate($expirationDate) - ->setIsAvailableOnSpecialOffers($isAvailableOnSpecialOffers) - ->setIsCumulative($isCumulative) - ->setMaxUsage($maxUsage); - $this->setTitle($title) - ->setShortDescription($shortDescription) - ->setDescription($description); - - // If no rule given, set default rule - if (null === $this->getSerializedConditions()) { - $this->setSerializedConditions($defaultSerializedRule); - } - - // Set object language (i18n) - if (!is_null($locale)) { - $this->setLocale($locale); - } - - $con = Propel::getWriteConnection(CouponTableMap::DATABASE_NAME); - $con->beginTransaction(); - try { - $this->save($con); - $con->commit(); - - } catch (\Exception $e) { - $con->rollback(); - throw $e; - } - } - - /** - * Create or Update this coupon condition - * - * @param string $serializableConditions Serialized conditions ready to be saved - * @param string $locale Coupon Language code ISO (ex: fr_FR) - * - * @throws \Exception - */ - public function createOrUpdateConditions($serializableConditions, $locale) - { - $this->setSerializedConditions($serializableConditions); - - // Set object language (i18n) - if (!is_null($locale)) { - $this->setLocale($locale); - } - - $con = Propel::getWriteConnection(CouponTableMap::DATABASE_NAME); - $con->beginTransaction(); - try { - $this->save($con); - $con->commit(); - } catch (\Exception $e) { - $con->rollback(); - throw $e; - } - } - - /** - * Set Coupon amount - * - * @param float $amount Amount deduced from the Cart - * - * @return $this - */ - public function setAmount($amount) - { - $effects = $this->unserializeEffects($this->getSerializedEffects()); - $effects['amount'] = floatval($amount); - $this->setEffects($effects); - - return $this; - } - - /** - * Get the amount removed from the coupon to the cart - * - * @return float - */ - public function getAmount() - { - $amount = $this->getEffects()['amount']; - - return floatval($amount); - } - - /** - * Get the Coupon effects - * - * @return array - * @throws Exception\InvalidArgumentException - */ - public function getEffects() - { - $effects = $this->unserializeEffects($this->getSerializedEffects()); - - if (null === $effects['amount']) { - throw new InvalidArgumentException('Missing key \'amount\' in Coupon effect coming from database'); - } - - return $effects; - } - - /** - * Get the Coupon effects - * - * @param array $effects Effect ready to be serialized - * Needs at least the key 'amount' - * with the amount removed from the cart - * - * @throws Exception\InvalidArgumentException - * @return $this - */ - public function setEffects(array $effects) - { - if (null === $effects['amount']) { - throw new InvalidArgumentException('Missing key \'amount\' in Coupon effect ready to be serialized array'); - } - - $this->setSerializedEffects($this->serializeEffects($effects)); - - return $this; - } - - /** - * Return unserialized effects - * - * @param string $serializedEffects Serialized effect string to unserialize - * - * @return array - */ - public function unserializeEffects($serializedEffects) - { - $effects = json_decode($serializedEffects, true); - - return $effects; - } - - /** - * Return serialized effects - * - * @param array $unserializedEffects Unserialized array string to serialize - * - * @return string - */ - public function serializeEffects(array $unserializedEffects) - { - $effects = json_encode($unserializedEffects); - - return $effects; - } -} +. */ +/* */ +/**********************************************************************************/ + +namespace Thelia\Model; + +use Propel\Runtime\Propel; +use Thelia\Model\Base\Coupon as BaseCoupon; +use Thelia\Model\Exception\InvalidArgumentException; +use Thelia\Model\Map\CouponTableMap; + +/** + * Used to provide an effect (mostly a discount) + * at the end of the Customer checkout tunnel + * It will be usable for a Customer only if it matches the Coupon criteria (Rules) + * + * @package Coupon + * @author Guillaume MOREL + * + */ +class Coupon extends BaseCoupon +{ + + use \Thelia\Model\Tools\ModelEventDispatcherTrait; + + /** + * Create or Update this Coupon + * + * @param string $code Coupon Code + * @param string $title Coupon title + * @param array $effects Ready to be serialized in JSON effect params + * @param string $type Coupon type + * @param bool $isRemovingPostage Is removing Postage + * @param string $shortDescription Coupon short description + * @param string $description Coupon description + * @param boolean $isEnabled Enable/Disable + * @param \DateTime $expirationDate Coupon expiration date + * @param boolean $isAvailableOnSpecialOffers Is available on special offers + * @param boolean $isCumulative Is cumulative + * @param int $maxUsage Coupon quantity + * @param string $defaultSerializedRule Serialized default rule added if none found + * @param string $locale Coupon Language code ISO (ex: fr_FR) + * + * @throws \Exception + */ + public function createOrUpdate($code, $title, array $effects, $type, $isRemovingPostage, $shortDescription, $description, $isEnabled, $expirationDate, $isAvailableOnSpecialOffers, $isCumulative, $maxUsage, $defaultSerializedRule, $locale = null) + { + $this + ->setCode($code) + ->setType($type) + ->setEffects($effects) + ->setIsRemovingPostage($isRemovingPostage) + ->setIsEnabled($isEnabled) + ->setExpirationDate($expirationDate) + ->setIsAvailableOnSpecialOffers($isAvailableOnSpecialOffers) + ->setIsCumulative($isCumulative) + ->setMaxUsage($maxUsage) + ->setLocale($locale) + ->setTitle($title) + ->setShortDescription($shortDescription) + ->setDescription($description); + + // If no rule given, set default rule + if (null === $this->getSerializedConditions()) { + $this->setSerializedConditions($defaultSerializedRule); + } + + $this->save(); + } + + /** + * Create or Update this coupon condition + * + * @param string $serializableConditions Serialized conditions ready to be saved + * @param string $locale Coupon Language code ISO (ex: fr_FR) + * + * @throws \Exception + */ + public function createOrUpdateConditions($serializableConditions, $locale) + { + $this->setSerializedConditions($serializableConditions); + + // Set object language (i18n) + if (!is_null($locale)) { + $this->setLocale($locale); + } + + $this->save(); + } + + /** + * Set Coupon amount + * + * @param float $amount Amount deduced from the Cart + * + * @return $this + */ + public function setAmount($amount) + { + $effects = $this->unserializeEffects($this->getSerializedEffects()); + $effects['amount'] = floatval($amount); + $this->setEffects($effects); + + return $this; + } + + /** + * Get the amount removed from the coupon to the cart + * + * @return float + */ + public function getAmount() + { + $amount = $this->getEffects()['amount']; + + return floatval($amount); + } + + /** + * Get the Coupon effects + * + * @return array + * @throws Exception\InvalidArgumentException + */ + public function getEffects() + { + $effects = $this->unserializeEffects($this->getSerializedEffects()); + + if (null === $effects['amount']) { + throw new InvalidArgumentException('Missing key \'amount\' in Coupon effect coming from database'); + } + + return $effects; + } + + /** + * Get the Coupon effects + * + * @param array $effects Effect ready to be serialized + * Needs at least the key 'amount' + * with the amount removed from the cart + * + * @throws Exception\InvalidArgumentException + * @return $this + */ + public function setEffects(array $effects) + { + if (null === $effects['amount']) { + throw new InvalidArgumentException('Missing key \'amount\' in Coupon effect ready to be serialized array'); + } + + $this->setSerializedEffects($this->serializeEffects($effects)); + + return $this; + } + + /** + * Return unserialized effects + * + * @param string $serializedEffects Serialized effect string to unserialize + * + * @return array + */ + public function unserializeEffects($serializedEffects) + { + $effects = json_decode($serializedEffects, true); + + return $effects; + } + + /** + * Return serialized effects + * + * @param array $unserializedEffects Unserialized array string to serialize + * + * @return string + */ + public function serializeEffects(array $unserializedEffects) + { + $effects = json_encode($unserializedEffects); + + return $effects; + } +} diff --git a/core/lib/Thelia/Model/Customer.php b/core/lib/Thelia/Model/Customer.php index 4d4b3ebfa..c44fc0e61 100644 --- a/core/lib/Thelia/Model/Customer.php +++ b/core/lib/Thelia/Model/Customer.php @@ -129,7 +129,7 @@ class Customer extends BaseCustomer implements UserInterface protected function generateRef() { - return uniqid(substr($this->getLastname(), 0, (strlen($this->getLastname()) >= 3) ? 3 : strlen($this->getLastname())), true); + return sprintf('CUS%s', str_pad($this->getId(), 12, 0, STR_PAD_LEFT)); } /** @@ -143,6 +143,15 @@ class Customer extends BaseCustomer implements UserInterface ->findOne(); } + public function setRef($v) + { + if (null !== $v) { + parent::setRef($v); + } + + return $this; + } + /** * create hash for plain password and set it in Customer object * @@ -164,7 +173,7 @@ class Customer extends BaseCustomer implements UserInterface return $this; } - +/* public function setRef($ref) { if (null === $ref && null === $this->ref) { @@ -174,7 +183,7 @@ class Customer extends BaseCustomer implements UserInterface } return $this; - } + }*/ public function setEmail($email, $force = false) { @@ -212,7 +221,8 @@ class Customer extends BaseCustomer implements UserInterface */ public function eraseCredentials() { - $this->setPassword(null); + parent::setPassword(null); + $this->resetModified(); } /** @@ -272,10 +282,6 @@ class Customer extends BaseCustomer implements UserInterface // Set the serial number (for auto-login) $this->setRememberMeSerial(uniqid()); - if (null === $this->ref) { - $this->setRef($this->generateRef()); - } - $this->dispatchEvent(TheliaEvents::BEFORE_CREATECUSTOMER, new CustomerEvent($this)); return true; @@ -286,6 +292,11 @@ class Customer extends BaseCustomer implements UserInterface */ public function postInsert(ConnectionInterface $con = null) { + if (null === $this->getRef()) { + $this->setRef($this->generateRef()) + ->save($con); + } + $this->dispatchEvent(TheliaEvents::AFTER_CREATECUSTOMER, new CustomerEvent($this)); } diff --git a/core/lib/Thelia/Model/Exception/InvalidArgumentException.php b/core/lib/Thelia/Model/Exception/InvalidArgumentException.php index ab8ca49c9..f6caf1761 100644 --- a/core/lib/Thelia/Model/Exception/InvalidArgumentException.php +++ b/core/lib/Thelia/Model/Exception/InvalidArgumentException.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Model\Exception; diff --git a/core/lib/Thelia/Model/Exception/ModelException.php b/core/lib/Thelia/Model/Exception/ModelException.php index 505a3068c..c315bf682 100644 --- a/core/lib/Thelia/Model/Exception/ModelException.php +++ b/core/lib/Thelia/Model/Exception/ModelException.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Model\Exception; class ModelException extends \RuntimeException diff --git a/core/lib/Thelia/Model/Lang.php b/core/lib/Thelia/Model/Lang.php index a6a138a65..a0baa80c2 100644 --- a/core/lib/Thelia/Model/Lang.php +++ b/core/lib/Thelia/Model/Lang.php @@ -122,4 +122,10 @@ class Lang extends BaseLang $this->dispatchEvent(TheliaEvents::AFTER_DELETELANG, new LangEvent($this)); } + public function preSave(ConnectionInterface $con = null) + { + $this->setDatetimeFormat(sprintf("%s %s", $this->getDateFormat(), $this->getTimeFormat())); + + return true; + } } diff --git a/core/lib/Thelia/Model/Map/CustomerTableMap.php b/core/lib/Thelia/Model/Map/CustomerTableMap.php index 14e14e330..795a4af03 100644 --- a/core/lib/Thelia/Model/Map/CustomerTableMap.php +++ b/core/lib/Thelia/Model/Map/CustomerTableMap.php @@ -202,7 +202,7 @@ class CustomerTableMap extends TableMap $this->setUseIdGenerator(true); // columns $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addColumn('REF', 'Ref', 'VARCHAR', true, 50, null); + $this->addColumn('REF', 'Ref', 'VARCHAR', false, 50, null); $this->addForeignKey('TITLE_ID', 'TitleId', 'INTEGER', 'customer_title', 'ID', true, null, null); $this->addColumn('FIRSTNAME', 'Firstname', 'VARCHAR', true, 255, null); $this->addColumn('LASTNAME', 'Lastname', 'VARCHAR', true, 255, null); diff --git a/core/lib/Thelia/Model/Map/OrderTableMap.php b/core/lib/Thelia/Model/Map/OrderTableMap.php index 28613da80..2246af89c 100644 --- a/core/lib/Thelia/Model/Map/OrderTableMap.php +++ b/core/lib/Thelia/Model/Map/OrderTableMap.php @@ -217,7 +217,7 @@ class OrderTableMap extends TableMap $this->setUseIdGenerator(true); // columns $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addColumn('REF', 'Ref', 'VARCHAR', true, 45, null); + $this->addColumn('REF', 'Ref', 'VARCHAR', false, 45, null); $this->addForeignKey('CUSTOMER_ID', 'CustomerId', 'INTEGER', 'customer', 'ID', true, null, null); $this->addForeignKey('INVOICE_ORDER_ADDRESS_ID', 'InvoiceOrderAddressId', 'INTEGER', 'order_address', 'ID', true, null, null); $this->addForeignKey('DELIVERY_ORDER_ADDRESS_ID', 'DeliveryOrderAddressId', 'INTEGER', 'order_address', 'ID', true, null, null); diff --git a/core/lib/Thelia/Model/Message.php b/core/lib/Thelia/Model/Message.php index 168136f3c..b96887d07 100644 --- a/core/lib/Thelia/Model/Message.php +++ b/core/lib/Thelia/Model/Message.php @@ -2,6 +2,7 @@ namespace Thelia\Model; +use Thelia\Core\Template\Exception\ResourceNotFoundException; use Thelia\Model\Base\Message as BaseMessage; use Propel\Runtime\Connection\ConnectionInterface; use Thelia\Core\Event\TheliaEvents; @@ -74,13 +75,13 @@ class Message extends BaseMessage { $body = false; - $mail_template_path = TemplateHelper::getInstance()->getActiveMailTemplate()->getAbsolutePath() . DS; + //$mail_template_path = TemplateHelper::getInstance()->getActiveMailTemplate()->getAbsolutePath() . DS; // Try to get the body from template file, if a file is defined if (! empty($template)) { try { - $body = $parser->render($mail_template_path . $template); + $body = $parser->render($template); } catch (ResourceNotFoundException $ex) { // Ignore this. } @@ -98,7 +99,7 @@ class Message extends BaseMessage $parser->assign('message_body', $body); // Render the layout file - $body = $parser->render($mail_template_path . $layout); + $body = $parser->render($layout); } return $body; @@ -136,6 +137,7 @@ class Message extends BaseMessage */ public function buildMessage($parser, \Swift_Message $messageInstance) { + $parser->setTemplateDefinition(TemplateHelper::getInstance()->getActiveMailTemplate()); $subject = $parser->fetch(sprintf("string:%s", $this->getSubject())); $htmlMessage = $this->getHtmlMessageBody($parser); $textMessage = $this->getTextMessageBody($parser); diff --git a/core/lib/Thelia/Model/Module.php b/core/lib/Thelia/Model/Module.php index 65ea065d9..c5b7257c3 100644 --- a/core/lib/Thelia/Model/Module.php +++ b/core/lib/Thelia/Model/Module.php @@ -3,20 +3,80 @@ namespace Thelia\Model; use Propel\Runtime\Connection\ConnectionInterface; +use Thelia\Core\Template\TemplateDefinition; use Thelia\Model\Base\Module as BaseModule; use Thelia\Model\Tools\ModelEventDispatcherTrait; +use Thelia\Model\Tools\PositionManagementTrait; class Module extends BaseModule { use ModelEventDispatcherTrait; - use \Thelia\Model\Tools\PositionManagementTrait; + use PositionManagementTrait; + + const ADMIN_INCLUDES_DIRECTORY_NAME = "AdminIncludes"; public function postSave(ConnectionInterface $con = null) { ModuleQuery::resetActivated(); } + public function getTranslationDomain() + { + return strtolower($this->getCode()); + } + + public function getAdminIncludesTranslationDomain() + { + return $this->getTranslationDomain().'.ai'; + } + + public function getAbsoluteBackOfficeTemplatePath($subdir) + { + return sprintf("%s".DS."%s".DS."%s", + $this->getAbsoluteTemplateBasePath(), + TemplateDefinition::BACK_OFFICE_SUBDIR, + $subdir + ); + } + + public function getAbsoluteBackOfficeI18nTemplatePath($subdir) + { + return sprintf("%s".DS."%s".DS."%s", + $this->getAbsoluteI18nPath(), + TemplateDefinition::BACK_OFFICE_SUBDIR, + $subdir + ); + } + + public function getBackOfficeTemplateTranslationDomain($templateName) + { + return $this->getTranslationDomain(). '.bo.' . $templateName; + } + + public function getAbsoluteFrontOfficeTemplatePath($subdir) + { + return sprintf("%s".DS."%s".DS."%s", + $this->getAbsoluteTemplateBasePath(), + TemplateDefinition::FRONT_OFFICE_SUBDIR, + $subdir + ); + } + + public function getAbsoluteFrontOfficeI18nTemplatePath($subdir) + { + return sprintf("%s".DS."%s".DS."%s", + $this->getAbsoluteI18nPath(), + TemplateDefinition::FRONT_OFFICE_SUBDIR, + $subdir + ); + } + + public function getFrontOfficeTemplateTranslationDomain($templateName) + { + return $this->getTranslationDomain(). '.fo.' . $templateName; + } + /** * @return the module's base directory path, relative to THELIA_MODULE_DIR */ @@ -65,14 +125,71 @@ class Module extends BaseModule return THELIA_MODULE_DIR . $this->getI18nPath(); } + /** + * @return the module's AdminIncludes absolute directory path + */ + public function getAbsoluteAdminIncludesPath() + { + return $this->getAbsoluteBaseDir() . DS . self::ADMIN_INCLUDES_DIRECTORY_NAME; + } + + /** + * @return the module's AdminIncludes i18N absolute directory path + */ + public function getAbsoluteAdminIncludesI18nPath() + { + return THELIA_MODULE_DIR . $this->getI18nPath() . DS . self::ADMIN_INCLUDES_DIRECTORY_NAME; + } + + /** + * Return the absolute path to the module's template directory + * + * @return string a path + */ + public function getAbsoluteTemplateBasePath() + { + return $this->getAbsoluteBaseDir() . DS . 'templates'; + } + /** * Return the absolute path to one of the module's template directories * - * @param int $templateSubdirName the name of the, probably one of TemplateDefinition::xxx_SUBDIR constants + * @param int $templateSubdirName the name of the, probably one of TemplateDefinition::xxx_SUBDIR constants + * @return string a path */ public function getAbsoluteTemplateDirectoryPath($templateSubdirName) { - return sprintf("%s%stemplates%s%s", $this->getAbsoluteBaseDir(), DS, DS, $templateSubdirName); + return $this->getAbsoluteTemplateBasePath() .DS. $templateSubdirName; + } + + /** + * @return true if this module is a delivery module + */ + public function isDeliveryModule() + { + $moduleReflection = new \ReflectionClass($this->getFullNamespace()); + + return $moduleReflection->implementsInterface("Thelia\Module\DeliveryModuleInterface"); + } + + /** + * @return true if this module is a payment module + */ + public function isPayementModule() + { + $moduleReflection = new \ReflectionClass($this->getFullNamespace()); + + return $moduleReflection->implementsInterface("Thelia\Module\PaymentModuleInterface"); + } + + /** + * @return BaseModule a new module instance. + */ + public function createInstance() + { + $moduleClass = new \ReflectionClass($this->getFullNamespace()); + + return $moduleClass->newInstance(); } /** diff --git a/core/lib/Thelia/Model/ModuleQuery.php b/core/lib/Thelia/Model/ModuleQuery.php index dfe9b1b3c..c1f9394dd 100644 --- a/core/lib/Thelia/Model/ModuleQuery.php +++ b/core/lib/Thelia/Model/ModuleQuery.php @@ -25,6 +25,7 @@ class ModuleQuery extends BaseModuleQuery if (null === self::$activated) { self::$activated = self::create() ->filterByActivate(1) + ->orderByPosition() ->find(); } diff --git a/core/lib/Thelia/Model/Order.php b/core/lib/Thelia/Model/Order.php index f4b1b5abc..f19f29e03 100644 --- a/core/lib/Thelia/Model/Order.php +++ b/core/lib/Thelia/Model/Order.php @@ -23,8 +23,6 @@ class Order extends BaseOrder */ public function preInsert(ConnectionInterface $con = null) { - $this->setRef($this->generateRef()); - $this->dispatchEvent(TheliaEvents::ORDER_BEFORE_CREATE, new OrderEvent($this)); return true; @@ -35,22 +33,34 @@ class Order extends BaseOrder */ public function postInsert(ConnectionInterface $con = null) { + $this->setRef($this->generateRef()) + ->save($con); $this->dispatchEvent(TheliaEvents::ORDER_AFTER_CREATE, new OrderEvent($this)); } + public function postSave(ConnectionInterface $con = null) + { + if ($this->isPaid() && null === $this->getInvoiceDate()) { + $this + ->setInvoiceDate(time()) + ->save($con); + } + } + public function generateRef() { - /* order addresses are unique */ - - return uniqid('ORD', true); + return sprintf('ORD%s', str_pad($this->getId(), 12, 0, STR_PAD_LEFT)); } /** * Compute this order amount. * - * @param float $tax (output only) returns the tax amount for this order - * @param bool $includePostage if true, the postage cost is included to the total - * @param bool $includeDiscount if true, the discount will be included to the total + * The order amount amount is only avaible once the order is persisted in database. + * Duting invoice process, use all cart methods instead of order methods (the order doest not exists at this moment) + * + * @param float|int $tax (output only) returns the tax amount for this order + * @param bool $includePostage if true, the postage cost is included to the total + * @param bool $includeDiscount if true, the discount will be included to the total * @return float */ public function getTotalAmount(&$tax = 0, $includePostage = true, $includeDiscount = true) diff --git a/core/lib/Thelia/Model/OrderProduct.php b/core/lib/Thelia/Model/OrderProduct.php index b73ef9852..5f87cbc97 100644 --- a/core/lib/Thelia/Model/OrderProduct.php +++ b/core/lib/Thelia/Model/OrderProduct.php @@ -11,12 +11,32 @@ class OrderProduct extends BaseOrderProduct { use \Thelia\Model\Tools\ModelEventDispatcherTrait; + protected $cartIemId; + + /** + * @param mixed $cartIemId + */ + public function setCartIemId($cartIemId) + { + $this->cartIemId = $cartIemId; + + return $this; + } + + /** + * @return mixed + */ + public function getCartIemId() + { + return $this->cartIemId; + } + /** * {@inheritDoc} */ public function preInsert(ConnectionInterface $con = null) { - $this->dispatchEvent(TheliaEvents::ORDER_PRODUCT_BEFORE_CREATE, new OrderEvent($this->getOrder())); + $this->dispatchEvent(TheliaEvents::ORDER_PRODUCT_BEFORE_CREATE, (new OrderEvent($this->getOrder()))->setCartItemId($this->cartIemId)); return true; } @@ -26,6 +46,6 @@ class OrderProduct extends BaseOrderProduct */ public function postInsert(ConnectionInterface $con = null) { - $this->dispatchEvent(TheliaEvents::ORDER_PRODUCT_AFTER_CREATE, new OrderEvent($this->getOrder())); + $this->dispatchEvent(TheliaEvents::ORDER_PRODUCT_AFTER_CREATE, (new OrderEvent($this->getOrder()))->setCartItemId($this->cartIemId)); } } diff --git a/core/lib/Thelia/Model/OrderQuery.php b/core/lib/Thelia/Model/OrderQuery.php index d9b4ad8b4..459314b87 100644 --- a/core/lib/Thelia/Model/OrderQuery.php +++ b/core/lib/Thelia/Model/OrderQuery.php @@ -103,7 +103,7 @@ class OrderQuery extends BaseOrderQuery $query = self::create('o') ->filterByCreatedAt(sprintf("%s 00:00:00", $startDate->format('Y-m-d')), Criteria::GREATER_EQUAL) ->filterByCreatedAt(sprintf("%s 23:59:59", $endDate->format('Y-m-d')), Criteria::LESS_EQUAL) - ->filterByStatusId("2,3,4", Criteria::IN) + ->filterByStatusId([2,3,4], Criteria::IN) ->innerJoinOrderProduct() ->addJoinObject($orderTaxJoin) diff --git a/core/lib/Thelia/Model/OrderStatusQuery.php b/core/lib/Thelia/Model/OrderStatusQuery.php index c4ce4e325..46c6128e5 100644 --- a/core/lib/Thelia/Model/OrderStatusQuery.php +++ b/core/lib/Thelia/Model/OrderStatusQuery.php @@ -16,4 +16,30 @@ use Thelia\Model\Base\OrderStatusQuery as BaseOrderStatusQuery; */ class OrderStatusQuery extends BaseOrderStatusQuery { + + public static function getNotPaidStatus() + { + return OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_NOT_PAID); + } + + public static function getPaidStatus() + { + return OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_PAID); + } + + public static function getProcessingStatus() + { + return OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_PROCESSING); + } + + public static function getSentStatus() + { + return OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_SENT); + } + + public static function getCancelledStatus() + { + return OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_CANCELED); + } + } // OrderStatusQuery diff --git a/core/lib/Thelia/Model/Product.php b/core/lib/Thelia/Model/Product.php index a8d342f0e..2eb3fb584 100644 --- a/core/lib/Thelia/Model/Product.php +++ b/core/lib/Thelia/Model/Product.php @@ -214,6 +214,7 @@ class Product extends BaseProduct ->setPromoPrice($salePrice) ->setPrice($basePrice) ->setCurrencyId($currencyId) + ->setFromDefaultCurrency(false) ->save($con) ; diff --git a/core/lib/Thelia/Model/ProductSaleElements.php b/core/lib/Thelia/Model/ProductSaleElements.php index ec485d7a7..05398c041 100644 --- a/core/lib/Thelia/Model/ProductSaleElements.php +++ b/core/lib/Thelia/Model/ProductSaleElements.php @@ -3,14 +3,19 @@ namespace Thelia\Model; use Thelia\Model\Base\ProductSaleElements as BaseProductSaleElements; +use Thelia\Model\Tools\ProductPriceTools; use Thelia\TaxEngine\Calculator; class ProductSaleElements extends BaseProductSaleElements { - public function getPrice($virtualColumnName = 'price_PRICE') + public function getPrice($virtualColumnName = 'price_PRICE', $discount = 0) { try { $amount = $this->getVirtualColumn($virtualColumnName); + + if ($discount > 0) { + $amount = $amount * (1-($discount/100)); + } } catch (PropelException $e) { throw new PropelException("Virtual column `$virtualColumnName` does not exist in ProductSaleElements::getPrice"); } @@ -18,10 +23,14 @@ class ProductSaleElements extends BaseProductSaleElements return $amount; } - public function getPromoPrice($virtualColumnName = 'price_PROMO_PRICE') + public function getPromoPrice($virtualColumnName = 'price_PROMO_PRICE', $discount = 0) { try { $amount = $this->getVirtualColumn($virtualColumnName); + + if ($discount > 0) { + $amount = $amount * (1-($discount/100)); + } } catch (PropelException $e) { throw new PropelException("Virtual column `$virtualColumnName` does not exist in ProductSaleElements::getPromoPrice"); } @@ -29,17 +38,69 @@ class ProductSaleElements extends BaseProductSaleElements return $amount; } - public function getTaxedPrice(Country $country) + public function getTaxedPrice(Country $country , $virtualColumnName = 'price_PRICE', $discount = 0) { $taxCalculator = new Calculator(); - return round($taxCalculator->load($this->getProduct(), $country)->getTaxedPrice($this->getPrice()), 2); + return round($taxCalculator->load($this->getProduct(), $country)->getTaxedPrice($this->getPrice($virtualColumnName, $discount)), 2); } - public function getTaxedPromoPrice(Country $country) + public function getTaxedPromoPrice(Country $country, $virtualColumnName = 'price_PROMO_PRICE', $discount = 0) { $taxCalculator = new Calculator(); - return round($taxCalculator->load($this->getProduct(), $country)->getTaxedPrice($this->getPromoPrice()), 2); + return round($taxCalculator->load($this->getProduct(), $country)->getTaxedPrice($this->getPromoPrice($virtualColumnName, $discount)), 2); } + + /** + * Get product prices for a specific currency. + * + * When the currency is not the default currency, the product prices for this currency is : + * - calculated according to the product price of the default currency. It happens when no product price exists for + * the currency or when the `from_default_currency` flag is set to `true` + * - set directly in the product price when `from_default_currency` is set to `false` + * + * @param Currency $currency + * @return ProductPriceTools + * @throws \RuntimeException + */ + public function getPricesByCurrency(Currency $currency, $discount = 0) + { + $defaultCurrency = Currency::getDefaultCurrency(); + + $productPrice = ProductPriceQuery::create() + ->filterByProductSaleElementsId($this->getId()) + ->filterByCurrencyId($currency->getId()) + ->findOne(); + + $price = 0.0; + $promoPrice = 0.0; + + if (null === $productPrice || $productPrice->getFromDefaultCurrency()) { + // need to calculate the prices based on the product prices for the default currency + $productPrice = ProductPriceQuery::create() + ->filterByProductSaleElementsId($this->getId()) + ->filterByCurrencyId($defaultCurrency->getId()) + ->findOne(); + if (null !== $productPrice) { + $price = $productPrice->getPrice() * $currency->getRate() / $defaultCurrency->getRate(); + $promoPrice = $productPrice->getPromoPrice() * $currency->getRate() / $defaultCurrency->getRate(); + } else { + throw new \RuntimeException('Cannot find product prices for currency id: `' . $currency->getId() . '`'); + } + } else { + $price = $productPrice->getPrice(); + $promoPrice = $productPrice->getPromoPrice(); + } + + if ($discount > 0) { + $price = $price * (1-($discount/100)); + $promoPrice = $promoPrice * (1-($discount/100)); + } + + $productPriceTools = new ProductPriceTools($price, $promoPrice); + + return $productPriceTools; + } + } diff --git a/core/lib/Thelia/Model/Tools/ModelCriteriaTools.php b/core/lib/Thelia/Model/Tools/ModelCriteriaTools.php index bc2f72889..4e767a0a3 100644 --- a/core/lib/Thelia/Model/Tools/ModelCriteriaTools.php +++ b/core/lib/Thelia/Model/Tools/ModelCriteriaTools.php @@ -1,5 +1,14 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Model\Tools; @@ -53,6 +42,11 @@ trait ModelEventDispatcherTrait return $this->dispatcher; } + public function clearDispatcher() + { + $this->dispatcher = null; + } + protected function dispatchEvent($eventName, ActionEvent $event) { if (!is_null($this->dispatcher)) { diff --git a/core/lib/Thelia/Model/Tools/PositionManagementTrait.php b/core/lib/Thelia/Model/Tools/PositionManagementTrait.php index e96ae6f11..66ef33621 100644 --- a/core/lib/Thelia/Model/Tools/PositionManagementTrait.php +++ b/core/lib/Thelia/Model/Tools/PositionManagementTrait.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Model\Tools; diff --git a/core/lib/Thelia/Model/Tools/ProductPriceTools.php b/core/lib/Thelia/Model/Tools/ProductPriceTools.php new file mode 100644 index 000000000..d51a27982 --- /dev/null +++ b/core/lib/Thelia/Model/Tools/ProductPriceTools.php @@ -0,0 +1,60 @@ + + */ +class ProductPriceTools +{ + /** + * The value for the price field. + * + * @var double + */ + protected $price; + + /** + * The value for the promoPrice field. + * + * @var double + */ + protected $promoPrice; + + public function __construct($price, $promoPrice) + { + $this->price = $price; + $this->promoPrice = $promoPrice; + } + + /** + * @return float + */ + public function getPrice() + { + return $this->price; + } + + /** + * @return float + */ + public function getPromoPrice() + { + return $this->promoPrice; + } + +} diff --git a/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php b/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php index b02cf0c6d..79947074f 100644 --- a/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php +++ b/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Model\Tools; diff --git a/core/lib/Thelia/Module/AbstractDeliveryModule.php b/core/lib/Thelia/Module/AbstractDeliveryModule.php new file mode 100644 index 000000000..070b19cc1 --- /dev/null +++ b/core/lib/Thelia/Module/AbstractDeliveryModule.php @@ -0,0 +1,19 @@ +container->get("thelia.parser"); + + $parser->setTemplateDefinition(TemplateHelper::getInstance()->getActiveFrontTemplate()); + + $renderedTemplate = $parser->render( + "order-payment-gateway.html", + array( + "order_id" => $order->getId(), + "cart_count" => $this->getRequest()->getSession()->getCart()->getCartItems()->count(), + "gateway_url" => $gateway_url, + "payment_form_data" => $form_data + ) + ); + + return Response::create($renderedTemplate); + } + + /** + * Return the order payment success page URL + * + * @param int $order_id the order ID + * @return string the order payment success page URL + */ + public function getPaymentSuccessPageUrl($order_id) + { + $frontOfficeRouter = $this->getContainer()->get('router.front'); + + return URL::getInstance()->absoluteUrl( + $frontOfficeRouter->generate( + "order.placed", + array("order_id" => $order_id), + Router::ABSOLUTE_URL + ) + ); + } + + /** + * Redirect the customer to the failure payment page. if $message is null, a generic message is displayed. + * + * @param int $order_id the order ID + * @param string|null $message an error message. + * + * @return string the order payment failure page URL + */ + public function getPaymentFailurePageUrl($order_id, $message) + { + $frontOfficeRouter = $this->getContainer()->get('router.front'); + + return URL::getInstance()->absoluteUrl( + $frontOfficeRouter->generate( + "order.failed", + array( + "order_id" => $order_id, + "message" => $message + ), + Router::ABSOLUTE_URL + ) + ); + } +} diff --git a/core/lib/Thelia/Module/BaseModule.php b/core/lib/Thelia/Module/BaseModule.php index 6dcf3ff06..6ff1cf0f1 100644 --- a/core/lib/Thelia/Module/BaseModule.php +++ b/core/lib/Thelia/Module/BaseModule.php @@ -1,25 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Module; @@ -29,15 +17,20 @@ use Propel\Runtime\Propel; use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\Request; -use Thelia\Model\Map\ModuleTableMap; -use Thelia\Model\ModuleI18nQuery; -use Thelia\Model\Map\ModuleImageTableMap; -use Thelia\Model\ModuleI18n; -use Thelia\Tools\Image; +use Thelia\Core\HttpFoundation\Session\Session; use Thelia\Exception\ModuleException; +use Thelia\Model\Cart; +use Thelia\Model\Country; +use Thelia\Model\Map\ModuleImageTableMap; +use Thelia\Model\Map\ModuleTableMap; use Thelia\Model\Module; +use Thelia\Model\ModuleI18n; +use Thelia\Model\ModuleI18nQuery; use Thelia\Model\ModuleImage; use Thelia\Model\ModuleQuery; +use Thelia\Model\Order; +use Thelia\TaxEngine\TaxEngine; +use Thelia\Tools\Image; class BaseModule extends ContainerAware implements BaseModuleInterface { @@ -124,8 +117,18 @@ class BaseModule extends ContainerAware implements BaseModuleInterface $this->request = $request; } + /** + * @return \Thelia\Core\HttpFoundation\Request the request. + * + * @throws \RuntimeException + */ public function getRequest() { + if ($this->hasRequest() === false) { + // Try to get request from container. + $this->setRequest($this->getContainer()->get('request')); + } + if ($this->hasRequest() === false) { throw new \RuntimeException("Sorry, the request is not available in this context"); } @@ -152,6 +155,12 @@ class BaseModule extends ContainerAware implements BaseModuleInterface return $this->dispatcher; } + /** + * Sets a module titles for various languages + * + * @param Module $module the module. + * @param array $titles an associative array of locale => title_string + */ public function setTitle(Module $module, $titles) { if (is_array($titles)) { @@ -173,6 +182,19 @@ class BaseModule extends ContainerAware implements BaseModuleInterface } } + /** + * Ensure the proper deployment of the module's images. + * + * TODO : this method does not take care of internationalization. This is a bug. + * + * @param Module $module the module + * @param string $folderPath the image folder path + * @param ConnectionInterface $con + * + * @throws \Thelia\Exception\ModuleException + * @throws \Exception + * @throws \UnexpectedValueException + */ public function deployImageFolder(Module $module, $folderPath, ConnectionInterface $con = null) { try { @@ -181,13 +203,14 @@ class BaseModule extends ContainerAware implements BaseModuleInterface throw $e; } if (null === $con) { - $con = \Propel\Runtime\Propel::getConnection( + $con = Propel::getConnection( ModuleImageTableMap::DATABASE_NAME ); } /* browse the directory */ $imagePosition = 1; + /** @var \DirectoryIterator $directoryContent */ foreach ($directoryBrowser as $directoryContent) { /* is it a file ? */ if ($directoryContent->isFile()) { @@ -263,8 +286,72 @@ class BaseModule extends ContainerAware implements BaseModuleInterface } /** + * Check if this module is the payment module for a given order * - * This method allow adding new compilers to Thelia container + * @param Order $order an order + * @return bool true if this module is the payment module for the given order. + */ + public function isPaymentModuleFor(Order $order) + { + $model = $this->getModuleModel(); + + return $order->getPaymentModuleId() == $model->getId(); + } + + /** + * Check if this module is the delivery module for a given order + * + * @param Order $order an order + * @return bool true if this module is the delivery module for the given order. + */ + public function isDeliveryModuleFor(Order $order) + { + $model = $this->getModuleModel(); + + return $order->getDeliveryModuleId() == $model->getId(); + } + + /** + * A convenient method to get the current order total, with or without tax, discount or postage. + * This method operates on the order currently in the user's session, and should not be used to + * get the total amount of an order already stored in the database. For such orders, use + * Order::getTotalAmount() method. + * + * @param bool $with_tax if true, to total price will include tax amount + * @param bool $with_discount if true, the total price will include discount, if any + * @param bool $with_postage if true, the total price will include the delivery costs, if any. + * + * @return float|int the current order amount. + */ + public function getCurrentOrderTotalAmount($with_tax = true, $with_discount = true, $with_postage = true) + { + /** @var Session $session */ + $session = $this->getRequest()->getSession(); + + /** @var Cart $cart */ + $cart = $session->getCart(); + + /** @var Order $order */ + $order = $session->getOrder(); + + /** @var TaxEngine $taxEngine */ + $taxEngine = $this->getContainer()->get("thelia.taxengine"); + + /** @var Country $country */ + $country = $taxEngine->getDeliveryCountry(); + + $amount = $with_tax ? $cart->getTaxedAmount($country, $with_discount) : $cart->getTotalAmount($with_discount); + + if ($with_postage) { + $amount += $order->getPostage(); + } + + return $amount; + } + + /** + * + * This method adds new compilers to Thelia container * * You must return an array. This array can contain : * - arrays @@ -302,33 +389,66 @@ class BaseModule extends ContainerAware implements BaseModuleInterface return array(); } + /** + * This method is called when the plugin is installed for the first time, using + * zip upload method. + * + * @param ConnectionInterface $con + */ public function install(ConnectionInterface $con = null) { - // Implement this method to do something useful. + // Override this method to do something useful. } + /** + * This method is called before the module activation, and may prevent it by returning false. + * + * @param ConnectionInterface $con + * + * @return bool true to continue module activation, false to prevent it. + */ public function preActivation(ConnectionInterface $con = null) { + // Override this method to do something useful. return true; } + /** + * This method is called just after the module was successfully activated. + * + * @param ConnectionInterface $con + */ public function postActivation(ConnectionInterface $con = null) { - // Implement this method to do something useful. + // Override this method to do something useful. } + /** + * This method is called before the module de-activation, and may prevent it by returning false. + * + * @param ConnectionInterface $con + * @return bool true to continue module de-activation, false to prevent it. + */ public function preDeactivation(ConnectionInterface $con = null) { + // Override this method to do something useful. return true; } public function postDeactivation(ConnectionInterface $con = null) { - // Implement this method to do something useful. + // Override this method to do something useful. } + /** + * This method is called just before the deletion of the module, giving the module an opportunity + * to delete its data. + * + * @param ConnectionInterface $con + * @param bool $deleteModuleData if true, the module should remove all its data from the system. + */ public function destroy(ConnectionInterface $con = null, $deleteModuleData = false) { - // Implement this method to do something useful. + // Override this method to do something useful. } } diff --git a/core/lib/Thelia/Module/BaseModuleInterface.php b/core/lib/Thelia/Module/BaseModuleInterface.php index be7b30a12..11ee54fec 100644 --- a/core/lib/Thelia/Module/BaseModuleInterface.php +++ b/core/lib/Thelia/Module/BaseModuleInterface.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Module; diff --git a/core/lib/Thelia/Module/BasePaymentModuleController.php b/core/lib/Thelia/Module/BasePaymentModuleController.php new file mode 100644 index 000000000..8c13c219b --- /dev/null +++ b/core/lib/Thelia/Module/BasePaymentModuleController.php @@ -0,0 +1,187 @@ + + */ +abstract class BasePaymentModuleController extends BaseFrontController +{ + protected $log = null; + + /** + * Return a module identifier used to calculate the name of the log file, + * and in the log messages. + * + * @return string the module code + */ + abstract protected function getModuleCode(); + + /** + * Initialize a module-specific logger. + * + * @return Tlog a Tlog instance + */ + protected function getLog() + { + if ($this->log == null) { + $this->log = Tlog::getNewInstance(); + + $logFilePath = sprintf(THELIA_ROOT."log".DS."%s.log", strtolower($this->getModuleCode())); + + $this->log->setPrefix("#LEVEL: #DATE #HOUR: "); + $this->log->setDestinations("\\Thelia\\Log\\Destination\\TlogDestinationFile"); + $this->log->setConfig("\\Thelia\\Log\\Destination\\TlogDestinationFile", 0, $logFilePath); + } + + return $this->log; + } + + /** + * Process the confirmation of an order. This method should be called + * once the module has performed the required checks to confirm a valid payment. + * + * @param int $order_id the order ID + */ + public function confirmPayment($order_id) + { + try { + $order_id = intval($order_id); + + if (null !== $order = $this->getOrder($order_id)) { + + $this->getLog()->addInfo( + $this->getTranslator()->trans("Processing confirmation of order ref. %ref, ID %id", + array('%ref' => $order->getRef(), '%id' => $order->getId())) + ); + + $event = new OrderEvent($order); + + $event->setStatus(OrderStatusQuery::getPaidStatus()->getId()); + + $this->dispatch(TheliaEvents::ORDER_UPDATE_STATUS, $event); + + $this->getLog()->addInfo( + $this->getTranslator()->trans("Order ref. %ref, ID %id has been successfully paid.", + array('%ref' => $order->getRef(), '%id' => $order->getId())) + ); + } + } catch (\Exception $ex) { + $this->getLog()->addError( + $this->getTranslator()->trans("Error occured while processing order ref. %ref, ID %id: %err", + array( + '%err' => $ex->getMessage(), + '%ref' => ! isset($order) ? "?" : $order->getRef(), + '%id' => ! isset($order) ? "?" : $order->getId() + ) + ) + ); + + throw $ex; + } + } + + /** + * Process the cancelation of a payment on the payment gateway. The order will go back to the + * "not paid" status. + * + * @param int $order_id the order ID + */ + public function cancelPayment($order_id) + { + $order_id = intval($order_id); + + if (null !== $order = $this->getOrder($order_id)) { + $this->getLog()->addInfo( + $this->getTranslator()->trans("Processing cancelation of payment for order ref. %ref", + array('%ref' => $order->getRef())) + ); + + $event = new OrderEvent($order); + + $event->setStatus(OrderStatus::CODE_NOT_PAID); + + $this->getLog()->addInfo( + $this->getTranslator()->trans("Order ref. %ref is now unpaid.", + array('%ref' => $order->getRef())) + ); + + $this->dispatch(TheliaEvents::ORDER_UPDATE_STATUS, $event); + } + } + + /** + * Get an order and issue a log message if not found. + * @param $order_id + * @return null|\Thelia\Model\Order + */ + protected function getOrder($order_id) + { + if (null == $order = OrderQuery::create()->findPk($order_id)) { + $this->getLog()->addError($this->getTranslator()->trans("Unknown order ID: %id", array('%id' => $order_id))); + } + + return $order; + } + /** + * Redirect the customer to the successful payment page. + * + * @param int $order_id the order ID + */ + public function redirectToSuccessPage($order_id) + { + $this->getLog()->addInfo("Redirecting customer to payment success page"); + + $this->redirectToRoute( + 'order.placed', + [], + [ + 'order_id' => $order_id + ], + Router::ABSOLUTE_PATH + ); + } + + /** + * Redirect the customer to the failure payment page. if $message is null, a generic message is displayed. + * + * @param int $order_id the order ID + * @param string|null $message an error message. + */ + public function redirectToFailurePage($order_id, $message) + { + $this->getLog()->addInfo("Redirecting customer to payment failure page"); + + $this->redirectToRoute( + 'order.failed', + [], + [ + 'order_id' => $order_id, + 'message' => $message + ], + Router::ABSOLUTE_PATH + ); + } +} diff --git a/core/lib/Thelia/Module/DeliveryModuleInterface.php b/core/lib/Thelia/Module/DeliveryModuleInterface.php index 17b000d4f..9fd15ddd1 100644 --- a/core/lib/Thelia/Module/DeliveryModuleInterface.php +++ b/core/lib/Thelia/Module/DeliveryModuleInterface.php @@ -1,38 +1,42 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Module; use Thelia\Model\Country; +use Thelia\Module\Exception\DeliveryException; interface DeliveryModuleInterface extends BaseModuleInterface { /** - * calculate and return delivery price + * This method is called by the Delivery loop, to check if the current module has to be displayed to the customer. + * Override it to implements your delivery rules/ * - * @param Country $country + * If you return true, the delivery method will de displayed to the customer + * If you return false, the delivery method will not be displayed * - * @return mixed + * @param Country $country the country to deliver to. + * + * @return boolean + */ + public function isValidDelivery(Country $country); + + /** + * Calculate and return delivery price in the shop's default currency + * + * @param Country $country the country to deliver to. + * + * @return float the delivery price + * @throws DeliveryException if the postage price cannot be calculated. */ public function getPostage(Country $country); } diff --git a/core/lib/Thelia/Module/Exception/DeliveryException.php b/core/lib/Thelia/Module/Exception/DeliveryException.php new file mode 100644 index 000000000..f5668a082 --- /dev/null +++ b/core/lib/Thelia/Module/Exception/DeliveryException.php @@ -0,0 +1,17 @@ +. */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Module\Exception; diff --git a/core/lib/Thelia/Module/ModuleDescriptorValidator.php b/core/lib/Thelia/Module/ModuleDescriptorValidator.php index 8f8c89d4a..6b1f9452f 100644 --- a/core/lib/Thelia/Module/ModuleDescriptorValidator.php +++ b/core/lib/Thelia/Module/ModuleDescriptorValidator.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Module; diff --git a/core/lib/Thelia/Module/ModuleManagement.php b/core/lib/Thelia/Module/ModuleManagement.php index 99cc5ca9f..0602c1188 100644 --- a/core/lib/Thelia/Module/ModuleManagement.php +++ b/core/lib/Thelia/Module/ModuleManagement.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Module; diff --git a/core/lib/Thelia/Module/PaymentModuleInterface.php b/core/lib/Thelia/Module/PaymentModuleInterface.php index bb6d03854..47dff4d3a 100644 --- a/core/lib/Thelia/Module/PaymentModuleInterface.php +++ b/core/lib/Thelia/Module/PaymentModuleInterface.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Module; diff --git a/core/lib/Thelia/Rewriting/RewritingResolver.php b/core/lib/Thelia/Rewriting/RewritingResolver.php index 91be66b55..2ac87df80 100644 --- a/core/lib/Thelia/Rewriting/RewritingResolver.php +++ b/core/lib/Thelia/Rewriting/RewritingResolver.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Rewriting; use Thelia\Exception\UrlRewritingException; diff --git a/core/lib/Thelia/Rewriting/RewritingRetriever.php b/core/lib/Thelia/Rewriting/RewritingRetriever.php index cfff07914..d161282aa 100644 --- a/core/lib/Thelia/Rewriting/RewritingRetriever.php +++ b/core/lib/Thelia/Rewriting/RewritingRetriever.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Rewriting; use Thelia\Model\RewritingUrlQuery; diff --git a/core/lib/Thelia/TaxEngine/BaseTaxType.php b/core/lib/Thelia/TaxEngine/BaseTaxType.php index 30223b669..80044c3f4 100644 --- a/core/lib/Thelia/TaxEngine/BaseTaxType.php +++ b/core/lib/Thelia/TaxEngine/BaseTaxType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\TaxEngine; use Thelia\Exception\TaxEngineException; diff --git a/core/lib/Thelia/TaxEngine/Calculator.php b/core/lib/Thelia/TaxEngine/Calculator.php index 552acab19..77a7b41a3 100644 --- a/core/lib/Thelia/TaxEngine/Calculator.php +++ b/core/lib/Thelia/TaxEngine/Calculator.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\TaxEngine; use Thelia\Exception\TaxEngineException; @@ -100,6 +90,27 @@ class Calculator return $this; } + public function loadTaxRuleWithoutProduct(TaxRule $taxRule, Country $country) + { + $this->product = null; + $this->country = null; + $this->taxRulesCollection = null; + + if ($taxRule->getId() === null) { + throw new TaxEngineException('TaxRule id is empty in Calculator::loadTaxRule', TaxEngineException::UNDEFINED_TAX_RULE); + } + if ($country->getId() === null) { + throw new TaxEngineException('Country id is empty in Calculator::loadTaxRule', TaxEngineException::UNDEFINED_COUNTRY); + } + + $this->country = $country; + $this->product = new Product(); + + $this->taxRulesCollection = $this->taxRuleQuery->getTaxCalculatorCollection($taxRule, $country); + + return $this; + } + public function getTaxAmountFromUntaxedPrice($untaxedPrice, &$taxCollection = null) { return $this->getTaxedPrice($untaxedPrice, $taxCollection) - $untaxedPrice; diff --git a/core/lib/Thelia/TaxEngine/OrderProductTaxCollection.php b/core/lib/Thelia/TaxEngine/OrderProductTaxCollection.php index 9bc497078..8d413af87 100644 --- a/core/lib/Thelia/TaxEngine/OrderProductTaxCollection.php +++ b/core/lib/Thelia/TaxEngine/OrderProductTaxCollection.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\TaxEngine; use Thelia\Model\OrderProductTax; diff --git a/core/lib/Thelia/TaxEngine/TaxEngine.php b/core/lib/Thelia/TaxEngine/TaxEngine.php index 62a8b2f68..04d5fe4fa 100644 --- a/core/lib/Thelia/TaxEngine/TaxEngine.php +++ b/core/lib/Thelia/TaxEngine/TaxEngine.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\TaxEngine; use Symfony\Component\HttpFoundation\Session\Session; diff --git a/core/lib/Thelia/TaxEngine/TaxType/FeatureFixAmountTaxType.php b/core/lib/Thelia/TaxEngine/TaxType/FeatureFixAmountTaxType.php index eb49847b6..899fca9c7 100644 --- a/core/lib/Thelia/TaxEngine/TaxType/FeatureFixAmountTaxType.php +++ b/core/lib/Thelia/TaxEngine/TaxType/FeatureFixAmountTaxType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\TaxEngine\TaxType; use Thelia\Exception\TaxEngineException; @@ -47,6 +37,7 @@ class FeatureFixAmountTaxType extends BaseTaxType public function fixAmountRetriever(Product $product) { + $taxAmount = 0; $featureId = $this->getRequirement("feature"); $query = FeatureProductQuery::create() @@ -54,14 +45,17 @@ class FeatureFixAmountTaxType extends BaseTaxType ->filterByFeatureId($featureId) ->findOne(); - $taxAmount = $query->getFreeTextValue(); + if (null !== $query) { + $taxAmount = $query->getFreeTextValue(); - $testInt = new FloatType(); - if (!$testInt->isValid($taxAmount)) { - throw new TaxEngineException( + $testInt = new FloatType(); + if (!$testInt->isValid($taxAmount)) { + throw new TaxEngineException( Translator::getInstance()->trans('Feature value does not match FLOAT format'), TaxEngineException::FEATURE_BAD_EXPECTED_VALUE - ); + ); + } + } return $taxAmount; diff --git a/core/lib/Thelia/TaxEngine/TaxType/FixAmountTaxType.php b/core/lib/Thelia/TaxEngine/TaxType/FixAmountTaxType.php index 43bad834a..46bb57cd5 100644 --- a/core/lib/Thelia/TaxEngine/TaxType/FixAmountTaxType.php +++ b/core/lib/Thelia/TaxEngine/TaxType/FixAmountTaxType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\TaxEngine\TaxType; use Thelia\Type\FloatType; diff --git a/core/lib/Thelia/TaxEngine/TaxType/PricePercentTaxType.php b/core/lib/Thelia/TaxEngine/TaxType/PricePercentTaxType.php index 08cd99d6d..effa6c988 100644 --- a/core/lib/Thelia/TaxEngine/TaxType/PricePercentTaxType.php +++ b/core/lib/Thelia/TaxEngine/TaxType/PricePercentTaxType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\TaxEngine\TaxType; use Thelia\Type\FloatType; diff --git a/core/lib/Thelia/TaxEngine/TaxTypeRequirementDefinition.php b/core/lib/Thelia/TaxEngine/TaxTypeRequirementDefinition.php index eb8b0f93c..f1c6c3d88 100644 --- a/core/lib/Thelia/TaxEngine/TaxTypeRequirementDefinition.php +++ b/core/lib/Thelia/TaxEngine/TaxTypeRequirementDefinition.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\TaxEngine; use Thelia\Type\TypeInterface; diff --git a/core/lib/Thelia/Tests/Action/AddressTest.php b/core/lib/Thelia/Tests/Action/AddressTest.php index d10dc2e9a..448c24af2 100644 --- a/core/lib/Thelia/Tests/Action/AddressTest.php +++ b/core/lib/Thelia/Tests/Action/AddressTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/AdministratorTest.php b/core/lib/Thelia/Tests/Action/AdministratorTest.php index 485cb8d87..382c7e31f 100644 --- a/core/lib/Thelia/Tests/Action/AdministratorTest.php +++ b/core/lib/Thelia/Tests/Action/AdministratorTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/AreaTest.php b/core/lib/Thelia/Tests/Action/AreaTest.php index 9e826a056..9bf0da48c 100644 --- a/core/lib/Thelia/Tests/Action/AreaTest.php +++ b/core/lib/Thelia/Tests/Action/AreaTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/AttributeAvTest.php b/core/lib/Thelia/Tests/Action/AttributeAvTest.php index 665afe2a2..757c51e7f 100644 --- a/core/lib/Thelia/Tests/Action/AttributeAvTest.php +++ b/core/lib/Thelia/Tests/Action/AttributeAvTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/AttributeTest.php b/core/lib/Thelia/Tests/Action/AttributeTest.php index 9054992ff..77a1b8e81 100644 --- a/core/lib/Thelia/Tests/Action/AttributeTest.php +++ b/core/lib/Thelia/Tests/Action/AttributeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/BaseAction.php b/core/lib/Thelia/Tests/Action/BaseAction.php index c07c07115..093efd0f3 100644 --- a/core/lib/Thelia/Tests/Action/BaseAction.php +++ b/core/lib/Thelia/Tests/Action/BaseAction.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/CacheTest.php b/core/lib/Thelia/Tests/Action/CacheTest.php index a0235c696..b15394d47 100644 --- a/core/lib/Thelia/Tests/Action/CacheTest.php +++ b/core/lib/Thelia/Tests/Action/CacheTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/CategoryTest.php b/core/lib/Thelia/Tests/Action/CategoryTest.php index ee8d31c81..f0112a7dd 100644 --- a/core/lib/Thelia/Tests/Action/CategoryTest.php +++ b/core/lib/Thelia/Tests/Action/CategoryTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/ConfigTest.php b/core/lib/Thelia/Tests/Action/ConfigTest.php index 5ed9e9633..afec65875 100644 --- a/core/lib/Thelia/Tests/Action/ConfigTest.php +++ b/core/lib/Thelia/Tests/Action/ConfigTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/ContentTest.php b/core/lib/Thelia/Tests/Action/ContentTest.php index 08e41815b..6f224f83a 100644 --- a/core/lib/Thelia/Tests/Action/ContentTest.php +++ b/core/lib/Thelia/Tests/Action/ContentTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/CountryTest.php b/core/lib/Thelia/Tests/Action/CountryTest.php index 0ea497fde..71612a614 100644 --- a/core/lib/Thelia/Tests/Action/CountryTest.php +++ b/core/lib/Thelia/Tests/Action/CountryTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/CurrencyTest.php b/core/lib/Thelia/Tests/Action/CurrencyTest.php index 01979455f..3350f3b99 100644 --- a/core/lib/Thelia/Tests/Action/CurrencyTest.php +++ b/core/lib/Thelia/Tests/Action/CurrencyTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/CustomerTest.php b/core/lib/Thelia/Tests/Action/CustomerTest.php index f160847ee..a8fcaa352 100644 --- a/core/lib/Thelia/Tests/Action/CustomerTest.php +++ b/core/lib/Thelia/Tests/Action/CustomerTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action\ImageTest; diff --git a/core/lib/Thelia/Tests/Action/DocumentTest.php b/core/lib/Thelia/Tests/Action/DocumentTest.php index 17a841d94..b3c546165 100644 --- a/core/lib/Thelia/Tests/Action/DocumentTest.php +++ b/core/lib/Thelia/Tests/Action/DocumentTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/FeatureAvTest.php b/core/lib/Thelia/Tests/Action/FeatureAvTest.php index e6c66d45e..33d213946 100644 --- a/core/lib/Thelia/Tests/Action/FeatureAvTest.php +++ b/core/lib/Thelia/Tests/Action/FeatureAvTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/FeatureTest.php b/core/lib/Thelia/Tests/Action/FeatureTest.php index e2604079a..c97b8b1cb 100644 --- a/core/lib/Thelia/Tests/Action/FeatureTest.php +++ b/core/lib/Thelia/Tests/Action/FeatureTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/FolderTest.php b/core/lib/Thelia/Tests/Action/FolderTest.php index 96e07ed52..21416bfa3 100644 --- a/core/lib/Thelia/Tests/Action/FolderTest.php +++ b/core/lib/Thelia/Tests/Action/FolderTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/ImageTest.php b/core/lib/Thelia/Tests/Action/ImageTest.php index 1b718f096..00d08123c 100755 --- a/core/lib/Thelia/Tests/Action/ImageTest.php +++ b/core/lib/Thelia/Tests/Action/ImageTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/LangTest.php b/core/lib/Thelia/Tests/Action/LangTest.php index b187479eb..e4fc50e71 100644 --- a/core/lib/Thelia/Tests/Action/LangTest.php +++ b/core/lib/Thelia/Tests/Action/LangTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; @@ -66,6 +55,9 @@ class LangTest extends \PHPUnit_Framework_TestCase ->setCode('TES') ->setDateFormat('Y-m-d') ->setTimeFormat('H:i:s') + ->setDecimalSeparator(".") + ->setThousandsSeparator(" ") + ->setDecimals("2") ->setDispatcher($this->dispatcher) ; @@ -83,6 +75,10 @@ class LangTest extends \PHPUnit_Framework_TestCase $this->assertEquals('TES', $createdLang->getCode()); $this->assertEquals('Y-m-d', $createdLang->getDateFormat()); $this->assertEquals('H:i:s', $createdLang->getTimeFormat()); + $this->assertEquals('.', $createdLang->getDecimalSeparator()); + $this->assertEquals(' ', $createdLang->getThousandsSeparator()); + $this->assertEquals('2', $createdLang->getDecimals()); + $this->assertEquals('Y-m-d H:i:s', $createdLang->getDatetimeFormat()); return $createdLang; } @@ -101,6 +97,9 @@ class LangTest extends \PHPUnit_Framework_TestCase ->setCode('TEST') ->setDateFormat('d-m-Y') ->setTimeFormat('H-i-s') + ->setDecimalSeparator(",") + ->setThousandsSeparator(".") + ->setDecimals("1") ->setDispatcher($this->dispatcher) ; @@ -116,6 +115,10 @@ class LangTest extends \PHPUnit_Framework_TestCase $this->assertEquals('test update', $updatedLang->getTitle()); $this->assertEquals('d-m-Y', $updatedLang->getDateFormat()); $this->assertEquals('H-i-s', $updatedLang->getTimeFormat()); + $this->assertEquals(',', $updatedLang->getDecimalSeparator()); + $this->assertEquals('.', $updatedLang->getThousandsSeparator()); + $this->assertEquals('1', $updatedLang->getDecimals()); + $this->assertEquals('d-m-Y H-i-s', $updatedLang->getDatetimeFormat()); return $updatedLang; } diff --git a/core/lib/Thelia/Tests/Action/MessageTest.php b/core/lib/Thelia/Tests/Action/MessageTest.php index f5a53bb2c..a201a1f3d 100644 --- a/core/lib/Thelia/Tests/Action/MessageTest.php +++ b/core/lib/Thelia/Tests/Action/MessageTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/NewsletterTest.php b/core/lib/Thelia/Tests/Action/NewsletterTest.php index acea9752a..cee09d644 100644 --- a/core/lib/Thelia/Tests/Action/NewsletterTest.php +++ b/core/lib/Thelia/Tests/Action/NewsletterTest.php @@ -1,26 +1,14 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ - namespace Thelia\Tests\Action; use Thelia\Action\Newsletter; diff --git a/core/lib/Thelia/Tests/Action/OrderTest.php b/core/lib/Thelia/Tests/Action/OrderTest.php index fa2f640fd..48527ae7f 100644 --- a/core/lib/Thelia/Tests/Action/OrderTest.php +++ b/core/lib/Thelia/Tests/Action/OrderTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/PdfTest.php b/core/lib/Thelia/Tests/Action/PdfTest.php index 2d5d772d5..e3b310782 100644 --- a/core/lib/Thelia/Tests/Action/PdfTest.php +++ b/core/lib/Thelia/Tests/Action/PdfTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/ProductTest.php b/core/lib/Thelia/Tests/Action/ProductTest.php index 91b6a2dcd..89c6d3a17 100644 --- a/core/lib/Thelia/Tests/Action/ProductTest.php +++ b/core/lib/Thelia/Tests/Action/ProductTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/ProfileTest.php b/core/lib/Thelia/Tests/Action/ProfileTest.php index dcf3c219a..96b3ec202 100644 --- a/core/lib/Thelia/Tests/Action/ProfileTest.php +++ b/core/lib/Thelia/Tests/Action/ProfileTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Action; diff --git a/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php b/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php index 4891e8b96..08939048c 100644 --- a/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php +++ b/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php @@ -1,4 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Cart\CartTraitTest; diff --git a/core/lib/Thelia/Tests/Command/BaseCommandTest.php b/core/lib/Thelia/Tests/Command/BaseCommandTest.php index 54b62e3f5..234b87b34 100755 --- a/core/lib/Thelia/Tests/Command/BaseCommandTest.php +++ b/core/lib/Thelia/Tests/Command/BaseCommandTest.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Tests\Command; /** diff --git a/core/lib/Thelia/Tests/Command/CacheClearTestSaved.php b/core/lib/Thelia/Tests/Command/CacheClearTestSaved.php index 73a94e7dd..abd5a9239 100755 --- a/core/lib/Thelia/Tests/Command/CacheClearTestSaved.php +++ b/core/lib/Thelia/Tests/Command/CacheClearTestSaved.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Tests\Command; use Symfony\Component\Console\Tester\CommandTester; diff --git a/core/lib/Thelia/Tests/Command/ModuleActivateCommandTest.php b/core/lib/Thelia/Tests/Command/ModuleActivateCommandTest.php index d18c80a61..e95224e16 100755 --- a/core/lib/Thelia/Tests/Command/ModuleActivateCommandTest.php +++ b/core/lib/Thelia/Tests/Command/ModuleActivateCommandTest.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Tests\Command; use Symfony\Component\Console\Tester\CommandTester; diff --git a/core/lib/Thelia/Tests/Command/ModuleDeactivateCommandTest.php b/core/lib/Thelia/Tests/Command/ModuleDeactivateCommandTest.php new file mode 100755 index 000000000..37a2187bd --- /dev/null +++ b/core/lib/Thelia/Tests/Command/ModuleDeactivateCommandTest.php @@ -0,0 +1,103 @@ + + */ +class ModuleDeactivateCommandTest extends \PHPUnit_Framework_TestCase +{ + public function testModuleDeactivateCommand() + { + $module = ModuleQuery::create()->findOne(); + + if (null !== $module) { + + $prev_activation_status = $module->getActivate(); + + $application = new Application($this->getKernel()); + + $module->setActivate(BaseModule::IS_ACTIVATED); + $module->save(); + + $moduleDeactivate = new ModuleDeactivateCommand(); + $moduleDeactivate->setContainer($this->getContainer()); + + $application->add($moduleDeactivate); + + $command = $application->find("module:deactivate"); + $commandTester = new CommandTester($command); + $commandTester->execute(array( + "command" => $command->getName(), + "module" => $module->getCode(), + )); + + $deactivated = ModuleQuery::create()->findPk($module->getId())->getActivate(); + + // Restore activation status + $module->setActivate($prev_activation_status)->save(); + + $this->assertEquals(BaseModule::IS_NOT_ACTIVATED, $deactivated); + } + } + + /** + * @expectedException \RuntimeException + * @expectedExceptionMessage module Letshopethismoduledoesnotexists not found + */ + public function testModuleDeactivateCommandUnknownModule() + { + $testedModule = ModuleQuery::create()->findOneByCode('Letshopethismoduledoesnotexists'); + + if (null == $testedModule) { + $application = new Application($this->getKernel()); + + $moduleDeactivate = new ModuleDeactivateCommand(); + $moduleDeactivate->setContainer($this->getContainer()); + + $application->add($moduleDeactivate); + + $command = $application->find("module:deactivate"); + $commandTester = new CommandTester($command); + $commandTester->execute(array( + "command" => $command->getName(), + "module" => "letshopethismoduledoesnotexists", + )); + + $out = true; + } + } + + public function getKernel() + { + $kernel = $this->getMock("Symfony\Component\HttpKernel\KernelInterface"); + + return $kernel; + } + + public function getContainer() + { + $container = new \Symfony\Component\DependencyInjection\ContainerBuilder(); + + return $container; + } +} diff --git a/core/lib/Thelia/Tests/Command/ModuleGenerateCommandTest.php b/core/lib/Thelia/Tests/Command/ModuleGenerateCommandTest.php index 78d84ea78..3679660af 100755 --- a/core/lib/Thelia/Tests/Command/ModuleGenerateCommandTest.php +++ b/core/lib/Thelia/Tests/Command/ModuleGenerateCommandTest.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Tests\Command; use Symfony\Component\Console\Tester\CommandTester; diff --git a/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php b/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php index 84b5a832d..679f22791 100644 --- a/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php +++ b/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition; use Thelia\Condition\Implementation\MatchForTotalAmount; diff --git a/core/lib/Thelia/Tests/Condition/ConditionEvaluatorTest.php b/core/lib/Thelia/Tests/Condition/ConditionEvaluatorTest.php index 37dce5120..38c9e43e3 100644 --- a/core/lib/Thelia/Tests/Condition/ConditionEvaluatorTest.php +++ b/core/lib/Thelia/Tests/Condition/ConditionEvaluatorTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition\Implementation; diff --git a/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php b/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php index a6181cddc..854803411 100644 --- a/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php +++ b/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition\Implementation; diff --git a/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php b/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php index 95c49ce58..ddf3d25ae 100644 --- a/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php +++ b/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition\Implementation; diff --git a/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php b/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php index 4f28f32e4..102132196 100644 --- a/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php +++ b/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Tests\Condition\Implementation; diff --git a/core/lib/Thelia/Tests/Condition/Implementation/MatchForXArticlesTest.php b/core/lib/Thelia/Tests/Condition/Implementation/MatchForXArticlesTest.php index 92aa69564..3d96df4a2 100644 --- a/core/lib/Thelia/Tests/Condition/Implementation/MatchForXArticlesTest.php +++ b/core/lib/Thelia/Tests/Condition/Implementation/MatchForXArticlesTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition\Implementation; diff --git a/core/lib/Thelia/Tests/Condition/OperatorsTest.php b/core/lib/Thelia/Tests/Condition/OperatorsTest.php index 94f5bd1bf..c410fd975 100644 --- a/core/lib/Thelia/Tests/Condition/OperatorsTest.php +++ b/core/lib/Thelia/Tests/Condition/OperatorsTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Condition; @@ -55,35 +44,35 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase ->will($this->returnCallback((array($this, 'callbackI18n')))); $actual = Operators::getI18n($stubTranslator, Operators::INFERIOR); - $expected = 'inferior to'; + $expected = 'Less than'; $this->assertEquals($expected, $actual); $actual = Operators::getI18n($stubTranslator, Operators::INFERIOR_OR_EQUAL); - $expected = 'inferior or equal to'; + $expected = 'Less than or equals'; $this->assertEquals($expected, $actual); $actual = Operators::getI18n($stubTranslator, Operators::EQUAL); - $expected = 'equal to'; + $expected = 'Equals'; $this->assertEquals($expected, $actual); $actual = Operators::getI18n($stubTranslator, Operators::SUPERIOR_OR_EQUAL); - $expected = 'superior or equal to'; + $expected = 'Greater than or equals'; $this->assertEquals($expected, $actual); $actual = Operators::getI18n($stubTranslator, Operators::SUPERIOR); - $expected = 'superior to'; + $expected = 'Greater than'; $this->assertEquals($expected, $actual); $actual = Operators::getI18n($stubTranslator, Operators::DIFFERENT); - $expected = 'different from'; + $expected = 'Not equals'; $this->assertEquals($expected, $actual); $actual = Operators::getI18n($stubTranslator, Operators::IN); - $expected = 'in'; + $expected = 'In'; $this->assertEquals($expected, $actual); $actual = Operators::getI18n($stubTranslator, Operators::OUT); - $expected = 'not in'; + $expected = 'Not in'; $this->assertEquals($expected, $actual); $actual = Operators::getI18n($stubTranslator, 'unexpected operator'); diff --git a/core/lib/Thelia/Tests/Controller/DefaultControllerTest.php b/core/lib/Thelia/Tests/Controller/DefaultControllerTest.php index 3ecae7c01..92b91d22b 100755 --- a/core/lib/Thelia/Tests/Controller/DefaultControllerTest.php +++ b/core/lib/Thelia/Tests/Controller/DefaultControllerTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Controller; diff --git a/core/lib/Thelia/Tests/Core/HttpFoundation/RequestTest.php b/core/lib/Thelia/Tests/Core/HttpFoundation/RequestTest.php index 63ef64940..779de4076 100755 --- a/core/lib/Thelia/Tests/Core/HttpFoundation/RequestTest.php +++ b/core/lib/Thelia/Tests/Core/HttpFoundation/RequestTest.php @@ -1,4 +1,14 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\HttpFoundation\Session; diff --git a/core/lib/Thelia/Tests/Core/Template/Element/BaseLoopTestor.php b/core/lib/Thelia/Tests/Core/Template/Element/BaseLoopTestor.php index 1faa8ec81..69505ce62 100755 --- a/core/lib/Thelia/Tests/Core/Template/Element/BaseLoopTestor.php +++ b/core/lib/Thelia/Tests/Core/Template/Element/BaseLoopTestor.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Element; @@ -29,6 +18,7 @@ use Thelia\Core\HttpFoundation\Request; use Thelia\Core\Security\SecurityContext; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Thelia\Core\HttpFoundation\Session\Session; +use Thelia\Core\Translation\Translator; use Thelia\Tools\URL; use Thelia\TaxEngine\TaxEngine; @@ -106,6 +96,7 @@ abstract class BaseLoopTestor extends \PHPUnit_Framework_TestCase $this->container->set('request', $request); $this->container->set('event_dispatcher', new EventDispatcher()); + $this->container->set('thelia.translator',new Translator($this->container)); $this->container->set('thelia.securityContext', new SecurityContext($request)); $this->container->set('router.admin', $stubRouterAdmin); $this->container->set('thelia.url.manager', new URL($this->container)); diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/AccessoryTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/AccessoryTest.php index 64bd4b5b6..e64af5dfc 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/AccessoryTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/AccessoryTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/AddressTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/AddressTest.php index 447646b8b..5d021f87b 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/AddressTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/AddressTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php index fb0d95a69..ba5a3cdf2 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop\Argument; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/AssociatedContentTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/AssociatedContentTest.php index 5d6c2579c..79720d18a 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/AssociatedContentTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/AssociatedContentTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/AttributeAvailabilityTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/AttributeAvailabilityTest.php index ca880daa8..09ab71f9d 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/AttributeAvailabilityTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/AttributeAvailabilityTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/AttributeCombinationTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/AttributeCombinationTest.php index f811c7de9..a59f10ecd 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/AttributeCombinationTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/AttributeCombinationTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/AttributeTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/AttributeTest.php index 46b19e3ac..303d7cef1 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/AttributeTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/AttributeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php index ac371e71f..3d9c0de43 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php index 0009b90d8..c650ad7c6 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/CountryTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/CountryTest.php index 0eb37a6fd..420231682 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/CountryTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/CountryTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/CurrencyTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/CurrencyTest.php index a866fae0c..f503560c1 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/CurrencyTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/CurrencyTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/CustomerTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/CustomerTest.php index 4239414fa..cd86b1ba4 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/CustomerTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/CustomerTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/DocumentTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/DocumentTest.php index cd3a47df0..301bbd9aa 100644 --- a/core/lib/Thelia/Tests/Core/Template/Loop/DocumentTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/DocumentTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/FeatureAvailabilityTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/FeatureAvailabilityTest.php index aae4ec254..c347fb65a 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/FeatureAvailabilityTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/FeatureAvailabilityTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/FeatureTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/FeatureTest.php index 7324856f6..c2a2811d6 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/FeatureTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/FeatureTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/FeatureValueTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/FeatureValueTest.php index 19966ba71..81bb82316 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/FeatureValueTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/FeatureValueTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php index 0dd3b6b0d..a1d7883a0 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/ImageTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/ImageTest.php index 8c4906293..af652c40d 100644 --- a/core/lib/Thelia/Tests/Core/Template/Loop/ImageTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/ImageTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/ProductSaleElementTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/ProductSaleElementTest.php index ea2ba403b..8951bd166 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/ProductSaleElementTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/ProductSaleElementTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php index b071bde9c..8b2990fae 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php index dd42a343e..c9015f3c4 100644 --- a/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/TitleTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/TitleTest.php index 63e4a7a9a..b2e3db416 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/TitleTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/TitleTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Core\Template\Loop; diff --git a/core/lib/Thelia/Tests/Core/Template/Smarty/Plugins/FormatTest.php b/core/lib/Thelia/Tests/Core/Template/Smarty/Plugins/FormatTest.php index a673b805b..ad78dc670 100644 --- a/core/lib/Thelia/Tests/Core/Template/Smarty/Plugins/FormatTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Smarty/Plugins/FormatTest.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Tests\Core\Smarty\Plugins; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; diff --git a/core/lib/Thelia/Tests/Coupon/BaseFacadeTest.php b/core/lib/Thelia/Tests/Coupon/BaseFacadeTest.php index c2082edb4..7c8351552 100644 --- a/core/lib/Thelia/Tests/Coupon/BaseFacadeTest.php +++ b/core/lib/Thelia/Tests/Coupon/BaseFacadeTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon; diff --git a/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php b/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php index 74d139c4e..8e37e50ec 100644 --- a/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php +++ b/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon; use Thelia\Condition\ConditionCollection; diff --git a/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php b/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php index 0286efdd4..b14f781bb 100644 --- a/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php +++ b/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon; use Thelia\Condition\ConditionCollection; diff --git a/core/lib/Thelia/Tests/Coupon/Type/RemoveXAmountTest.php b/core/lib/Thelia/Tests/Coupon/Type/RemoveXAmountTest.php index ae997d5cb..da349bb85 100644 --- a/core/lib/Thelia/Tests/Coupon/Type/RemoveXAmountTest.php +++ b/core/lib/Thelia/Tests/Coupon/Type/RemoveXAmountTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon\Type; use Thelia\Condition\ConditionCollection; diff --git a/core/lib/Thelia/Tests/Coupon/Type/RemoveXPercentTest.php b/core/lib/Thelia/Tests/Coupon/Type/RemoveXPercentTest.php index e4478808e..4ddeb7d12 100644 --- a/core/lib/Thelia/Tests/Coupon/Type/RemoveXPercentTest.php +++ b/core/lib/Thelia/Tests/Coupon/Type/RemoveXPercentTest.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Coupon\Type; use Thelia\Condition\ConditionCollection; diff --git a/core/lib/Thelia/Tests/Fixtures/Dumper/Config/Empty.php b/core/lib/Thelia/Tests/Fixtures/Dumper/Config/Empty.php deleted file mode 100755 index 9e8bab2c8..000000000 --- a/core/lib/Thelia/Tests/Fixtures/Dumper/Config/Empty.php +++ /dev/null @@ -1,25 +0,0 @@ -. */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Form; diff --git a/core/lib/Thelia/Tests/Form/OrderDeliveryTest.php b/core/lib/Thelia/Tests/Form/OrderDeliveryTest.php index 980c17d88..4943495ae 100755 --- a/core/lib/Thelia/Tests/Form/OrderDeliveryTest.php +++ b/core/lib/Thelia/Tests/Form/OrderDeliveryTest.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Tests\Form; class OrderDeliveryTest extends \PHPUnit_Framework_TestCase diff --git a/core/lib/Thelia/Tests/Log/TlogTest.php b/core/lib/Thelia/Tests/Log/TlogTest.php index d99b1f14d..23137cdf0 100755 --- a/core/lib/Thelia/Tests/Log/TlogTest.php +++ b/core/lib/Thelia/Tests/Log/TlogTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Log; diff --git a/core/lib/Thelia/Tests/Model/Message.php b/core/lib/Thelia/Tests/Model/Message.php index 2c5101a43..37494f96b 100644 --- a/core/lib/Thelia/Tests/Model/Message.php +++ b/core/lib/Thelia/Tests/Model/Message.php @@ -1,31 +1,20 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Model; use Thelia\Model\ConfigQuery; use Symfony\Component\Filesystem\Filesystem; -use Thelia\Model\Message; +use Thelia\Model\Message as ModelMessage; use Thelia\Core\Template\Smarty\SmartyParser; use Thelia\Core\Template\ParserContext; use Thelia\Core\Template\TemplateHelper; @@ -86,7 +75,7 @@ class Message extends \PHPUnit_Framework_TestCase */ public function testMessageWithTextAndHtmlBody() { - $message = new Message(); + $message = new ModelMessage(); $message->setLocale('fr_FR'); @@ -108,7 +97,7 @@ class Message extends \PHPUnit_Framework_TestCase */ public function testMessageWithTextOnlyBody() { - $message = new Message(); + $message = new ModelMessage(); $message->setLocale('fr_FR'); @@ -130,7 +119,7 @@ class Message extends \PHPUnit_Framework_TestCase */ public function testMessageWithTextAndHtmlBodyAndTextAndHtmlLayout() { - $message = new Message(); + $message = new ModelMessage(); $message->setLocale('fr_FR'); @@ -161,7 +150,7 @@ class Message extends \PHPUnit_Framework_TestCase */ public function testMessageWithTextOnlyBodyAndTextOnlyLayout() { - $message = new Message(); + $message = new ModelMessage(); $message->setLocale('fr_FR'); @@ -189,7 +178,7 @@ class Message extends \PHPUnit_Framework_TestCase */ public function testMessageWithTextAndHtmlBodyAndTextOnlyLayout() { - $message = new Message(); + $message = new ModelMessage(); $message->setLocale('fr_FR'); @@ -218,7 +207,7 @@ class Message extends \PHPUnit_Framework_TestCase */ public function testMessageWithTextAndHtmlBodyAndTextAndHtmlLayoutAndTextAndHtmlTemplate() { - $message = new Message(); + $message = new ModelMessage(); $message->setLocale('fr_FR'); @@ -257,7 +246,7 @@ class Message extends \PHPUnit_Framework_TestCase */ public function testMessageWithTextAndHtmlBodyAndTextAndHtmlLayoutAndTextAndHtmlTemplateWichExtendsLayout() { - $message = new Message(); + $message = new ModelMessage(); $message->setLocale('fr_FR'); @@ -296,7 +285,7 @@ class Message extends \PHPUnit_Framework_TestCase */ public function testMessageWithTextAndHtmlBodyAndTextAndHtmlExtendableLayout() { - $message = new Message(); + $message = new ModelMessage(); $message->setLocale('fr_FR'); diff --git a/core/lib/Thelia/Tests/Module/BaseModuleTestor.php b/core/lib/Thelia/Tests/Module/BaseModuleTestor.php index 1a8de083a..5a637aaaa 100644 --- a/core/lib/Thelia/Tests/Module/BaseModuleTestor.php +++ b/core/lib/Thelia/Tests/Module/BaseModuleTestor.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Module; diff --git a/core/lib/Thelia/Tests/Rewriting/BaseRewritingObject.php b/core/lib/Thelia/Tests/Rewriting/BaseRewritingObject.php index 16b8e2f28..7521900f3 100644 --- a/core/lib/Thelia/Tests/Rewriting/BaseRewritingObject.php +++ b/core/lib/Thelia/Tests/Rewriting/BaseRewritingObject.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Rewriting; diff --git a/core/lib/Thelia/Tests/Rewriting/CategoryRewritingTest.php b/core/lib/Thelia/Tests/Rewriting/CategoryRewritingTest.php index f5ff56685..b07c240e1 100644 --- a/core/lib/Thelia/Tests/Rewriting/CategoryRewritingTest.php +++ b/core/lib/Thelia/Tests/Rewriting/CategoryRewritingTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Rewriting; diff --git a/core/lib/Thelia/Tests/Rewriting/ContentRewritingTest.php b/core/lib/Thelia/Tests/Rewriting/ContentRewritingTest.php index 97dd10bee..5429d4744 100644 --- a/core/lib/Thelia/Tests/Rewriting/ContentRewritingTest.php +++ b/core/lib/Thelia/Tests/Rewriting/ContentRewritingTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Rewriting; diff --git a/core/lib/Thelia/Tests/Rewriting/FolderRewritingTest.php b/core/lib/Thelia/Tests/Rewriting/FolderRewritingTest.php index 81e4154a2..c8db5a6c9 100644 --- a/core/lib/Thelia/Tests/Rewriting/FolderRewritingTest.php +++ b/core/lib/Thelia/Tests/Rewriting/FolderRewritingTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Rewriting; diff --git a/core/lib/Thelia/Tests/Rewriting/ProductRewriteTest.php b/core/lib/Thelia/Tests/Rewriting/ProductRewriteTest.php index 0a74587d5..6e7880ca5 100644 --- a/core/lib/Thelia/Tests/Rewriting/ProductRewriteTest.php +++ b/core/lib/Thelia/Tests/Rewriting/ProductRewriteTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Rewriting; diff --git a/core/lib/Thelia/Tests/Rewriting/RewritingResolverTest.php b/core/lib/Thelia/Tests/Rewriting/RewritingResolverTest.php index 97a6eebc0..55f795cb8 100755 --- a/core/lib/Thelia/Tests/Rewriting/RewritingResolverTest.php +++ b/core/lib/Thelia/Tests/Rewriting/RewritingResolverTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Rewriting; diff --git a/core/lib/Thelia/Tests/Rewriting/RewritingRetrieverTest.php b/core/lib/Thelia/Tests/Rewriting/RewritingRetrieverTest.php index e237d65fb..9636d3516 100755 --- a/core/lib/Thelia/Tests/Rewriting/RewritingRetrieverTest.php +++ b/core/lib/Thelia/Tests/Rewriting/RewritingRetrieverTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Rewriting; diff --git a/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php b/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php index 4a3b7e80e..0f5ffb26c 100755 --- a/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php +++ b/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\TaxEngine; diff --git a/core/lib/Thelia/Tests/TestCaseWithURLToolSetup.php b/core/lib/Thelia/Tests/TestCaseWithURLToolSetup.php index 1320c3020..77817b3bd 100644 --- a/core/lib/Thelia/Tests/TestCaseWithURLToolSetup.php +++ b/core/lib/Thelia/Tests/TestCaseWithURLToolSetup.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests; diff --git a/core/lib/Thelia/Tests/Tools/FileManagerTest.php b/core/lib/Thelia/Tests/Tools/FileManagerTest.php index a96ab3866..9fe76878b 100644 --- a/core/lib/Thelia/Tests/Tools/FileManagerTest.php +++ b/core/lib/Thelia/Tests/Tools/FileManagerTest.php @@ -1,11 +1,14 @@ - */ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Tests\Tools; diff --git a/core/lib/Thelia/Tests/Tools/URLTest.php b/core/lib/Thelia/Tests/Tools/URLTest.php index b996fe288..a6b934544 100755 --- a/core/lib/Thelia/Tests/Tools/URLTest.php +++ b/core/lib/Thelia/Tests/Tools/URLTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php b/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php index 2a4409860..be36371f0 100755 --- a/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php +++ b/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/AlphaNumStringTypeTest.php b/core/lib/Thelia/Tests/Type/AlphaNumStringTypeTest.php index 8f752432f..e5ba2dd9b 100755 --- a/core/lib/Thelia/Tests/Type/AlphaNumStringTypeTest.php +++ b/core/lib/Thelia/Tests/Type/AlphaNumStringTypeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/AnyTypeTest.php b/core/lib/Thelia/Tests/Type/AnyTypeTest.php index e4750000e..5e07b18be 100755 --- a/core/lib/Thelia/Tests/Type/AnyTypeTest.php +++ b/core/lib/Thelia/Tests/Type/AnyTypeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/BooleanTypeTest.php b/core/lib/Thelia/Tests/Type/BooleanTypeTest.php index a4842a39f..2166ca132 100755 --- a/core/lib/Thelia/Tests/Type/BooleanTypeTest.php +++ b/core/lib/Thelia/Tests/Type/BooleanTypeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/EnumListTypeTest.php b/core/lib/Thelia/Tests/Type/EnumListTypeTest.php index a225464c1..fbc453465 100755 --- a/core/lib/Thelia/Tests/Type/EnumListTypeTest.php +++ b/core/lib/Thelia/Tests/Type/EnumListTypeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/EnumTypeTest.php b/core/lib/Thelia/Tests/Type/EnumTypeTest.php index 10660ee38..1957ebe68 100755 --- a/core/lib/Thelia/Tests/Type/EnumTypeTest.php +++ b/core/lib/Thelia/Tests/Type/EnumTypeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/FloatTypeTest.php b/core/lib/Thelia/Tests/Type/FloatTypeTest.php index 600c696f8..9f2452652 100755 --- a/core/lib/Thelia/Tests/Type/FloatTypeTest.php +++ b/core/lib/Thelia/Tests/Type/FloatTypeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/IntListTypeTest.php b/core/lib/Thelia/Tests/Type/IntListTypeTest.php index a10d124e4..0f8ce00fc 100755 --- a/core/lib/Thelia/Tests/Type/IntListTypeTest.php +++ b/core/lib/Thelia/Tests/Type/IntListTypeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/IntToCombinedIntsListTypeTest.php b/core/lib/Thelia/Tests/Type/IntToCombinedIntsListTypeTest.php index 9db5c96fd..015df3c37 100755 --- a/core/lib/Thelia/Tests/Type/IntToCombinedIntsListTypeTest.php +++ b/core/lib/Thelia/Tests/Type/IntToCombinedIntsListTypeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/IntToCombinedStringsListTypeTest.php b/core/lib/Thelia/Tests/Type/IntToCombinedStringsListTypeTest.php index de308694f..c990e4bb3 100755 --- a/core/lib/Thelia/Tests/Type/IntToCombinedStringsListTypeTest.php +++ b/core/lib/Thelia/Tests/Type/IntToCombinedStringsListTypeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/IntTypeTest.php b/core/lib/Thelia/Tests/Type/IntTypeTest.php index 7d39093dc..7f3144d27 100755 --- a/core/lib/Thelia/Tests/Type/IntTypeTest.php +++ b/core/lib/Thelia/Tests/Type/IntTypeTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tests/Type/JsonTypeTest.php b/core/lib/Thelia/Tests/Type/JsonTypeTest.php index 1f4b0162b..a0f64986d 100755 --- a/core/lib/Thelia/Tests/Type/JsonTypeTest.php +++ b/core/lib/Thelia/Tests/Type/JsonTypeTest.php @@ -1,26 +1,14 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ - namespace Thelia\Tests\Type; use Thelia\Type\JsonType; diff --git a/core/lib/Thelia/Tests/Type/TypeCollectionTest.php b/core/lib/Thelia/Tests/Type/TypeCollectionTest.php index a1afb6889..6e16d2e90 100755 --- a/core/lib/Thelia/Tests/Type/TypeCollectionTest.php +++ b/core/lib/Thelia/Tests/Type/TypeCollectionTest.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tests\Type; diff --git a/core/lib/Thelia/Tools/DateTimeFormat.php b/core/lib/Thelia/Tools/DateTimeFormat.php index 50c757536..f6a7139c4 100644 --- a/core/lib/Thelia/Tools/DateTimeFormat.php +++ b/core/lib/Thelia/Tools/DateTimeFormat.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tools; diff --git a/core/lib/Thelia/Tools/FileManager.php b/core/lib/Thelia/Tools/FileManager.php index c3f02bcb8..351283d8c 100644 --- a/core/lib/Thelia/Tools/FileManager.php +++ b/core/lib/Thelia/Tools/FileManager.php @@ -1,25 +1,15 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ + namespace Thelia\Tools; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/core/lib/Thelia/Tools/I18n.php b/core/lib/Thelia/Tools/I18n.php index 9931f4087..57bf92e0b 100644 --- a/core/lib/Thelia/Tools/I18n.php +++ b/core/lib/Thelia/Tools/I18n.php @@ -1,25 +1,14 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ namespace Thelia\Tools; diff --git a/core/lib/Thelia/Tools/Image.php b/core/lib/Thelia/Tools/Image.php index 2558c9bd4..c3bfd07fa 100644 --- a/core/lib/Thelia/Tools/Image.php +++ b/core/lib/Thelia/Tools/Image.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tools; diff --git a/core/lib/Thelia/Tools/MoneyFormat.php b/core/lib/Thelia/Tools/MoneyFormat.php index 11d3136d8..0fbfbca84 100644 --- a/core/lib/Thelia/Tools/MoneyFormat.php +++ b/core/lib/Thelia/Tools/MoneyFormat.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tools; diff --git a/core/lib/Thelia/Tools/NumberFormat.php b/core/lib/Thelia/Tools/NumberFormat.php index b9f9bb7b5..21b86276f 100644 --- a/core/lib/Thelia/Tools/NumberFormat.php +++ b/core/lib/Thelia/Tools/NumberFormat.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tools; diff --git a/core/lib/Thelia/Tools/Password.php b/core/lib/Thelia/Tools/Password.php index 8284136cc..c886337f2 100644 --- a/core/lib/Thelia/Tools/Password.php +++ b/core/lib/Thelia/Tools/Password.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tools; diff --git a/core/lib/Thelia/Tools/PhpUnitUtils.php b/core/lib/Thelia/Tools/PhpUnitUtils.php deleted file mode 100644 index e60c22fe1..000000000 --- a/core/lib/Thelia/Tools/PhpUnitUtils.php +++ /dev/null @@ -1,56 +0,0 @@ -. */ -/* */ -/**********************************************************************************/ - -namespace Thelia\Tools; - -/** - * Created by JetBrains PhpStorm. - * Date: 8/19/13 - * Time: 3:24 PM - * - * Helper for Unit Testing - * - * @package Coupon - * @author Guillaume MOREL - * - */ -class PhpUnitUtils -{ - /** - * Allow to call a protected methods - * - * @param Object $obj Class name + namespace - * @param string $name Method name - * @param array $args Method arguments - * - * @return mixed protected method result - */ - public static function callMethod($obj, $name, array $args) - { - $class = new \ReflectionClass(get_class($obj)); - $method = $class->getMethod($name); - $method->setAccessible(true); - - return $method->invokeArgs($obj, $args); - } -} diff --git a/core/lib/Thelia/Tools/Redirect.php b/core/lib/Thelia/Tools/Redirect.php index 817cc6f33..faad58b2e 100644 --- a/core/lib/Thelia/Tools/Redirect.php +++ b/core/lib/Thelia/Tools/Redirect.php @@ -1,38 +1,33 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tools; +use Symfony\Component\HttpFoundation\Cookie; use Symfony\Component\HttpFoundation\RedirectResponse; use Thelia\Log\Tlog; class Redirect { - public static function exec($url, $status = 302) + public static function exec($url, $status = 302, $cookies = array()) { if (false == Tlog::getInstance()->showRedirect($url)) { $response = new RedirectResponse($url, $status); - + foreach ($cookies as $cookie) { + if (!$cookie instanceof Cookie) { + throw new \InvalidArgumentException(sprintf('Third parameter is not a valid Cookie object.')); + } + $response->headers->setCookie($cookie); + } $response->send(); } } diff --git a/core/lib/Thelia/Tools/Rest/ResponseRest.php b/core/lib/Thelia/Tools/Rest/ResponseRest.php index 9df26e0d8..863b93447 100644 --- a/core/lib/Thelia/Tools/Rest/ResponseRest.php +++ b/core/lib/Thelia/Tools/Rest/ResponseRest.php @@ -1,5 +1,14 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Tools; +use Symfony\Component\Routing\RequestContext; use Thelia\Model\ConfigQuery; use Thelia\Rewriting\RewritingResolver; use Thelia\Rewriting\RewritingRetriever; @@ -32,9 +22,13 @@ use Symfony\Component\DependencyInjection\ContainerInterface; class URL { + /** @var RewritingResolver $resolver */ protected $resolver = null; + + /** @var RewritingRetriever $retriever */ protected $retriever = null; + /** @var RequestContext $requestContext */ protected $requestContext; const PATH_TO_FILE = true; @@ -42,10 +36,13 @@ class URL protected static $instance = null; + /** @var string $baseUrlScheme a cache for the base URL scheme */ + private $baseUrlScheme = null; + public function __construct(ContainerInterface $container = null) { - // Allow singleton style calls once intanciated. - // For this to work, the URL service has to be instanciated very early. This is done manually + // Allow singleton style calls once instantiated. + // For this to work, the URL service has to be instantiated very early. This is done manually // in TheliaHttpKernel, by calling $this->container->get('thelia.url.manager'); self::$instance = $this; @@ -72,26 +69,34 @@ class URL * Return the base URL, either the base_url defined in Config, or the URL * of the current language, if 'one_domain_foreach_lang' is enabled. * + * @param bool $scheme_only if true, only the scheme will be returned. If false, the complete base URL, including path, is returned. + * * @return string the base URL, with a trailing '/' */ - public function getBaseUrl() + public function getBaseUrl($scheme_only = false) { - if ($host = $this->requestContext->getHost()) { + if (null === $this->baseUrlScheme) { - $scheme = $this->requestContext->getScheme(); + $scheme = "http"; + $port = 80; - $port = ''; + if ($host = $this->requestContext->getHost()) { - if ('http' === $scheme && 80 != $this->requestContext->getHttpPort()) { - $port = ':'.$this->requestContext->getHttpPort(); - } elseif ('https' === $scheme && 443 != $this->requestContext->getHttpsPort()) { - $port = ':'.$this->requestContext->getHttpsPort(); + $scheme = $this->requestContext->getScheme(); + + $port = ''; + + if ('http' === $scheme && 80 != $this->requestContext->getHttpPort()) { + $port = ':'.$this->requestContext->getHttpPort(); + } elseif ('https' === $scheme && 443 != $this->requestContext->getHttpsPort()) { + $port = ':'.$this->requestContext->getHttpsPort(); + } } - $schemeAuthority = "$scheme://$host"."$port"; + $this->baseUrlScheme = "$scheme://$host"."$port"; } - return $schemeAuthority.$this->requestContext->getBaseUrl(); + return $scheme_only ? $this->baseUrlScheme : $this->baseUrlScheme . $this->requestContext->getBaseUrl(); } /** @@ -119,17 +124,27 @@ class URL // Already absolute ? if (substr($path, 0, 4) != 'http') { - $base_url = $this->getBaseUrl(); + // Prevent duplication of the subdirectory name when Thelia is installed in a subdirectory. + // This happens when $path was calculated with Router::generate(), which returns an absolute URL, + // starting at web server root. For example, if Thelia is installed in /thelia2, we got something like /thelia2/my/path + // As base URL also contains /thelia2 (e.g. http://some.server.com/thelia2), we end up with + // http://some.server.com/thelia2/thelia2/my/path, instead of http://some.server.com/thelia2/my/path + // We have to compensate for this. + $rcbu = $this->requestContext->getBaseUrl(); + $hasSubdirectory = ! empty($rcbu) && (0 === strpos($path, $rcbu)); + + $base_url = $this->getBaseUrl($hasSubdirectory); + + /* Seems no longer required // TODO fix this ugly patch if (strpos($path, "index_dev.php")) { $path = str_replace('index_dev.php', '', $path); } + */ // If only a path is requested, be sure to remove the script name (index.php or index_dev.php), if any. if ($path_only == self::PATH_TO_FILE) { - - // As the base_url always ends with '/', if we don't find / at the end, we have a script. if (substr($base_url, -3) == 'php') $base_url = dirname($base_url); } diff --git a/core/lib/Thelia/Type/AlphaNumStringListType.php b/core/lib/Thelia/Type/AlphaNumStringListType.php index 474a615db..d40175c4f 100644 --- a/core/lib/Thelia/Type/AlphaNumStringListType.php +++ b/core/lib/Thelia/Type/AlphaNumStringListType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/AlphaNumStringType.php b/core/lib/Thelia/Type/AlphaNumStringType.php index db788d4d6..039f97957 100644 --- a/core/lib/Thelia/Type/AlphaNumStringType.php +++ b/core/lib/Thelia/Type/AlphaNumStringType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/AnyType.php b/core/lib/Thelia/Type/AnyType.php index 4e844c6e9..ddf2139ef 100644 --- a/core/lib/Thelia/Type/AnyType.php +++ b/core/lib/Thelia/Type/AnyType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/BaseType.php b/core/lib/Thelia/Type/BaseType.php index 79a859632..0aa1b0545 100644 --- a/core/lib/Thelia/Type/BaseType.php +++ b/core/lib/Thelia/Type/BaseType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; use Symfony\Component\Validator\ExecutionContextInterface; diff --git a/core/lib/Thelia/Type/BooleanOrBothType.php b/core/lib/Thelia/Type/BooleanOrBothType.php index 25f3d9994..dea41e7a1 100644 --- a/core/lib/Thelia/Type/BooleanOrBothType.php +++ b/core/lib/Thelia/Type/BooleanOrBothType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/BooleanType.php b/core/lib/Thelia/Type/BooleanType.php index 5f36453de..05be70bbd 100644 --- a/core/lib/Thelia/Type/BooleanType.php +++ b/core/lib/Thelia/Type/BooleanType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/EnumListType.php b/core/lib/Thelia/Type/EnumListType.php index 5b54c48bf..99e7599b1 100644 --- a/core/lib/Thelia/Type/EnumListType.php +++ b/core/lib/Thelia/Type/EnumListType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/EnumType.php b/core/lib/Thelia/Type/EnumType.php index 1283acde0..600842ec8 100644 --- a/core/lib/Thelia/Type/EnumType.php +++ b/core/lib/Thelia/Type/EnumType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/FloatToFloatArrayType.php b/core/lib/Thelia/Type/FloatToFloatArrayType.php index 08a310ef0..3628d5049 100644 --- a/core/lib/Thelia/Type/FloatToFloatArrayType.php +++ b/core/lib/Thelia/Type/FloatToFloatArrayType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/FloatType.php b/core/lib/Thelia/Type/FloatType.php index 830622a86..634731193 100644 --- a/core/lib/Thelia/Type/FloatType.php +++ b/core/lib/Thelia/Type/FloatType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/IntListType.php b/core/lib/Thelia/Type/IntListType.php index 5fe31aa3c..d52ff2d83 100644 --- a/core/lib/Thelia/Type/IntListType.php +++ b/core/lib/Thelia/Type/IntListType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/IntToCombinedIntsListType.php b/core/lib/Thelia/Type/IntToCombinedIntsListType.php index 777759bca..2574c9159 100644 --- a/core/lib/Thelia/Type/IntToCombinedIntsListType.php +++ b/core/lib/Thelia/Type/IntToCombinedIntsListType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/IntToCombinedStringsListType.php b/core/lib/Thelia/Type/IntToCombinedStringsListType.php index 017c60191..3d7066d45 100644 --- a/core/lib/Thelia/Type/IntToCombinedStringsListType.php +++ b/core/lib/Thelia/Type/IntToCombinedStringsListType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/IntType.php b/core/lib/Thelia/Type/IntType.php index 5aa146e60..a7e4aa042 100644 --- a/core/lib/Thelia/Type/IntType.php +++ b/core/lib/Thelia/Type/IntType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/JsonType.php b/core/lib/Thelia/Type/JsonType.php index 502a43953..c00661fbd 100644 --- a/core/lib/Thelia/Type/JsonType.php +++ b/core/lib/Thelia/Type/JsonType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/ModelType.php b/core/lib/Thelia/Type/ModelType.php index a8ab8c553..e2bb1d896 100644 --- a/core/lib/Thelia/Type/ModelType.php +++ b/core/lib/Thelia/Type/ModelType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; use Propel\Runtime\ActiveRecord\ActiveRecordInterface; diff --git a/core/lib/Thelia/Type/ModelValidIdType.php b/core/lib/Thelia/Type/ModelValidIdType.php index b3579a51a..e3419fdd2 100644 --- a/core/lib/Thelia/Type/ModelValidIdType.php +++ b/core/lib/Thelia/Type/ModelValidIdType.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; use Propel\Runtime\ActiveQuery\ModelCriteria; diff --git a/core/lib/Thelia/Type/TypeCollection.php b/core/lib/Thelia/Type/TypeCollection.php index 2ee5c9c66..16668b5a6 100644 --- a/core/lib/Thelia/Type/TypeCollection.php +++ b/core/lib/Thelia/Type/TypeCollection.php @@ -1,25 +1,15 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ + namespace Thelia\Type; /** diff --git a/core/lib/Thelia/Type/TypeInterface.php b/core/lib/Thelia/Type/TypeInterface.php index 99e2f77e0..8f8839bc1 100644 --- a/core/lib/Thelia/Type/TypeInterface.php +++ b/core/lib/Thelia/Type/TypeInterface.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/local/config/schema.xml b/local/config/schema.xml index 7e9341bf4..5607438d1 100644 --- a/local/config/schema.xml +++ b/local/config/schema.xml @@ -109,9 +109,9 @@ - - - + + + @@ -161,11 +161,11 @@ - - - - - + + + + + @@ -225,11 +225,11 @@ - - - - - + + + + +
@@ -249,10 +249,10 @@ - - - - + + + +
@@ -326,11 +326,11 @@ - - - - - + + + + + @@ -375,7 +375,7 @@
- + @@ -461,9 +461,9 @@ - - - + + +
@@ -522,10 +522,10 @@ - - - - + + + + @@ -553,7 +553,7 @@
- + @@ -630,12 +630,12 @@ - - - - - - + + + + + + @@ -728,6 +728,9 @@ + + + @@ -1079,10 +1082,10 @@ - - - - + + + + @@ -1103,10 +1106,10 @@ - - - - + + + + @@ -1127,10 +1130,10 @@ - - - - + + + + @@ -1250,16 +1253,16 @@ - - - - - - - - - - + + + + + + + + + +
@@ -1297,10 +1300,10 @@ - - - - + + + + diff --git a/local/modules/Cheque/Cheque.php b/local/modules/Cheque/Cheque.php index 05cac75aa..03ab086be 100644 --- a/local/modules/Cheque/Cheque.php +++ b/local/modules/Cheque/Cheque.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Cheque; diff --git a/local/modules/Colissimo/AdminIncludes/module_configuration.html b/local/modules/Colissimo/AdminIncludes/module_configuration.html index d45792dcd..0de51f095 100755 --- a/local/modules/Colissimo/AdminIncludes/module_configuration.html +++ b/local/modules/Colissimo/AdminIncludes/module_configuration.html @@ -1,152 +1,258 @@ -
- - {loop name="checkrights.colissimo" type="colissimo.check.rights"} -
-

{$ERRMES} {$ERRFILE} | {intl l="Please change the access rights"}.

-
- {/loop} -
- -{elseloop rel="checkrights.colissimo"} - - - - -
-
-
-

{intl l="Colissimo Module allows to send your products all around the world with La Poste."}

-
- -
- - {assign var="isColissimoFreeShipping" value=0} - {form name="colissimo.freeshipping.form"} - - {form_hidden_fields form=$form} - - {form_field form=$form field="freeshipping"} - - -
- -
- {/form_field} - - {/form} -
- - - - - - - - - - {loop type="colissimo" name="colissimo" area=$ID} - {* -- EDIT price slice confirmation dialog ----------------------------------- *} - {include - file = "includes/generic-confirm-dialog.html" - - dialog_id = "price_slice_edit_dialog_{$ID}_{$MAX_WEIGHT|replace:'.':'-'}" - dialog_title = {intl l="Edit a price slice"} - dialog_message = " - - - - " - - form_action="{url path="/admin/module/colissimo/prices"}" - dialog_ok_label = {intl l="Edit"} - dialog_cancel_label = {intl l="Cancel"} - } - {* -- Delete price slice confirmation dialog ----------------------------------- *} - {include - file = "includes/generic-confirm-dialog.html" - - dialog_id = "price_slice_delete_dialog_{$ID}_{$MAX_WEIGHT|replace:'.':'-'}" - dialog_title = {intl l="Delete a price slice"} - dialog_message = " - - - {intl l="Do you really want to delete this slice ?"}" - - form_action="{url path="/admin/module/colissimo/prices"}" - dialog_ok_label = {intl l="Delete"} - dialog_cancel_label = {intl l="Cancel"} - } - - - - - - - {/loop} - -
- {intl l="Area : "}{$NAME} - {loop type="auth" name="can_create" role="ADMIN" module="colissimo" access="CREATE"} - - - - {/loop} -
{intl l="Weight up to ... (kg)"}{intl l="Price (€)"}{intl l="Actions"}
{$MAX_WEIGHT}{$PRICE} -
- {loop type="auth" name="can_change" role="ADMIN" module="colissimo" access="UPDATE"} - - - - - - - {/loop} -
-
- - {/loop} - - - - - - - -{/elseloop} +
+ + {loop name="checkrights.colissimo" type="colissimo.check.rights"} +
+

{$ERRMES} {$ERRFILE} | {intl d='colissimo.ai' l="Please change the access rights"}.

+
+ {/loop} +
+ +{elseloop rel="checkrights.colissimo"} + +
+

{intl d='colissimo.ai' l="Colissimo Module allows to send your products all around the world with La Poste."}

+
+ + + + +
+
+
+ +
+
+ {form name="colissimo.export.form"} + {if $form_error}
{$form_error_message}
{/if} +
+ {form_hidden_fields form=$form} +
+ {form_field form=$form field="status_id"} +
+ {intl d='colissimo.ai' l="Change orders status after export"} +
+
+ + + + + + + + + + + + + + + +
+   + + +
+   + + +
+   + + +
+ {/form_field} + {intl d='colissimo.ai' l="*If you choose this option, the exported orders would not be available on this page anymore"} +
+
+ + + + + + + + + + {loop name="colissimo.notsend.loop" type="colissimo.notsend.loop"} + {form_field form=$form field="order_"|cat:$ID} + + + + + + + {/form_field} + {/loop} + {elseloop rel="colissimo.notsend.loop"} + + + + {/elseloop} + +
+ {intl d='colissimo.ai' l="REF"} + + {intl d='colissimo.ai' l="Date"} + + {intl d='colissimo.ai' l="Total taxed amount"} + + {intl d='colissimo.ai' l="Export"} +
+ + + {$CREATE_DATE|date_format} + + {$TOTAL_TAXED_AMOUNT} {loop name="list.socolissimo.getcurrency" type="currency" id=$CURRENCY}{$SYMBOL}{/loop} + + +
+
+
{intl d='colissimo.ai' l="There is currently not orders to export"}
+
+ + {ifloop rel="colissimo.notsend.loop"} + + {/ifloop} +
+ {/form} +
+ +
+ + {assign var="isColissimoFreeShipping" value=0} + {form name="colissimo.freeshipping.form"} +
+
+ {form_hidden_fields form=$form} + + {form_field form=$form field="freeshipping"} + + +
+ +
+ {/form_field} +
+ {/form} + +
+
+
+
+
+ + +{/elseloop} diff --git a/local/modules/Colissimo/Colissimo.php b/local/modules/Colissimo/Colissimo.php index 90d32df35..f343df269 100755 --- a/local/modules/Colissimo/Colissimo.php +++ b/local/modules/Colissimo/Colissimo.php @@ -1,39 +1,28 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ /*************************************************************************************/ namespace Colissimo; use Colissimo\Model\ColissimoFreeshippingQuery; use Propel\Runtime\Connection\ConnectionInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpFoundation\Request; +use Thelia\Core\Translation\Translator; use Thelia\Exception\OrderException; use Thelia\Install\Database; use Thelia\Model\Country; -use Thelia\Module\BaseModule; -use Thelia\Module\DeliveryModuleInterface; +use Thelia\Module\AbstractDeliveryModule; +use Thelia\Module\Exception\DeliveryException; -class Colissimo extends BaseModule implements DeliveryModuleInterface +class Colissimo extends AbstractDeliveryModule { protected $request; protected $dispatcher; @@ -42,15 +31,42 @@ class Colissimo extends BaseModule implements DeliveryModuleInterface const JSON_PRICE_RESOURCE = "/Config/prices.json"; + const MESSAGE_DOMAIN = 'colissimo'; + public static function getPrices() { - if(null === self::$prices) { + if (null === self::$prices) { self::$prices = json_decode(file_get_contents(sprintf('%s%s', __DIR__, self::JSON_PRICE_RESOURCE)), true); } return self::$prices; } + public function isValidDelivery(Country $country) { + + $areaId = $country->getAreaId(); + + $prices = self::getPrices(); + + /* Check if Colissimo delivers the area */ + if (isset($prices[$areaId]) && isset($prices[$areaId]["slices"])) { + + // Yes ! Check if the cart weight is below slice limit + $areaPrices = $prices[$areaId]["slices"]; + ksort($areaPrices); + + /* Check cart weight is below the maximum weight */ + end($areaPrices); + $maxWeight = key($areaPrices); + + $cartWeight = $this->getRequest()->getSession()->getCart()->getWeight(); + + if ($cartWeight <= $maxWeight) return true; + } + + return false; + } + /** * @param $areaId * @param $weight @@ -61,29 +77,37 @@ class Colissimo extends BaseModule implements DeliveryModuleInterface public static function getPostageAmount($areaId, $weight) { $freeshipping = ColissimoFreeshippingQuery::create()->getLast(); - $postage=0; - if(!$freeshipping) { + $postage = 0; + if (!$freeshipping) { $prices = self::getPrices(); /* check if Colissimo delivers the asked area */ - if(!isset($prices[$areaId]) || !isset($prices[$areaId]["slices"])) { - throw new OrderException("Colissimo delivery unavailable for the chosen delivery country", OrderException::DELIVERY_MODULE_UNAVAILABLE); + if (!isset($prices[$areaId]) || !isset($prices[$areaId]["slices"])) { + throw new DeliveryException( + Translator::getInstance()->trans("Colissimo delivery unavailable for the delivery country", [], self::MESSAGE_DOMAIN) + ); } $areaPrices = $prices[$areaId]["slices"]; ksort($areaPrices); - /* check this weight is not too much */ + /* Check cart weight is below the maximum weight */ end($areaPrices); $maxWeight = key($areaPrices); - if($weight > $maxWeight) { - throw new OrderException(sprintf("Colissimo delivery unavailable for this cart weight (%s kg)", $weight), OrderException::DELIVERY_MODULE_UNAVAILABLE); + if ($weight > $maxWeight) { + throw new DeliveryException( + Translator::getInstance()->trans( + "Colissimo delivery unavailable for this cart weight (%weight kg)", + array("%weight" => $weight), + self::MESSAGE_DOMAIN + ) + ); } $postage = current($areaPrices); - while(prev($areaPrices)) { - if($weight > key($areaPrices)) { + while (prev($areaPrices)) { + if ($weight > key($areaPrices)) { break; } @@ -94,29 +118,9 @@ class Colissimo extends BaseModule implements DeliveryModuleInterface } - public function setRequest(Request $request) - { - $this->request = $request; - } - - public function getRequest() - { - return $this->request; - } - - public function setDispatcher(EventDispatcherInterface $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - public function getDispatcher() - { - return $this->dispatcher; - } - public function postActivation(ConnectionInterface $con = null) { - $database = new Database($con->getWrappedConnection()); + $database = new Database($con); $database->insertSql(null, array(__DIR__ . '/Config/thelia.sql')); } @@ -131,7 +135,7 @@ class Colissimo extends BaseModule implements DeliveryModuleInterface */ public function getPostage(Country $country) { - $cartWeight = $this->getContainer()->get('request')->getSession()->getCart()->getWeight(); + $cartWeight = $this->getRequest()->getSession()->getCart()->getWeight(); $postage = self::getPostageAmount( $country->getAreaId(), @@ -140,10 +144,4 @@ class Colissimo extends BaseModule implements DeliveryModuleInterface return $postage; } - - public function getCode() - { - return 'Colissimo'; - } - -} +} \ No newline at end of file diff --git a/local/modules/Colissimo/Config/config.xml b/local/modules/Colissimo/Config/config.xml index eb0ec4aa2..420bc821c 100755 --- a/local/modules/Colissimo/Config/config.xml +++ b/local/modules/Colissimo/Config/config.xml @@ -7,10 +7,12 @@ +
+ diff --git a/local/modules/Colissimo/Config/module.xml b/local/modules/Colissimo/Config/module.xml index 1f47ad9c9..b05f70d7f 100755 --- a/local/modules/Colissimo/Config/module.xml +++ b/local/modules/Colissimo/Config/module.xml @@ -1,18 +1,18 @@ - - - Colissimo\Colissimo - - colisimo - - - colisimo - - 1.0 - - Manuel Raynaud - mraynaud@openstudio.fr - - delivery - 2.0.0 - alpha - + + + Colissimo\Colissimo + + Colissimo delivery + + + Livraison par Colissimo + + 1.0 + + Manuel Raynaud + mraynaud@openstudio.fr + + delivery + 2.0.0 + alpha + diff --git a/local/modules/Colissimo/Config/prices.json b/local/modules/Colissimo/Config/prices.json index 3fc2e0cd7..1b23c825c 100755 --- a/local/modules/Colissimo/Config/prices.json +++ b/local/modules/Colissimo/Config/prices.json @@ -1 +1,120 @@ -{"1":{"_info":"area 1 : France","slices":{"0.25":"5.23","0.5":5.8,"0.75":6.56,"1":7.13,"2":8.08,"3":9.22,"5":11.31,"7":13.4,"10":16.53,"15":19.14,"30":26.93}},"2":{"_info":"area 2 : A Zone - Union Europ\u00e9enne et Suisse","slices":{"1":15.34,"2":16.96,"3":20.47,"4":23.99,"5":27.5,"6":31.02,"7":34.53,"8":38.05,"9":41.56,"10":45.08,"15":51.92,"20":58.76,"25":65.6,"30":72.44}},"3":{"_info":"area 3 : B Zone - Pays de l\u2019Europe de l\u2019Est (hors Union Europ\u00e9enne), Norv\u00e8ge, Maghreb","slices":{"1":18.81,"2":20.62,"3":24.94,"4":29.26,"5":33.58,"6":37.91,"7":42.23,"8":46.55,"9":50.87,"10":55.2,"15":65.08,"20":74.96}},"4":{"_info":"area 4 : C Zone - Pays d\u2019Afrique hors Maghreb, Canada, Etats-Unis, Proche et Moyen Orient","slices":{"1":22.04,"2":29.55,"3":38.86,"4":48.17,"5":57.48,"6":66.79,"7":76.1,"8":85.41,"9":94.72,"10":104.03,"15":126.92,"20":149.82}},"5":{"_info":"area 5 : D Zone - Autres destinations","slices":{"1":25.08,"2":37.72,"3":50.26,"4":62.8,"5":75.34,"6":87.88,"7":100.42,"8":112.96,"9":125.5,"10":138.04,"15":162.74,"20":187.44}},"6":{"_info":"area 6 : France OM1","slices":{"0.5":8.27,"1":12.49,"2":17.05,"3":21.61,"4":26.17,"5":30.73,"6":35.29,"7":39.85,"8":44.41,"9":48.97,"10":53.53,"15":76.33,"20":99.13,"25":121.93,"30":144.73}},"7":{"_info":"area 7 : France OM2","slices":{"0.5":9.88,"1":14.92,"2":26.32,"3":37.72,"4":49.12,"5":60.52,"6":71.92,"7":83.32,"8":94.72,"9":106.12,"10":117.52,"15":174.52,"20":231.52,"25":288.52,"30":345.52}}} \ No newline at end of file +{"1": { + "_info": "area 1 : France", + "slices": { + "0.25": "5.23", + "0.5": 5.8, + "0.75": 6.56, + "1": 7.13, + "2": 8.08, + "3": 9.22, + "5": 11.31, + "7": 13.4, + "10": 16.53, + "15": 19.14, + "30": 26.93 + } +}, "2": { + "_info": "area 2 : A Zone - Union Europ\u00e9enne et Suisse", + "slices": { + "1": 15.34, + "2": 16.96, + "3": 20.47, + "4": 23.99, + "5": 27.5, + "6": 31.02, + "7": 34.53, + "8": 38.05, + "9": 41.56, + "10": 45.08, + "15": 51.92, + "20": 58.76, + "25": 65.6, + "30": 72.44 + } +}, "3": { + "_info": "area 3 : B Zone - Pays de l\u2019Europe de l\u2019Est (hors Union Europ\u00e9enne), Norv\u00e8ge, Maghreb", + "slices": { + "1": 18.81, + "2": 20.62, + "3": 24.94, + "4": 29.26, + "5": 33.58, + "6": 37.91, + "7": 42.23, + "8": 46.55, + "9": 50.87, + "10": 55.2, + "15": 65.08, + "20": 74.96 + } +}, "4": { + "_info": "area 4 : C Zone - Pays d\u2019Afrique hors Maghreb, Canada, Etats-Unis, Proche et Moyen Orient", + "slices": { + "1": 22.04, + "2": 29.55, + "3": 38.86, + "4": 48.17, + "5": 57.48, + "6": 66.79, + "7": 76.1, + "8": 85.41, + "9": 94.72, + "10": 104.03, + "15": 126.92, + "20": 149.82 + } +}, "5": { + "_info": "area 5 : D Zone - Autres destinations", + "slices": { + "1": 25.08, + "2": 37.72, + "3": 50.26, + "4": 62.8, + "5": 75.34, + "6": 87.88, + "7": 100.42, + "8": 112.96, + "9": 125.5, + "10": 138.04, + "15": 162.74, + "20": 187.44 + } +}, "6": { + "_info": "area 6 : France OM1", + "slices": { + "0.5": 8.27, + "1": 12.49, + "2": 17.05, + "3": 21.61, + "4": 26.17, + "5": 30.73, + "6": 35.29, + "7": 39.85, + "8": 44.41, + "9": 48.97, + "10": 53.53, + "15": 76.33, + "20": 99.13, + "25": 121.93, + "30": 144.73 + } +}, "7": { + "_info": "area 7 : France OM2", + "slices": { + "0.5": 9.88, + "1": 14.92, + "2": 26.32, + "3": 37.72, + "4": 49.12, + "5": 60.52, + "6": 71.92, + "7": 83.32, + "8": 94.72, + "9": 106.12, + "10": 117.52, + "15": 174.52, + "20": 231.52, + "25": 288.52, + "30": 345.52 + } +}} \ No newline at end of file diff --git a/local/modules/Colissimo/Config/routing.xml b/local/modules/Colissimo/Config/routing.xml index 68fc231af..54fa8977e 100755 --- a/local/modules/Colissimo/Config/routing.xml +++ b/local/modules/Colissimo/Config/routing.xml @@ -10,4 +10,8 @@ Colissimo\Controller\FreeShipping::set + + + Colissimo\Controller\Export::exportAction + diff --git a/local/modules/Colissimo/Config/thelia.sql b/local/modules/Colissimo/Config/thelia.sql index 4764a7244..6c690d3fe 100755 --- a/local/modules/Colissimo/Config/thelia.sql +++ b/local/modules/Colissimo/Config/thelia.sql @@ -1,50 +1,50 @@ - -# This is a fix for InnoDB in MySQL >= 4.1.x -# It "suspends judgement" for fkey relationships until are tables are set. -SET FOREIGN_KEY_CHECKS = 0; - --- --------------------------------------------------------------------- --- colissimo_freeshipping --- --------------------------------------------------------------------- - -DROP TABLE IF EXISTS `colissimo_freeshipping`; - -CREATE TABLE `colissimo_freeshipping` -( - `id` INTEGER NOT NULL AUTO_INCREMENT, - `active` TINYINT(1) NOT NULL, - `created_at` DATETIME, - `updated_at` DATETIME, - PRIMARY KEY (`id`) -) ENGINE=InnoDB; - -INSERT INTO `colissimo_freeshipping`(`active`, `created_at`, `updated_at`) VALUES (0, NOW(), NOW()); - --- --------------------------------------------------------------------- --- Mail templates for colissimo --- --------------------------------------------------------------------- --- First, delete existing entries -SET @var := 0; -SELECT @var := `id` FROM `message` WHERE name="mail_colissimo"; -DELETE FROM `message` WHERE `id`=@var; --- Try if ON DELETE constraint isn't set -DELETE FROM `message_i18n` WHERE `id`=@var; - --- Then add new entries -SELECT @max := MAX(`id`) FROM `message`; -SET @max := @max+1; --- insert message -INSERT INTO `message` (`id`, `name`, `secured`) VALUES -(@max, -'mail_colissimo', -'0' -); - --- and template fr_FR -INSERT INTO `message_i18n` (`id`, `locale`, `title`, `subject`, `text_message`, `html_message`) VALUES -(@max, 'fr_FR', 'mail livraison colissimo', 'Suivi colissimo commande : {$order_ref}', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n{$LASTNAME} {$FIRSTNAME},\r\n{/loop}\r\nNous vous remercions de votre commande sur notre site {config key="store_name"}\r\nUn colis concernant votre commande {$order_ref} du {format_date date=$order_date} a quitté nos entrepôts pour être pris en charge par La Poste le {format_date date=$update_date}.\r\nSon numéro de suivi est le suivant : {$package}\r\nIl vous permet de suivre votre colis en ligne sur le site de La Poste : www.coliposte.net\r\nIl vous sera, par ailleurs, très utile si vous étiez absent au moment de la livraison de votre colis : en fournissant ce numéro de Colissimo Suivi, vous pourrez retirer votre colis dans le bureau de Poste le plus proche.\r\nATTENTION ! Si vous ne trouvez pas l''avis de passage normalement déposé dans votre boîte aux lettres au bout de 48 Heures jours ouvrables, n''hésitez pas à aller le réclamer à votre bureau de Poste, muni de votre numéro de Colissimo Suivi.\r\nNous restons à votre disposition pour toute information complémentaire.\r\nCordialement', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n{$LASTNAME} {$FIRSTNAME},\r\n{/loop}\r\nNous vous remercions de votre commande sur notre site {config key="store_name"}\r\nUn colis concernant votre commande {$order_ref} du {format_date date=$order_date} a quitté nos entrepôts pour être pris en charge par La Poste le {format_date date=$update_date}.\r\nSon numéro de suivi est le suivant : {$package}\r\nIl vous permet de suivre votre colis en ligne sur le site de La Poste : www.coliposte.net\r\nIl vous sera, par ailleurs, très utile si vous étiez absent au moment de la livraison de votre colis : en fournissant ce numéro de Colissimo Suivi, vous pourrez retirer votre colis dans le bureau de Poste le plus proche.\r\nATTENTION ! Si vous ne trouvez pas l''avis de passage normalement déposé dans votre boîte aux lettres au bout de 48 Heures jours ouvrables, n''hésitez pas à aller le réclamer à votre bureau de Poste, muni de votre numéro de Colissimo Suivi.\r\nNous restons à votre disposition pour toute information complémentaire.\r\nCordialement'); - - - -# This restores the fkey checks, after having unset them earlier -SET FOREIGN_KEY_CHECKS = 1; + +# This is a fix for InnoDB in MySQL >= 4.1.x +# It "suspends judgement" for fkey relationships until are tables are set. +SET FOREIGN_KEY_CHECKS = 0; + +-- --------------------------------------------------------------------- +-- colissimo_freeshipping +-- --------------------------------------------------------------------- + +DROP TABLE IF EXISTS `colissimo_freeshipping`; + +CREATE TABLE `colissimo_freeshipping` +( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `active` TINYINT(1) NOT NULL, + `created_at` DATETIME, + `updated_at` DATETIME, + PRIMARY KEY (`id`) +) ENGINE=InnoDB; + +INSERT INTO `colissimo_freeshipping`(`active`, `created_at`, `updated_at`) VALUES (0, NOW(), NOW()); + +-- --------------------------------------------------------------------- +-- Mail templates for colissimo +-- --------------------------------------------------------------------- + +-- First, delete existing entries +SET @var := 0; +SELECT @var := `id` FROM `message` WHERE name="mail_colissimo"; +DELETE FROM `message` WHERE `id`=@var; +-- Try if ON DELETE constraint isn't set +DELETE FROM `message_i18n` WHERE `id`=@var; + +-- Then add new entries +SELECT @max := MAX(`id`) FROM `message`; +SET @max := @max+1; +-- insert message +INSERT INTO `message` (`id`, `name`, `secured`) VALUES +(@max, +'mail_colissimo', +'0' +); + +-- and template fr_FR +INSERT INTO `message_i18n` (`id`, `locale`, `title`, `subject`, `text_message`, `html_message`) VALUES +(@max, 'en_US', 'Colissimo shipping message', 'Your order {$order_ref} has been shipped', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\nDear {$FIRSTNAME} {$LASTNAME},\r\n{/loop}\r\nThank you for your order on our online store {config key="store_name"}.\r\nYour order {$order_ref} dated {format_date date=$order_date} has been shipped on {format_date date=$update_date}.\r\nThe tracking number for this delivery is {$package}. Please check the La Poste website for tracking your parcel: www.coliposte.net.\r\nYou can use this tracking number to get your parcel in your local La Poste office. If don''t get an advice in your mailbox after two working days, claim your parcel at your local La Poste office, using this tracking number.\r\nFeel free to contact us for any forther information\r\nBest Regards.', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n

Dear {$FIRSTNAME} {$LASTNAME},

\r\n{/loop}\r\n

Thank you for your order on our online store {config key="store_name"}.

\r\n

Your order {$order_ref} dated {format_date date=$order_date} has been shipped on {format_date date=$update_date}.\r\nThe tracking number for this delivery is {$package}. Please check the La Poste website for tracking your parcel: www.coliposte.net.

\r\n

You can use this tracking number to get your parcel in your local La Poste office. If don''t get an advice in your mailbox after two working days, claim your parcel at your local La Poste office, using this tracking number.

\r\n

Feel free to contact us for any forther information

\r\n

Best Regards.

'), +(@max, 'fr_FR', 'Message d''expédition de colissimo', 'Suivi colissimo commande : {$order_ref}', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n{$LASTNAME} {$FIRSTNAME},\r\n{/loop}\r\nNous vous remercions de votre commande sur notre site {config key="store_name"}\r\nUn colis concernant votre commande {$order_ref} du {format_date date=$order_date} a quitté nos entrepôts pour être pris en charge par La Poste le {format_date date=$update_date}.\r\nSon numéro de suivi est le suivant : {$package}\r\nIl vous permet de suivre votre colis en ligne sur le site de La Poste : www.coliposte.net\r\nIl vous sera, par ailleurs, très utile si vous étiez absent au moment de la livraison de votre colis : en fournissant ce numéro de Colissimo Suivi, vous pourrez retirer votre colis dans le bureau de Poste le plus proche.\r\nATTENTION ! Si vous ne trouvez pas l''avis de passage normalement déposé dans votre boîte aux lettres au bout de 48 Heures jours ouvrables, n''hésitez pas à aller le réclamer à votre bureau de Poste, muni de votre numéro de Colissimo Suivi.\r\nNous restons à votre disposition pour toute information complémentaire.\r\nCordialement', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n{$LASTNAME} {$FIRSTNAME},\r\n{/loop}\r\nNous vous remercions de votre commande sur notre site {config key="store_name"}\r\nUn colis concernant votre commande {$order_ref} du {format_date date=$order_date} a quitté nos entrepôts pour être pris en charge par La Poste le {format_date date=$update_date}.\r\nSon numéro de suivi est le suivant : {$package}\r\nIl vous permet de suivre votre colis en ligne sur le site de La Poste : www.coliposte.net\r\nIl vous sera, par ailleurs, très utile si vous étiez absent au moment de la livraison de votre colis : en fournissant ce numéro de Colissimo Suivi, vous pourrez retirer votre colis dans le bureau de Poste le plus proche.\r\nATTENTION ! Si vous ne trouvez pas l''avis de passage normalement déposé dans votre boîte aux lettres au bout de 48 Heures jours ouvrables, n''hésitez pas à aller le réclamer à votre bureau de Poste, muni de votre numéro de Colissimo Suivi.\r\nNous restons à votre disposition pour toute information complémentaire.\r\nCordialement'); + +# This restores the fkey checks, after having unset them earlier +SET FOREIGN_KEY_CHECKS = 1; diff --git a/local/modules/Colissimo/Controller/EditPrices.php b/local/modules/Colissimo/Controller/EditPrices.php index 989ed7d68..e732a4fd3 100755 --- a/local/modules/Colissimo/Controller/EditPrices.php +++ b/local/modules/Colissimo/Controller/EditPrices.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Colissimo\Controller; diff --git a/local/modules/Colissimo/Controller/Export.php b/local/modules/Colissimo/Controller/Export.php new file mode 100644 index 000000000..98386f50c --- /dev/null +++ b/local/modules/Colissimo/Controller/Export.php @@ -0,0 +1,158 @@ + + */ +class Export extends BaseAdminController +{ + const DEFAULT_PHONE = "0100000000"; + const DEFAULT_CELLPHONE = "0600000000"; + + public function exportAction() + { + if (null !== $response = $this->checkAuth(array(AdminResources::MODULE), array('Colissimo'), AccessManager::UPDATE)) { + return $response; + } + + $form = new FormExport($this->getRequest()); + + try { + $exportForm = $this->validateForm($form); + + $status_id = $exportForm->get('status_id')->getData(); + + $status = OrderStatusQuery::create() + ->filterByCode($status_id) + ->findOne(); + + $orders = ColissimoQuery::getOrders() + ->find(); + + $export = ""; + $store_name = ConfigQuery::read("store_name"); + /** @var $order \Thelia\Model\Order */ + foreach ($orders as $order) { + + $value = $exportForm->get('order_'.$order->getId())->getData(); + + if ($value) { + + $customer = $order->getCustomer(); + $locale = $order->getLang()->getLocale(); + $address = $order->getOrderAddressRelatedByDeliveryOrderAddressId(); + $country = CountryQuery::create()->findPk($address->getCountryId()); + $country->setLocale($locale); + $customerTitle = CustomerTitleQuery::create()->findPk($address->getCustomerTitleId()); + $customerTitle->setLocale($locale); + + /** + * Get user's phone & cellphone + * First get invoice address phone, + * If empty, try to get default address' phone. + * If still empty, set default value + */ + $phone = $address->getPhone(); + if (empty($phone)) { + $phone = $customer->getDefaultAddress()->getPhone(); + + if (empty($phone)) { + $phone = self::DEFAULT_PHONE; + } + } + + /** + * Cellp + */ + $cellphone = $customer->getDefaultAddress()->getCellphone(); + + if (empty($cellphone)) { + $cellphone = $customer->getDefaultAddress()->getCellphone(); + + if (empty($cellphone)) { + $cellphone = self::DEFAULT_CELLPHONE; + } + } + + /** + * Compute package weight + */ + $weight = 0; + /** @var \Thelia\Model\OrderProduct $product */ + foreach ($order->getOrderProducts() as $product) { + $weight+=(double) $product->getWeight(); + } + + $export .= "\"".$order->getRef()."\";\"".$address->getLastname()."\";\"".$address->getFirstname()."\";\"".$address->getAddress1()."\";\"".$address->getAddress2()."\";\"".$address->getAddress3()."\";\"".$address->getZipcode()."\";\"".$address->getCity()."\";\"".$country->getTitle()."\";\"".$phone."\";\"".$cellphone."\";\"".$weight."\";\"\";\"\";\"".$store_name."\";\"DOM\";\r\n"; + + if ($status) { + $event = new OrderEvent($order); + $event->setStatus($status->getId()); + $this->getDispatcher()->dispatch(TheliaEvents::ORDER_UPDATE_STATUS, $event); + } + + + } + + } + + return Response::create( + $export, + 200, + array( + "Content-Type"=>"application/csv-tab-delimited-table", + "Content-disposition"=>"filename=export.csv" + ) + ); + + } catch (FormValidationException $e) { + $this->setupFormErrorContext( + Translator::getInstance()->trans("colissimo expeditor export", [], Colissimo::MESSAGE_DOMAIN), + $e->getMessage(), + $form, + $e + ); + + return $this->render( + "module-configure", + array( + "module_code" => "Colissimo", + ) + ); + } + } + +} \ No newline at end of file diff --git a/local/modules/Colissimo/Controller/FreeShipping.php b/local/modules/Colissimo/Controller/FreeShipping.php index 040b9f75a..a8f5f334d 100644 --- a/local/modules/Colissimo/Controller/FreeShipping.php +++ b/local/modules/Colissimo/Controller/FreeShipping.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Colissimo\Controller; diff --git a/local/modules/Colissimo/Form/Export.php b/local/modules/Colissimo/Form/Export.php new file mode 100644 index 000000000..006c8c2c0 --- /dev/null +++ b/local/modules/Colissimo/Form/Export.php @@ -0,0 +1,101 @@ + + */ +class Export extends BaseForm +{ + + /** + * + * in this function you add all the fields you need for your Form. + * Form this you have to call add method on $this->formBuilder attribute : + * + * $this->formBuilder->add("name", "text") + * ->add("email", "email", array( + * "attr" => array( + * "class" => "field" + * ), + * "label" => "email", + * "constraints" => array( + * new \Symfony\Component\Validator\Constraints\NotBlank() + * ) + * ) + * ) + * ->add('age', 'integer'); + * + * @return null + */ + protected function buildForm() + { + $orders = ColissimoQuery::getOrders() + ->find(); + + $this->formBuilder + ->add('status_id', 'text',[ + 'constraints' => [ + new NotBlank(), + new Callback(array( + "methods" => array( + array($this, + "verifyValue") + ) + )) + ], + 'label' => Translator::getInstance()->trans('Modify status export after export', [], Colissimo::MESSAGE_DOMAIN), + 'label_attr' => [ + 'for' => 'status_id' + ] + ]); + + /** @var \Thelia\Model\Order $order */ + foreach ($orders as $order) { + $this->formBuilder->add("order_".$order->getId(), "checkbox", array( + 'label'=>$order->getRef(), + 'label_attr'=>array('for'=>'export_'.$order->getId()) + )); + } + } + + public function verifyValue($value, ExecutionContextInterface $context) + { + if (!preg_match("#^nochange|processing|sent$#",$value)) { + $context->addViolation(Translator::getInstance()->trans('select a valid status', [], Colissimo::MESSAGE_DOMAIN)); + } + } + + /** + * @return string the name of you form. This name must be unique + */ + public function getName() + { + return "colissimo_export"; + } +} \ No newline at end of file diff --git a/local/modules/Colissimo/Form/FreeShipping.php b/local/modules/Colissimo/Form/FreeShipping.php index 87465c6a6..38f567d26 100644 --- a/local/modules/Colissimo/Form/FreeShipping.php +++ b/local/modules/Colissimo/Form/FreeShipping.php @@ -1,29 +1,19 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Colissimo\Form; +use Colissimo\Colissimo; use Colissimo\Model\ColissimoFreeshippingQuery; use Thelia\Core\Translation\Translator; use Thelia\Form\BaseForm; @@ -55,7 +45,7 @@ class FreeShipping extends BaseForm { $this->formBuilder ->add("freeshipping", "checkbox", array( 'data'=>$freeshipping, - 'label'=>Translator::getInstance()->trans("Activate free shipping: ") + 'label'=>Translator::getInstance()->trans("Activate free shipping: ", [], Colissimo::MESSAGE_DOMAIN) )) ; } diff --git a/local/modules/Colissimo/I18n/AdminIncludes/fr_FR.php b/local/modules/Colissimo/I18n/AdminIncludes/fr_FR.php new file mode 100644 index 000000000..4bd2a4bdc --- /dev/null +++ b/local/modules/Colissimo/I18n/AdminIncludes/fr_FR.php @@ -0,0 +1,33 @@ + '* Si vous choisissez cette option, les commandes exportées ne seront plus affichée sur cette page.', + 'Actions' => 'Actions', + 'An error occured' => 'Une erreur est survenue', + 'Area : ' => 'Zone de livraison : ', + 'Cancel' => 'Annuler', + 'Change orders status after export' => 'Modification du statut des commande après l\'export', + 'Colissimo Module allows to send your products all around the world with La Poste.' => 'Colissimo vous permet d’expédier vos colis dans le monde entier avec La Poste', + 'Create' => 'Créer', + 'Create a new price slice' => 'Créer une nouvelle tranche de prix', + 'Create a price slice' => 'Créer une tranche de prix', + 'Date' => 'Date', + 'Delete' => 'Supprimer', + 'Delete a price slice' => 'Supprimer une tranche de prix', + 'Delete this price slice' => 'Supprimer cette tranche de prix', + 'Do not change' => 'Ne pas modifier', + 'Do you really want to delete this slice ?' => 'Confirmez-vous la suppression de cette tranche de prix', + 'Edit' => 'Modifier', + 'Edit a price slice' => 'Modifier une tranche de prix', + 'Edit this price slice' => 'Modifier cette tranche de prix', + 'Export' => 'Export', + 'Export expeditor inet file' => 'Exporter le fichier Expeditor INET', + 'Please change the access rights' => 'Merci de modifier les droits d\'accès', + 'Price (€)' => 'Price (€)', + 'Price slices' => 'Prix et poids', + 'Processing' => 'Traitement', + 'REF' => 'REF', + 'Sent' => 'Envoyé', + 'Total taxed amount' => 'Total TTC', + 'Weight up to ... (kg)' => 'Jusqu\'au poids (Kg)', +); diff --git a/local/modules/Colissimo/I18n/en_US.php b/local/modules/Colissimo/I18n/en_US.php index 59dc5c33b..f49a9f1df 100644 --- a/local/modules/Colissimo/I18n/en_US.php +++ b/local/modules/Colissimo/I18n/en_US.php @@ -1,22 +1,12 @@ 'Can\'t read Config directory', - 'Can\'t write Config directory'=>'Can\'t write Config directory', - 'Can\'t read file'=>'Can\'t read file', - 'Can\'t write file'=>'Can\'t write file', - 'Please change the access rights'=>'Please change the access rights', - 'Colissimo Module allows to send your products all around the world with La Poste.'=>'Colissimo Module allows to send your products all around the world with La Poste.', - 'Create a price slice'=>'Create a price slice', - 'Weight up to ... (kg)'=>'Weight up to ... (kg)', - 'Price ('=>'Price (', - 'Create'=>'Create', - 'Cancel'=>'Cancel', - 'Area '=>'Area ', - 'Actions'=>'Actions', - 'Edit a price slice'=>'Edit a price slice', - 'Edit'=>'Edit', - 'Delete a price slice'=>'Delete a price slice', - 'Do you really want to delete this slice '=>'Do you really want to delete this slice ', - 'Delete'=>'Delete', - 'Activate free shipping: '=>'Activate free shipping: ', - ); \ No newline at end of file + +return array( + 'Activate free shipping: ' => 'Activate free shipping: ', + 'Can\'t read Config directory' => 'Can\'t read Config directory', + 'Can\'t read file' => 'Can\'t read file', + 'Can\'t write Config directory' => 'Can\'t write Config directory', + 'Can\'t write file' => 'Can\'t write file', + 'Modify status export after export' => 'Change orders status after export', + 'colissimo expeditor export' => 'Colissimo Expeditor export', + 'select a valid status' => 'Select a valid order status', +); diff --git a/local/modules/Colissimo/I18n/fr_FR.php b/local/modules/Colissimo/I18n/fr_FR.php index e85e6a8e4..89d222656 100644 --- a/local/modules/Colissimo/I18n/fr_FR.php +++ b/local/modules/Colissimo/I18n/fr_FR.php @@ -1,22 +1,14 @@ 'Le dossier Config ne peut être lu', - 'Can\'t write Config directory'=>'Le dossier Config ne peut être écrit', - 'Can\'t read file'=>'Le fichier suivant ne peut être lu', - 'Can\'t write file'=>'Le fichier suivant ne peut être écrit', - 'Please change the access rights'=>'Veuillez changer les droits d\'accès', - 'Colissimo Module allows to send your products all around the world with La Poste.'=>'Le module Colissimo vous permet d\'envoyer des colis dans le monde entier avec La Poste.', - 'Create a price slice' => 'Créer une tranche de prix', - 'Weight up to ... (kg)'=>'Poids ... (kg)', - 'Price (€)'=>'Prix (€)', - 'Create'=>'Créer', - 'Cancel'=>'Annuler', - 'Area : '=>'Zone de livraison : ', - 'Actions'=>'Actions', - 'Edit'=>'Modifer', - 'Edit a price slice' => 'Modifier une tranche de prix', - 'Delete a price slice' => 'Supprimer une tranche de prix', - 'Do you really want to delete this slice ?'=>'Voulez-vous réellement supprimer cette tranche de prix ?', - 'Delete'=>'Supprimer', - 'Activate free shipping: '=>'Livraison offerte: ', - ); \ No newline at end of file + +return array( + 'Activate free shipping: ' => 'Activer la livraison offerte: ', + 'Can\'t read Config directory' => 'Le dossier Config ne peut être lu', + 'Can\'t read file' => 'Le fichier suivant ne peut être lu', + 'Can\'t write Config directory' => 'Le dossier Config ne peut être écrit', + 'Can\'t write file' => 'Le fichier suivant ne peut être écrit', + 'Colissimo delivery unavailable for the delivery country' => 'La livraison par Colissimo n\'est pas disponible dans ce pays', + 'Colissimo delivery unavailable for this cart weight (%weight kg)' => 'La livraison par Colissimo n\'est pas disponible pour un panier de %weight Kg', + 'Modify status export after export' => 'Modification du statut des commandes après l\'export', + 'colissimo expeditor export' => 'Export pour le logiciel Expeditor', + 'select a valid status' => 'Choisissez un statut de commande valide.', +); diff --git a/local/modules/Colissimo/Listener/SendMail.php b/local/modules/Colissimo/Listener/SendMail.php index 1c781ec29..58fb0d4c4 100755 --- a/local/modules/Colissimo/Listener/SendMail.php +++ b/local/modules/Colissimo/Listener/SendMail.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Colissimo\Listener; diff --git a/local/modules/Colissimo/Loop/CheckRightsLoop.php b/local/modules/Colissimo/Loop/CheckRightsLoop.php index 05afc70ca..da4163b36 100755 --- a/local/modules/Colissimo/Loop/CheckRightsLoop.php +++ b/local/modules/Colissimo/Loop/CheckRightsLoop.php @@ -1,28 +1,17 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ - namespace Colissimo\Loop; +use Colissimo\Colissimo; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResultRow; @@ -48,19 +37,19 @@ class CheckRightsLoop extends BaseLoop implements ArraySearchLoopInterface $ret = array(); $dir = __DIR__."/../Config/"; if (!is_readable($dir)) { - $ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't read Config directory"), "ERRFILE"=>""); + $ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't read Config directory", [], Colissimo::MESSAGE_DOMAIN), "ERRFILE"=>""); } if (!is_writable($dir)) { - $ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't write Config directory"), "ERRFILE"=>""); + $ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't write Config directory", [], Colissimo::MESSAGE_DOMAIN), "ERRFILE"=>""); } if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if (strlen($file) > 5 && substr($file, -5) === ".json") { if (!is_readable($dir.$file)) { - $ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't read file"), "ERRFILE"=>"Colissimo/Config/".$file); + $ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't read file", [], Colissimo::MESSAGE_DOMAIN), "ERRFILE"=>"Colissimo/Config/".$file); } if (!is_writable($dir.$file)) { - $ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't write file"), "ERRFILE"=>"Colissimo/Config/".$file); + $ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't write file", [], Colissimo::MESSAGE_DOMAIN), "ERRFILE"=>"Colissimo/Config/".$file); } } } diff --git a/local/modules/Colissimo/Loop/NotSendLoop.php b/local/modules/Colissimo/Loop/NotSendLoop.php new file mode 100644 index 000000000..ad4f320fb --- /dev/null +++ b/local/modules/Colissimo/Loop/NotSendLoop.php @@ -0,0 +1,80 @@ + + */ +class NotSendLoop extends Order +{ + /** + * + * define all args used in your loop + * + * + * example : + * + * public function getArgDefinitions() + * { + * return new ArgumentCollection( + * Argument::createIntListTypeArgument('id'), + * new Argument( + * 'ref', + * new TypeCollection( + * new Type\AlphaNumStringListType() + * ) + * ), + * Argument::createIntListTypeArgument('category'), + * Argument::createBooleanTypeArgument('new'), + * Argument::createBooleanTypeArgument('promo'), + * Argument::createFloatTypeArgument('min_price'), + * Argument::createFloatTypeArgument('max_price'), + * Argument::createIntTypeArgument('min_stock'), + * Argument::createFloatTypeArgument('min_weight'), + * Argument::createFloatTypeArgument('max_weight'), + * Argument::createBooleanTypeArgument('current'), + * + * ); + * } + * + * @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection + */ + public function getArgDefinitions() + { + return new ArgumentCollection(); + } + + /** + * this method returns a Propel ModelCriteria + * + * @return \Propel\Runtime\ActiveQuery\ModelCriteria + */ + public function buildModelCriteria() + { + + + return ColissimoQuery::getOrders(); + } +} \ No newline at end of file diff --git a/local/modules/Colissimo/Loop/Price.php b/local/modules/Colissimo/Loop/Price.php index 1f68df8a5..450527a2c 100755 --- a/local/modules/Colissimo/Loop/Price.php +++ b/local/modules/Colissimo/Loop/Price.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Colissimo\Loop; diff --git a/local/modules/Colissimo/Model/ColissimoQuery.php b/local/modules/Colissimo/Model/ColissimoQuery.php new file mode 100644 index 000000000..191a1213f --- /dev/null +++ b/local/modules/Colissimo/Model/ColissimoQuery.php @@ -0,0 +1,70 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Colissimo\Model; + +use Colissimo\Colissimo; +use Propel\Runtime\ActiveQuery\Criteria; +use Thelia\Model\OrderQuery; +use Thelia\Model\OrderStatus; +use Thelia\Model\OrderStatusQuery; + + +/** + * Class ColissimoQuery + * @package Colissimo\Model + * @author Manuel Raynaud + */ +class ColissimoQuery +{ + /** + * @return OrderQuery + */ + public static function getOrders() + { + $status = OrderStatusQuery::create() + ->filterByCode( + array( + OrderStatus::CODE_PAID, + OrderStatus::CODE_PROCESSING, + ), + Criteria::IN + ) + ->find() + ->toArray("code") + ; + + + + $query = OrderQuery::create() + ->filterByDeliveryModuleId((new Colissimo())->getModuleModel()->getId()) + ->filterByStatusId( + array( + $status[OrderStatus::CODE_PAID]['Id'], + $status[OrderStatus::CODE_PROCESSING]['Id']), + Criteria::IN + ); + + return $query; + } +} \ No newline at end of file diff --git a/local/modules/Colissimo/THELIA_INET.FMT b/local/modules/Colissimo/THELIA_INET.FMT new file mode 100644 index 000000000..972666485 --- /dev/null +++ b/local/modules/Colissimo/THELIA_INET.FMT @@ -0,0 +1,23 @@ +[GENERAL] +DELIMITE=O +SEPARATEUR=59 +DELIMITEUR=34 +FINDELIGNE=CRLF +Unité poids=KG +[CHAMPS] +ReferenceExpedition=1 +NomDestinataire=2 +Prenom=3 +Adresse1=4 +Adresse2=5 +Adresse3=6 +CodePostal=7 +Commune=8 +CodePays=9 +Telephone=10 +Portable=11 +Poids=12 +Mail=13 +CodePointRetrait=14 +CodeProduit=15 +NomCommercialChargeur=16 diff --git a/local/modules/Front/Config/front.xml b/local/modules/Front/Config/front.xml index 74b42af5a..0a987eaa2 100644 --- a/local/modules/Front/Config/front.xml +++ b/local/modules/Front/Config/front.xml @@ -55,7 +55,7 @@ - Front\Controller\DefaultController::noAction + Thelia\Controller\Front\DefaultController::noAction account-password @@ -63,6 +63,11 @@ Front\Controller\OrderController::generateDeliveryPdf \d+ + + + Front\Controller\OrderController::generateInvoicePdf + \d+ + @@ -118,6 +123,11 @@ Front\Controller\CartController::changeItem cart + + + Front\Controller\CartController::changeCountry + cart + @@ -158,6 +168,11 @@ Front\Controller\OrderController::orderPlaced order-placed + + + Front\Controller\OrderController::orderFailed + order-failed + @@ -179,6 +194,21 @@ + + + Front\Controller\SitemapController::generateAction + + + + + + Front\Controller\FeedController::generateAction + catalog + + + + + Thelia\Controller\Front\DefaultController::noAction diff --git a/local/modules/Front/Controller/AddressController.php b/local/modules/Front/Controller/AddressController.php index f8cbde0a4..4b2de4568 100644 --- a/local/modules/Front/Controller/AddressController.php +++ b/local/modules/Front/Controller/AddressController.php @@ -1,227 +1,227 @@ -. */ -/* */ -/*************************************************************************************/ - -namespace Front\Controller; -use Thelia\Controller\Front\BaseFrontController; -use Thelia\Core\Event\Address\AddressCreateOrUpdateEvent; -use Thelia\Core\Event\Address\AddressEvent; -use Thelia\Core\Event\TheliaEvents; -use Thelia\Core\Translation\Translator; -use Thelia\Form\AddressCreateForm; -use Thelia\Form\AddressUpdateForm; -use Thelia\Form\Exception\FormValidationException; -use Thelia\Model\AddressQuery; -use Thelia\Model\Customer; - -/** - * Class AddressController - * @package Thelia\Controller\Front - * @author Manuel Raynaud - */ -class AddressController extends BaseFrontController -{ - - /** - * Controller for generate modal containing update form - * Check if request is a XmlHttpRequest and address owner is the current customer - * @param $address_id - */ - public function generateModalAction($address_id) - { - - $this->checkAuth(); - $this->checkXmlHttpRequest(); - - } - - /** - * Create controller. - * Check if customer is logged in - * - * Dispatch TheliaEvents::ADDRESS_CREATE event - */ - public function createAction() - { - - $this->checkAuth(); - - $addressCreate = new AddressCreateForm($this->getRequest()); - - try { - $customer = $this->getSecurityContext()->getCustomerUser(); - - $form = $this->validateForm($addressCreate, "post"); - $event = $this->createAddressEvent($form); - $event->setCustomer($customer); - - $this->dispatch(TheliaEvents::ADDRESS_CREATE, $event); - $this->redirectSuccess($addressCreate); - - } catch (FormValidationException $e) { - $message = sprintf(Translator::getInstance()->trans("Please check your input: %s"), $e->getMessage()); - } catch (\Exception $e) { - $message = sprintf(Translator::getInstance()->trans("Sorry, an error occured: %s"), $e->getMessage()); - } - - if ($message !== false) { - \Thelia\Log\Tlog::getInstance()->error(sprintf("Error during address creation process : %s", $message)); - - $addressCreate->setErrorMessage($message); - - $this->getParserContext() - ->addForm($addressCreate) - ->setGeneralError($message) - ; - } - } - - public function updateViewAction($address_id) - { - $this->checkAuth(); - - $customer = $this->getSecurityContext()->getCustomerUser(); - $address = AddressQuery::create()->findPk($address_id); - - if (!$address || $customer->getId() != $address->getCustomerId()) { - $this->redirectToRoute('default'); - } - - $this->getParserContext()->set("address_id", $address_id); - } - - public function processUpdateAction($address_id) - { - $this->checkAuth(); - $request = $this->getRequest(); - - $addressUpdate = new AddressUpdateForm($request); - - try { - $customer = $this->getSecurityContext()->getCustomerUser(); - - $form = $this->validateForm($addressUpdate); - - $address = AddressQuery::create()->findPk($address_id); - - if (null === $address) { - $this->redirectToRoute('default'); - } - - if ($address->getCustomer()->getId() != $customer->getId()) { - $this->redirectToRoute('default'); - } - - $event = $this->createAddressEvent($form); - $event->setAddress($address); - - $this->dispatch(TheliaEvents::ADDRESS_UPDATE, $event); - - $this->redirectSuccess($addressUpdate); - } catch (FormValidationException $e) { - $message = sprintf(Translator::getInstance()->trans("Please check your input: %s"), $e->getMessage()); - } catch (\Exception $e) { - $message = sprintf(Translator::getInstance()->trans("Sorry, an error occured: %s"), $e->getMessage()); - } - $this->getParserContext()->set("address_id", $address_id); - if ($message !== false) { - \Thelia\Log\Tlog::getInstance()->error(sprintf("Error during address creation process : %s", $message)); - - $addressUpdate->setErrorMessage($message); - - $this->getParserContext() - ->addForm($addressUpdate) - ->setGeneralError($message) - ; - } - } - - public function deleteAction($address_id) - { - $this->checkAuth(); - $error_message = false; - - $customer = $this->getSecurityContext()->getCustomerUser(); - $address = AddressQuery::create()->findPk($address_id); - - if (!$address || $customer->getId() != $address->getCustomerId()) { - // If Ajax Request - if ($this->getRequest()->isXmlHttpRequest()) { - return $this->jsonResponse(json_encode(array( - "success" => false, - "message" => "Error during address deletion process" - ))); - } else { - $this->redirectToRoute('default'); - } - } - - try { - $this->dispatch(TheliaEvents::ADDRESS_DELETE, new AddressEvent($address)); - } catch (\Exception $e) { - $error_message = $e->getMessage(); - } - - \Thelia\Log\Tlog::getInstance()->error(sprintf('Error during address deletion : %s', $error_message)); - - - // If Ajax Request - if ($this->getRequest()->isXmlHttpRequest()) { - if ($error_message) { - $response = $this->jsonResponse(json_encode(array( - "success" => false, - "message" => $error_message - ))); - } else { - $response = $this->jsonResponse(json_encode(array( - "success" => true, - "message" => "" - )));; - } - - return $response; - - } else { - $this->redirectToRoute('default', array('view'=>'account')); - } - } - - protected function createAddressEvent($form) - { - return new AddressCreateOrUpdateEvent( - $form->get("label")->getData(), - $form->get("title")->getData(), - $form->get("firstname")->getData(), - $form->get("lastname")->getData(), - $form->get("address1")->getData(), - $form->get("address2")->getData(), - $form->get("address3")->getData(), - $form->get("zipcode")->getData(), - $form->get("city")->getData(), - $form->get("country")->getData(), - $form->get("cellphone")->getData(), - $form->get("phone")->getData(), - $form->get("company")->getData(), - $form->get("is_default")->getData() - ); - } -} +. */ +/* */ +/*************************************************************************************/ + +namespace Front\Controller; +use Front\Front; +use Thelia\Controller\Front\BaseFrontController; +use Thelia\Core\Event\Address\AddressCreateOrUpdateEvent; +use Thelia\Core\Event\Address\AddressEvent; +use Thelia\Core\Event\TheliaEvents; +use Thelia\Core\Translation\Translator; +use Thelia\Form\AddressCreateForm; +use Thelia\Form\AddressUpdateForm; +use Thelia\Form\Exception\FormValidationException; +use Thelia\Model\AddressQuery; +use Thelia\Model\Customer; + +/** + * Class AddressController + * @package Thelia\Controller\Front + * @author Manuel Raynaud + */ +class AddressController extends BaseFrontController +{ + + /** + * Controller for generate modal containing update form + * Check if request is a XmlHttpRequest and address owner is the current customer + * @param $address_id + */ + public function generateModalAction($address_id) + { + + $this->checkAuth(); + $this->checkXmlHttpRequest(); + + } + + /** + * Create controller. + * Check if customer is logged in + * + * Dispatch TheliaEvents::ADDRESS_CREATE event + */ + public function createAction() + { + + $this->checkAuth(); + + $addressCreate = new AddressCreateForm($this->getRequest()); + + try { + $customer = $this->getSecurityContext()->getCustomerUser(); + + $form = $this->validateForm($addressCreate, "post"); + $event = $this->createAddressEvent($form); + $event->setCustomer($customer); + + $this->dispatch(TheliaEvents::ADDRESS_CREATE, $event); + $this->redirectSuccess($addressCreate); + + } catch (FormValidationException $e) { + $message = Translator::getInstance()->trans("Please check your input: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } catch (\Exception $e) { + $message = Translator::getInstance()->trans("Sorry, an error occured: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } + + if ($message !== false) { + \Thelia\Log\Tlog::getInstance()->error(sprintf("Error during address creation process : %s", $message)); + + $addressCreate->setErrorMessage($message); + + $this->getParserContext() + ->addForm($addressCreate) + ->setGeneralError($message) + ; + } + } + + public function updateViewAction($address_id) + { + $this->checkAuth(); + + $customer = $this->getSecurityContext()->getCustomerUser(); + $address = AddressQuery::create()->findPk($address_id); + + if (!$address || $customer->getId() != $address->getCustomerId()) { + $this->redirectToRoute('default'); + } + + $this->getParserContext()->set("address_id", $address_id); + } + + public function processUpdateAction($address_id) + { + $this->checkAuth(); + $request = $this->getRequest(); + + $addressUpdate = new AddressUpdateForm($request); + + try { + $customer = $this->getSecurityContext()->getCustomerUser(); + + $form = $this->validateForm($addressUpdate); + + $address = AddressQuery::create()->findPk($address_id); + + if (null === $address) { + $this->redirectToRoute('default'); + } + + if ($address->getCustomer()->getId() != $customer->getId()) { + $this->redirectToRoute('default'); + } + + $event = $this->createAddressEvent($form); + $event->setAddress($address); + + $this->dispatch(TheliaEvents::ADDRESS_UPDATE, $event); + + $this->redirectSuccess($addressUpdate); + } catch (FormValidationException $e) { + $message = Translator::getInstance()->trans("Please check your input: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } catch (\Exception $e) { + $message = Translator::getInstance()->trans("Sorry, an error occured: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } + $this->getParserContext()->set("address_id", $address_id); + if ($message !== false) { + \Thelia\Log\Tlog::getInstance()->error(sprintf("Error during address creation process : %s", $message)); + + $addressUpdate->setErrorMessage($message); + + $this->getParserContext() + ->addForm($addressUpdate) + ->setGeneralError($message) + ; + } + } + + public function deleteAction($address_id) + { + $this->checkAuth(); + $error_message = false; + + $customer = $this->getSecurityContext()->getCustomerUser(); + $address = AddressQuery::create()->findPk($address_id); + + if (!$address || $customer->getId() != $address->getCustomerId()) { + // If Ajax Request + if ($this->getRequest()->isXmlHttpRequest()) { + return $this->jsonResponse(json_encode(array( + "success" => false, + "message" => "Error during address deletion process" + ))); + } else { + $this->redirectToRoute('default'); + } + } + + try { + $this->dispatch(TheliaEvents::ADDRESS_DELETE, new AddressEvent($address)); + } catch (\Exception $e) { + $error_message = $e->getMessage(); + } + + \Thelia\Log\Tlog::getInstance()->error(sprintf('Error during address deletion : %s', $error_message)); + + // If Ajax Request + if ($this->getRequest()->isXmlHttpRequest()) { + if ($error_message) { + $response = $this->jsonResponse(json_encode(array( + "success" => false, + "message" => $error_message + ))); + } else { + $response = $this->jsonResponse(json_encode(array( + "success" => true, + "message" => "" + )));; + } + + return $response; + + } else { + $this->redirectToRoute('default', array('view'=>'account')); + } + } + + protected function createAddressEvent($form) + { + return new AddressCreateOrUpdateEvent( + $form->get("label")->getData(), + $form->get("title")->getData(), + $form->get("firstname")->getData(), + $form->get("lastname")->getData(), + $form->get("address1")->getData(), + $form->get("address2")->getData(), + $form->get("address3")->getData(), + $form->get("zipcode")->getData(), + $form->get("city")->getData(), + $form->get("country")->getData(), + $form->get("cellphone")->getData(), + $form->get("phone")->getData(), + $form->get("company")->getData(), + $form->get("is_default")->getData() + ); + } +} diff --git a/local/modules/Front/Controller/CartController.php b/local/modules/Front/Controller/CartController.php index 5985dedb5..587866950 100644 --- a/local/modules/Front/Controller/CartController.php +++ b/local/modules/Front/Controller/CartController.php @@ -23,14 +23,19 @@ namespace Front\Controller; use Propel\Runtime\Exception\PropelException; -use Thelia\Controller\Front\BaseFrontController; -use Thelia\Core\Event\Order\OrderEvent; -use Thelia\Form\Exception\FormValidationException; -use Thelia\Core\Event\Cart\CartEvent; -use Thelia\Core\Event\TheliaEvents; +use Symfony\Component\HttpFoundation\Cookie; use Symfony\Component\HttpFoundation\Request; +use Thelia\Controller\Front\BaseFrontController; +use Thelia\Core\Event\Cart\CartEvent; +use Thelia\Core\Event\Order\OrderEvent; +use Thelia\Core\Event\TheliaEvents; use Thelia\Form\CartAdd; +use Thelia\Form\Exception\FormValidationException; +use Thelia\Log\Tlog; use Thelia\Model\AddressQuery; +use Thelia\Model\ConfigQuery; +use Thelia\Module\Exception\DeliveryException; +use Thelia\Tools\URL; class CartController extends BaseFrontController { @@ -60,7 +65,7 @@ class CartController extends BaseFrontController $this->redirectSuccess(); } catch (PropelException $e) { - \Thelia\Log\Tlog::getInstance()->error(sprintf("Failed to add item to cart with message : %s", $e->getMessage())); + Tlog::getInstance()->error(sprintf("Failed to add item to cart with message : %s", $e->getMessage())); $message = "Failed to add this article to your cart, please try again"; } catch (FormValidationException $e) { $message = $e->getMessage(); @@ -108,12 +113,25 @@ class CartController extends BaseFrontController $this->redirectSuccess(); } catch (PropelException $e) { - \Thelia\Log\Tlog::getInstance()->error(sprintf("error during deleting cartItem with message : %s", $e->getMessage())); + Tlog::getInstance()->error(sprintf("error during deleting cartItem with message : %s", $e->getMessage())); $this->getParserContext()->setGeneralError($e->getMessage()); } } + public function changeCountry() + { + $redirectUrl = URL::getInstance()->absoluteUrl("/cart"); + $deliveryId = $this->getRequest()->get("country"); + $cookieName = ConfigQuery::read('front_cart_country_cookie_name', 'fcccn'); + $cookieExpires = ConfigQuery::read('front_cart_country_cookie_expires', 2592000); + $cookieExpires = intval($cookieExpires) ?: 2592000; + + $cookie = new Cookie($cookieName, $deliveryId, time() + $cookieExpires, '/'); + + $this->redirect($redirectUrl, 302, array($cookie)); + } + /** * use Thelia\Cart\CartTrait for searching current cart or create a new one * @@ -154,21 +172,30 @@ class CartController extends BaseFrontController { /* recalculate postage amount */ $order = $this->getSession()->getOrder(); - if(null !== $order) { + if (null !== $order) { $deliveryModule = $order->getModuleRelatedByDeliveryModuleId(); $deliveryAddress = AddressQuery::create()->findPk($order->chosenDeliveryAddress); - if(null !== $deliveryModule && null !== $deliveryAddress) { + if (null !== $deliveryModule && null !== $deliveryAddress) { $moduleInstance = $this->container->get(sprintf('module.%s', $deliveryModule->getCode())); - $postage = $moduleInstance->getPostage($deliveryAddress->getCountry()); $orderEvent = new OrderEvent($order); - $orderEvent->setPostage($postage); - $this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_POSTAGE, $orderEvent); + try { + $postage = $moduleInstance->getPostage($deliveryAddress->getCountry()); + + $orderEvent->setPostage($postage); + + $this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_POSTAGE, $orderEvent); + } + catch (DeliveryException $ex) { + // The postage has been chosen, but changes in the cart causes an exception. + // Reset the postage data in the order + $orderEvent->setDeliveryModule(0); + + $this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_DELIVERY_MODULE, $orderEvent); + } } } } - - } diff --git a/local/modules/Front/Controller/CouponController.php b/local/modules/Front/Controller/CouponController.php index 73eef34b7..3c3c025ab 100644 --- a/local/modules/Front/Controller/CouponController.php +++ b/local/modules/Front/Controller/CouponController.php @@ -26,11 +26,12 @@ use Propel\Runtime\Exception\PropelException; use Thelia\Controller\Front\BaseFrontController; use Thelia\Core\Event\Coupon\CouponConsumeEvent; use Thelia\Core\Event\Order\OrderEvent; +use Thelia\Core\Event\TheliaEvents; use Thelia\Form\CouponCode; use Thelia\Form\Exception\FormValidationException; -use Thelia\Core\Event\TheliaEvents; use Thelia\Log\Tlog; use Thelia\Model\AddressQuery; +use Thelia\Module\Exception\DeliveryException; /** * Class CouponController @@ -68,18 +69,29 @@ class CouponController extends BaseFrontController /* recalculate postage amount */ $order = $this->getSession()->getOrder(); - if(null !== $order) { + if (null !== $order) { $deliveryModule = $order->getModuleRelatedByDeliveryModuleId(); $deliveryAddress = AddressQuery::create()->findPk($order->chosenDeliveryAddress); - if(null !== $deliveryModule && null !== $deliveryAddress) { + if (null !== $deliveryModule && null !== $deliveryAddress) { $moduleInstance = $this->container->get(sprintf('module.%s', $deliveryModule->getCode())); - $postage = $moduleInstance->getPostage($deliveryAddress->getCountry()); $orderEvent = new OrderEvent($order); - $orderEvent->setPostage($postage); - $this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_POSTAGE, $orderEvent); + try { + $postage = $moduleInstance->getPostage($deliveryAddress->getCountry()); + + $orderEvent->setPostage($postage); + + $this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_POSTAGE, $orderEvent); + } + catch (DeliveryException $ex) { + // The postage has been chosen, but changes dues to coupon causes an exception. + // Reset the postage data in the order + $orderEvent->setDeliveryModule(0); + + $this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_DELIVERY_MODULE, $orderEvent); + } } } diff --git a/local/modules/Front/Controller/CustomerController.php b/local/modules/Front/Controller/CustomerController.php index ec8c83c82..1dee4aa45 100644 --- a/local/modules/Front/Controller/CustomerController.php +++ b/local/modules/Front/Controller/CustomerController.php @@ -1,391 +1,395 @@ -. */ -/* */ -/*************************************************************************************/ -namespace Front\Controller; - -use Thelia\Controller\Front\BaseFrontController; -use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent; -use Thelia\Core\Event\Customer\CustomerLoginEvent; -use Thelia\Core\Event\LostPasswordEvent; -use Thelia\Core\Event\Newsletter\NewsletterEvent; -use Thelia\Core\Security\Authentication\CustomerUsernamePasswordFormAuthenticator; -use Thelia\Core\Security\Exception\AuthenticationException; -use Thelia\Core\Security\Exception\UsernameNotFoundException; -use Thelia\Core\Translation\Translator; -use Thelia\Form\CustomerCreateForm; -use Thelia\Form\CustomerLogin; -use Thelia\Form\CustomerLostPasswordForm; -use Thelia\Form\CustomerPasswordUpdateForm; -use Thelia\Form\CustomerProfileUpdateForm; -use Thelia\Form\Exception\FormValidationException; -use Thelia\Model\Customer; -use Thelia\Core\Event\TheliaEvents; -use Thelia\Model\NewsletterQuery; -use Thelia\Tools\URL; -use Thelia\Log\Tlog; -use Thelia\Core\Security\Exception\WrongPasswordException; - -/** - * Class CustomerController - * @package Thelia\Controller\Front - * @author Manuel Raynaud - */ -class CustomerController extends BaseFrontController -{ - use \Thelia\Cart\CartTrait; - - public function newPasswordAction() - { - if (! $this->getSecurityContext()->hasCustomerUser()) { - $message = false; - - $passwordLost = new CustomerLostPasswordForm($this->getRequest()); - - try { - - $form = $this->validateForm($passwordLost); - - $event = new LostPasswordEvent($form->get("email")->getData()); - - $this->dispatch(TheliaEvents::LOST_PASSWORD, $event); - - } catch (FormValidationException $e) { - $message = sprintf(Translator::getInstance()->trans("Please check your input: %s"), $e->getMessage()); - } catch (\Exception $e) { - $message = sprintf(Translator::getInstance()->trans("Sorry, an error occured: %s"), $e->getMessage()); - } - - if ($message !== false) { - Tlog::getInstance()->error(sprintf("Error during customer creation process : %s. Exception was %s", $message, $e->getMessage())); - - $passwordLost->setErrorMessage($message); - - $this->getParserContext() - ->addForm($passwordLost) - ->setGeneralError($message) - ; - } - } - } - - /** - * Create a new customer. - * On success, redirect to success_url if exists, otherwise, display the same view again. - */ - public function createAction() - { - if (! $this->getSecurityContext()->hasCustomerUser()) { - - $message = false; - - $customerCreation = new CustomerCreateForm($this->getRequest()); - - try { - $form = $this->validateForm($customerCreation, "post"); - - $customerCreateEvent = $this->createEventInstance($form->getData()); - - $this->dispatch(TheliaEvents::CUSTOMER_CREATEACCOUNT, $customerCreateEvent); - - $newCustomer = $customerCreateEvent->getCustomer(); - - // Newsletter - if (true === $form->get('newsletter')->getData()) { - $newsletterEmail = $newCustomer->getEmail(); - $nlEvent = new NewsletterEvent($newsletterEmail, $this->getRequest()->getSession()->getLang()->getLocale()); - $nlEvent->setFirstname($newCustomer->getFirstname()); - $nlEvent->setLastname($newCustomer->getLastname()); - - // Security : Check if this new Email address already exist - if (null !== $newsletter = NewsletterQuery::create()->findOneByEmail($newsletterEmail)) { - $nlEvent->setId($newsletter->getId()); - $this->dispatch(TheliaEvents::NEWSLETTER_UPDATE, $nlEvent); - } else { - $this->dispatch(TheliaEvents::NEWSLETTER_SUBSCRIBE, $nlEvent); - } - } - - $this->processLogin($customerCreateEvent->getCustomer()); - - $cart = $this->getCart($this->getDispatcher(), $this->getRequest()); - if ($cart->getCartItems()->count() > 0) { - $this->redirectToRoute('cart.view'); - } else { - $this->redirectSuccess($customerCreation); - } - } catch (FormValidationException $e) { - $message = sprintf(Translator::getInstance()->trans("Please check your input: %s"), $e->getMessage()); - } catch (\Exception $e) { - $message = sprintf(Translator::getInstance()->trans("Sorry, an error occured: %s"), $e->getMessage()); - } - - if ($message !== false) { - Tlog::getInstance()->error(sprintf("Error during customer creation process : %s. Exception was %s", $message, $e->getMessage())); - - $customerCreation->setErrorMessage($message); - - $this->getParserContext() - ->addForm($customerCreation) - ->setGeneralError($message) - ; - } - } - } - - /** - * Update customer data. On success, redirect to success_url if exists. - * Otherwise, display the same view again. - */ - public function viewAction() - { - $this->checkAuth(); - - $customer = $this->getSecurityContext()->getCustomerUser(); - $data = array( - 'id' => $customer->getId(), - 'title' => $customer->getTitleId(), - 'firstname' => $customer->getFirstName(), - 'lastname' => $customer->getLastName(), - 'email' => $customer->getEmail(), - 'newsletter' => null !== NewsletterQuery::create()->findOneByEmail($customer->getEmail()), - ); - - $customerProfileUpdateForm = new CustomerProfileUpdateForm($this->getRequest(), 'form', $data); - - // Pass it to the parser - $this->getParserContext()->addForm($customerProfileUpdateForm); - } - - public function updatePasswordAction() - { - if ($this->getSecurityContext()->hasCustomerUser()) { - $message = false; - - $customerPasswordUpdateForm = new CustomerPasswordUpdateForm($this->getRequest()); - - try { - $customer = $this->getSecurityContext()->getCustomerUser(); - - $form = $this->validateForm($customerPasswordUpdateForm, "post"); - - $customerChangeEvent = $this->createEventInstance($form->getData()); - $customerChangeEvent->setCustomer($customer); - $this->dispatch(TheliaEvents::CUSTOMER_UPDATEPROFILE, $customerChangeEvent); - - $this->redirectSuccess($customerPasswordUpdateForm); - - } catch (FormValidationException $e) { - $message = sprintf(Translator::getInstance()->trans("Please check your input: %s"), $e->getMessage()); - } catch (\Exception $e) { - $message = sprintf(Translator::getInstance()->trans("Sorry, an error occured: %s"), $e->getMessage()); - } - - if ($message !== false) { - Tlog::getInstance()->error(sprintf("Error during customer password modification process : %s.", $message)); - - $customerPasswordUpdateForm->setErrorMessage($message); - - $this->getParserContext() - ->addForm($customerPasswordUpdateForm) - ->setGeneralError($message) - ; - } - } - } - - public function updateAction() - { - if ($this->getSecurityContext()->hasCustomerUser()) { - - $message = false; - - $customerProfileUpdateForm = new CustomerProfileUpdateForm($this->getRequest()); - - try { - $customer = $this->getSecurityContext()->getCustomerUser(); - $newsletterOldEmail = $customer->getEmail(); - - $form = $this->validateForm($customerProfileUpdateForm, "post"); - - $customerChangeEvent = $this->createEventInstance($form->getData()); - $customerChangeEvent->setCustomer($customer); - $this->dispatch(TheliaEvents::CUSTOMER_UPDATEPROFILE, $customerChangeEvent); - - $updatedCustomer = $customerChangeEvent->getCustomer(); - - // Newsletter - if (true === $form->get('newsletter')->getData()) { - $nlEvent = new NewsletterEvent($updatedCustomer->getEmail(), $this->getRequest()->getSession()->getLang()->getLocale()); - $nlEvent->setFirstname($updatedCustomer->getFirstname()); - $nlEvent->setLastname($updatedCustomer->getLastname()); - - if (null !== $newsletter = NewsletterQuery::create()->findOneByEmail($newsletterOldEmail)) { - $nlEvent->setId($newsletter->getId()); - $this->dispatch(TheliaEvents::NEWSLETTER_UPDATE, $nlEvent); - } else { - $this->dispatch(TheliaEvents::NEWSLETTER_SUBSCRIBE, $nlEvent); - } - } else { - if (null !== $newsletter = NewsletterQuery::create()->findOneByEmail($newsletterOldEmail)) { - $nlEvent = new NewsletterEvent($updatedCustomer->getEmail(), $this->getRequest()->getSession()->getLang()->getLocale()); - $nlEvent->setId($newsletter->getId()); - $this->dispatch(TheliaEvents::NEWSLETTER_UNSUBSCRIBE, $nlEvent); - } - } - - $this->processLogin($updatedCustomer); - - $this->redirectSuccess($customerProfileUpdateForm); - - } catch (FormValidationException $e) { - $message = sprintf(Translator::getInstance()->trans("Please check your input: %s"), $e->getMessage()); - } catch (\Exception $e) { - $message = sprintf(Translator::getInstance()->trans("Sorry, an error occured: %s"), $e->getMessage()); - } - - if ($message !== false) { - Tlog::getInstance()->error(sprintf("Error during customer modification process : %s.", $message)); - - $customerProfileUpdateForm->setErrorMessage($message); - - $this->getParserContext() - ->addForm($customerProfileUpdateForm) - ->setGeneralError($message) - ; - } - } - } - - /** - * Perform user login. On a successful login, the user is redirected to the URL - * found in the success_url form parameter, or / if none was found. - * - * If login is not successfull, the same view is displayed again. - * - */ - public function loginAction() - { - if (! $this->getSecurityContext()->hasCustomerUser()) { - $message = false; - - $request = $this->getRequest(); - $customerLoginForm = new CustomerLogin($request); - - try { - - $form = $this->validateForm($customerLoginForm, "post"); - - // If User is a new customer - if ($form->get('account')->getData() == 0 && !$form->get("email")->getErrors()) { - $this->redirectToRoute("customer.create.process", array("email" => $form->get("email")->getData())); - } else { - - try { - - $authenticator = new CustomerUsernamePasswordFormAuthenticator($request, $customerLoginForm); - - $customer = $authenticator->getAuthentifiedUser(); - - $this->processLogin($customer); - - $this->redirectSuccess($customerLoginForm); - - } catch (UsernameNotFoundException $e) { - $message = "Wrong email or password. Please try again"; - } catch (WrongPasswordException $e) { - $message = "Wrong email or password. Please try again"; - } catch (AuthenticationException $e) { - $message = "Wrong email or password. Please try again"; - } - - } - - } catch (FormValidationException $e) { - $message = sprintf(Translator::getInstance()->trans("Please check your input: %s"), $e->getMessage()); - } catch (\Exception $e) { - $message = sprintf(Translator::getInstance()->trans("Sorry, an error occured: %s"), $e->getMessage()); - } - - if ($message !== false) { - Tlog::getInstance()->error(sprintf("Error during customer login process : %s. Exception was %s", $message, $e->getMessage())); - - $customerLoginForm->setErrorMessage($message); - - $this->getParserContext()->addForm($customerLoginForm); - } - } - } - - /** - * Perform customer logout. - */ - public function logoutAction() - { - if ($this->getSecurityContext()->hasCustomerUser()) { - $this->dispatch(TheliaEvents::CUSTOMER_LOGOUT); - } - - // Redirect to home page - $this->redirect(URL::getInstance()->getIndexPage()); - } - - /** - * Dispatch event for customer login action - * - * @param Customer $customer - */ - protected function processLogin(Customer $customer) - { - $this->dispatch(TheliaEvents::CUSTOMER_LOGIN, new CustomerLoginEvent($customer)); - } - - /** - * @param $data - * @return \Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent - */ - private function createEventInstance($data) - { - $customerCreateEvent = new CustomerCreateOrUpdateEvent( - isset($data["title"])?$data["title"]:null, - isset($data["firstname"])?$data["firstname"]:null, - isset($data["lastname"])?$data["lastname"]:null, - isset($data["address1"])?$data["address1"]:null, - isset($data["address2"])?$data["address2"]:null, - isset($data["address3"])?$data["address3"]:null, - isset($data["phone"])?$data["phone"]:null, - isset($data["cellphone"])?$data["cellphone"]:null, - isset($data["zipcode"])?$data["zipcode"]:null, - isset($data["city"])?$data["city"]:null, - isset($data["country"])?$data["country"]:null, - isset($data["email"])?$data["email"]:null, - isset($data["password"]) ? $data["password"]:null, - $this->getRequest()->getSession()->getLang()->getId(), - isset($data["reseller"])?$data["reseller"]:null, - isset($data["sponsor"])?$data["sponsor"]:null, - isset($data["discount"])?$data["discount"]:null, - isset($data["company"])?$data["company"]:null, - null - ); - - return $customerCreateEvent; - } -} +. */ +/* */ +/*************************************************************************************/ +namespace Front\Controller; + +use Front\Front; +use Symfony\Component\HttpFoundation\RedirectResponse; +use Thelia\Controller\Front\BaseFrontController; +use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent; +use Thelia\Core\Event\Customer\CustomerLoginEvent; +use Thelia\Core\Event\LostPasswordEvent; +use Thelia\Core\Event\Newsletter\NewsletterEvent; +use Thelia\Core\Security\Authentication\CustomerUsernamePasswordFormAuthenticator; +use Thelia\Core\Security\Exception\AuthenticationException; +use Thelia\Core\Security\Exception\UsernameNotFoundException; +use Thelia\Core\Translation\Translator; +use Thelia\Form\CustomerCreateForm; +use Thelia\Form\CustomerLogin; +use Thelia\Form\CustomerLostPasswordForm; +use Thelia\Form\CustomerPasswordUpdateForm; +use Thelia\Form\CustomerProfileUpdateForm; +use Thelia\Form\Exception\FormValidationException; +use Thelia\Model\Customer; +use Thelia\Core\Event\TheliaEvents; +use Thelia\Model\NewsletterQuery; +use Thelia\Tools\URL; +use Thelia\Log\Tlog; +use Thelia\Core\Security\Exception\WrongPasswordException; + +/** + * Class CustomerController + * @package Thelia\Controller\Front + * @author Manuel Raynaud + */ +class CustomerController extends BaseFrontController +{ + use \Thelia\Cart\CartTrait; + + public function newPasswordAction() + { + if (! $this->getSecurityContext()->hasCustomerUser()) { + $message = false; + + $passwordLost = new CustomerLostPasswordForm($this->getRequest()); + + try { + + $form = $this->validateForm($passwordLost); + + $event = new LostPasswordEvent($form->get("email")->getData()); + + $this->dispatch(TheliaEvents::LOST_PASSWORD, $event); + + } catch (FormValidationException $e) { + $message = Translator::getInstance()->trans("Please check your input: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } catch (\Exception $e) { + $message = Translator::getInstance()->trans("Sorry, an error occured: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } + + if ($message !== false) { + Tlog::getInstance()->error(sprintf("Error during customer creation process : %s. Exception was %s", $message, $e->getMessage())); + + $passwordLost->setErrorMessage($message); + + $this->getParserContext() + ->addForm($passwordLost) + ->setGeneralError($message) + ; + } + } + } + + /** + * Create a new customer. + * On success, redirect to success_url if exists, otherwise, display the same view again. + */ + public function createAction() + { + if (! $this->getSecurityContext()->hasCustomerUser()) { + + $message = false; + + $customerCreation = new CustomerCreateForm($this->getRequest()); + + try { + $form = $this->validateForm($customerCreation, "post"); + + $customerCreateEvent = $this->createEventInstance($form->getData()); + + $this->dispatch(TheliaEvents::CUSTOMER_CREATEACCOUNT, $customerCreateEvent); + + $newCustomer = $customerCreateEvent->getCustomer(); + + // Newsletter + if (true === $form->get('newsletter')->getData()) { + $newsletterEmail = $newCustomer->getEmail(); + $nlEvent = new NewsletterEvent($newsletterEmail, $this->getRequest()->getSession()->getLang()->getLocale()); + $nlEvent->setFirstname($newCustomer->getFirstname()); + $nlEvent->setLastname($newCustomer->getLastname()); + + // Security : Check if this new Email address already exist + if (null !== $newsletter = NewsletterQuery::create()->findOneByEmail($newsletterEmail)) { + $nlEvent->setId($newsletter->getId()); + $this->dispatch(TheliaEvents::NEWSLETTER_UPDATE, $nlEvent); + } else { + $this->dispatch(TheliaEvents::NEWSLETTER_SUBSCRIBE, $nlEvent); + } + } + + $this->processLogin($customerCreateEvent->getCustomer()); + + $cart = $this->getCart($this->getDispatcher(), $this->getRequest()); + if ($cart->getCartItems()->count() > 0) { + $this->redirectToRoute('cart.view'); + } else { + $this->redirectSuccess($customerCreation); + } + } catch (FormValidationException $e) { + $message = Translator::getInstance()->trans("Please check your input: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } catch (\Exception $e) { + $message = Translator::getInstance()->trans("Sorry, an error occured: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } + + if ($message !== false) { + Tlog::getInstance()->error(sprintf("Error during customer creation process : %s. Exception was %s", $message, $e->getMessage())); + + $customerCreation->setErrorMessage($message); + + $this->getParserContext() + ->addForm($customerCreation) + ->setGeneralError($message) + ; + } + } + } + + /** + * Update customer data. On success, redirect to success_url if exists. + * Otherwise, display the same view again. + */ + public function viewAction() + { + $this->checkAuth(); + + $customer = $this->getSecurityContext()->getCustomerUser(); + $data = array( + 'id' => $customer->getId(), + 'title' => $customer->getTitleId(), + 'firstname' => $customer->getFirstName(), + 'lastname' => $customer->getLastName(), + 'email' => $customer->getEmail(), + 'newsletter' => null !== NewsletterQuery::create()->findOneByEmail($customer->getEmail()), + ); + + $customerProfileUpdateForm = new CustomerProfileUpdateForm($this->getRequest(), 'form', $data); + + // Pass it to the parser + $this->getParserContext()->addForm($customerProfileUpdateForm); + } + + public function updatePasswordAction() + { + if ($this->getSecurityContext()->hasCustomerUser()) { + $message = false; + + $customerPasswordUpdateForm = new CustomerPasswordUpdateForm($this->getRequest()); + + try { + $customer = $this->getSecurityContext()->getCustomerUser(); + + $form = $this->validateForm($customerPasswordUpdateForm, "post"); + + $customerChangeEvent = $this->createEventInstance($form->getData()); + $customerChangeEvent->setCustomer($customer); + $this->dispatch(TheliaEvents::CUSTOMER_UPDATEPROFILE, $customerChangeEvent); + + $this->redirectSuccess($customerPasswordUpdateForm); + + } catch (FormValidationException $e) { + $message = Translator::getInstance()->trans("Please check your input: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } catch (\Exception $e) { + $message = Translator::getInstance()->trans("Sorry, an error occured: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } + + if ($message !== false) { + Tlog::getInstance()->error(sprintf("Error during customer password modification process : %s.", $message)); + + $customerPasswordUpdateForm->setErrorMessage($message); + + $this->getParserContext() + ->addForm($customerPasswordUpdateForm) + ->setGeneralError($message) + ; + } + } + } + + public function updateAction() + { + if ($this->getSecurityContext()->hasCustomerUser()) { + + $message = false; + + $customerProfileUpdateForm = new CustomerProfileUpdateForm($this->getRequest()); + + try { + $customer = $this->getSecurityContext()->getCustomerUser(); + $newsletterOldEmail = $customer->getEmail(); + + $form = $this->validateForm($customerProfileUpdateForm, "post"); + + $customerChangeEvent = $this->createEventInstance($form->getData()); + $customerChangeEvent->setCustomer($customer); + $this->dispatch(TheliaEvents::CUSTOMER_UPDATEPROFILE, $customerChangeEvent); + + $updatedCustomer = $customerChangeEvent->getCustomer(); + + // Newsletter + if (true === $form->get('newsletter')->getData()) { + $nlEvent = new NewsletterEvent($updatedCustomer->getEmail(), $this->getRequest()->getSession()->getLang()->getLocale()); + $nlEvent->setFirstname($updatedCustomer->getFirstname()); + $nlEvent->setLastname($updatedCustomer->getLastname()); + + if (null !== $newsletter = NewsletterQuery::create()->findOneByEmail($newsletterOldEmail)) { + $nlEvent->setId($newsletter->getId()); + $this->dispatch(TheliaEvents::NEWSLETTER_UPDATE, $nlEvent); + } else { + $this->dispatch(TheliaEvents::NEWSLETTER_SUBSCRIBE, $nlEvent); + } + } else { + if (null !== $newsletter = NewsletterQuery::create()->findOneByEmail($newsletterOldEmail)) { + $nlEvent = new NewsletterEvent($updatedCustomer->getEmail(), $this->getRequest()->getSession()->getLang()->getLocale()); + $nlEvent->setId($newsletter->getId()); + $this->dispatch(TheliaEvents::NEWSLETTER_UNSUBSCRIBE, $nlEvent); + } + } + + $this->processLogin($updatedCustomer); + + $this->redirectSuccess($customerProfileUpdateForm); + + } catch (FormValidationException $e) { + $message = Translator::getInstance()->trans("Please check your input: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } catch (\Exception $e) { + $message = Translator::getInstance()->trans("Sorry, an error occured: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } + + if ($message !== false) { + Tlog::getInstance()->error(sprintf("Error during customer modification process : %s.", $message)); + + $customerProfileUpdateForm->setErrorMessage($message); + + $this->getParserContext() + ->addForm($customerProfileUpdateForm) + ->setGeneralError($message) + ; + } + } + } + + /** + * Perform user login. On a successful login, the user is redirected to the URL + * found in the success_url form parameter, or / if none was found. + * + * If login is not successfull, the same view is displayed again. + * + */ + public function loginAction() + { + if (! $this->getSecurityContext()->hasCustomerUser()) { + $message = false; + + $request = $this->getRequest(); + $customerLoginForm = new CustomerLogin($request); + + try { + + $form = $this->validateForm($customerLoginForm, "post"); + + // If User is a new customer + if ($form->get('account')->getData() == 0 && !$form->get("email")->getErrors()) { + $this->redirectToRoute("customer.create.process", array("email" => $form->get("email")->getData())); + } else { + + try { + + $authenticator = new CustomerUsernamePasswordFormAuthenticator($request, $customerLoginForm); + + $customer = $authenticator->getAuthentifiedUser(); + + $this->processLogin($customer); + + $successUrl = $customerLoginForm->getSuccessUrl(); + + return RedirectResponse::create($successUrl); + + } catch (UsernameNotFoundException $e) { + $message = "Wrong email or password. Please try again"; + } catch (WrongPasswordException $e) { + $message = "Wrong email or password. Please try again"; + } catch (AuthenticationException $e) { + $message = "Wrong email or password. Please try again"; + } + + } + + } catch (FormValidationException $e) { + $message = Translator::getInstance()->trans("Please check your input: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } catch (\Exception $e) { + $message = Translator::getInstance()->trans("Sorry, an error occured: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); + } + + if ($message !== false) { + Tlog::getInstance()->error(sprintf("Error during customer login process : %s. Exception was %s", $message, $e->getMessage())); + + $customerLoginForm->setErrorMessage($message); + + $this->getParserContext()->addForm($customerLoginForm); + } + } + } + + /** + * Perform customer logout. + */ + public function logoutAction() + { + if ($this->getSecurityContext()->hasCustomerUser()) { + $this->dispatch(TheliaEvents::CUSTOMER_LOGOUT); + } + + // Redirect to home page + return RedirectResponse::create(URL::getInstance()->getIndexPage()); + } + + /** + * Dispatch event for customer login action + * + * @param Customer $customer + */ + protected function processLogin(Customer $customer) + { + $this->dispatch(TheliaEvents::CUSTOMER_LOGIN, new CustomerLoginEvent($customer)); + } + + /** + * @param $data + * @return \Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent + */ + private function createEventInstance($data) + { + $customerCreateEvent = new CustomerCreateOrUpdateEvent( + isset($data["title"])?$data["title"]:null, + isset($data["firstname"])?$data["firstname"]:null, + isset($data["lastname"])?$data["lastname"]:null, + isset($data["address1"])?$data["address1"]:null, + isset($data["address2"])?$data["address2"]:null, + isset($data["address3"])?$data["address3"]:null, + isset($data["phone"])?$data["phone"]:null, + isset($data["cellphone"])?$data["cellphone"]:null, + isset($data["zipcode"])?$data["zipcode"]:null, + isset($data["city"])?$data["city"]:null, + isset($data["country"])?$data["country"]:null, + isset($data["email"])?$data["email"]:null, + isset($data["password"]) ? $data["password"]:null, + $this->getRequest()->getSession()->getLang()->getId(), + isset($data["reseller"])?$data["reseller"]:null, + isset($data["sponsor"])?$data["sponsor"]:null, + isset($data["discount"])?$data["discount"]:null, + isset($data["company"])?$data["company"]:null, + null + ); + + return $customerCreateEvent; + } +} diff --git a/local/modules/Front/Controller/FeedController.php b/local/modules/Front/Controller/FeedController.php new file mode 100644 index 000000000..7fc95ed77 --- /dev/null +++ b/local/modules/Front/Controller/FeedController.php @@ -0,0 +1,200 @@ + + */ +class FeedController extends BaseFrontController { + + + /** + * Folder name for feeds cache + */ + const FEED_CACHE_DIR = "feeds"; + + /** + * Key prefix for feed cache + */ + const FEED_CACHE_KEY = "feed"; + + + /** + * render the RSS feed + * + * @param $context string The context of the feed : catalog, content. default: catalog + * @param $lang string The lang of the feed : fr_FR, en_US, ... default: default language of the site + * @param $id string The id of the parent element. The id of the main parent category for catalog context. + * The id of the content folder for content context + * @return Response + */ + public function generateAction($context, $lang, $id) + { + + /** @var Request $request */ + $request = $this->getRequest(); + + // context + if ("" === $context){ + $context = "catalog"; + } else if (! in_array($context, array("catalog", "content")) ){ + $this->pageNotFound(); + } + + // the locale : fr_FR, en_US, + if ("" !== $lang) { + if (! $this->checkLang($lang)){ + $this->pageNotFound(); + } + } else { + try{ + $lang = Lang::getDefaultLanguage(); + $lang = $lang->getLocale(); + } catch (\RuntimeException $ex){ + // @todo generate error page + throw new \RuntimeException("No default language is defined. Please define one."); + } + } + if (null === $lang = LangQuery::create()->findOneByLocale($lang)){ + $this->pageNotFound(); + } + $lang = $lang->getId(); + + // check if element exists and is visible + if ("" !== $id){ + if (false === $this->checkId($context, $id)){ + $this->pageNotFound(); + } + } + + $flush = $request->query->get("flush", ""); + + // check if feed already in cache + $cacheContent = false; + + $cacheDir = $this->getCacheDir(); + $cacheKey = self::FEED_CACHE_KEY . $lang . $context . $id; + $cacheExpire = intval(ConfigQuery::read("feed_ttl", '7200')) ?: 7200; + + $cacheDriver = new FilesystemCache($cacheDir); + if (!($this->checkAdmin() && "" !== $flush)){ + $cacheContent = $cacheDriver->fetch($cacheKey); + } else { + $cacheDriver->delete($cacheKey); + } + + // if not in cache + if (false === $cacheContent){ + // render the view + $cacheContent = $this->renderRaw( + "feed", + array( + "_context_" => $context, + "_lang_" => $lang, + "_id_" => $id + ) + ); + // save cache + $cacheDriver->save($cacheKey, $cacheContent, $cacheExpire); + } + + $response = new Response(); + $response->setContent($cacheContent); + $response->headers->set('Content-Type', 'application/rss+xml'); + + return $response; + } + + + /** + * get the cache directory for feeds + * + * @return mixed|string + */ + protected function getCacheDir() + { + $cacheDir = $this->container->getParameter("kernel.cache_dir"); + $cacheDir = rtrim($cacheDir, '/'); + $cacheDir .= '/' . self::FEED_CACHE_DIR . '/'; + + return $cacheDir; + } + + /** + * Check if current user has ADMIN role + * + * @return bool + */ + protected function checkAdmin(){ + return $this->getSecurityContext()->hasAdminUser(); + } + + + /** + * Check if a lang is used + * + * @param $lang string The lang code. e.g.: fr + * @return bool true if the language is used, otherwise false + */ + private function checkLang($lang) + { + // load locals + $lang = LangQuery::create() + ->findOneByLocale($lang); + + return (null !== $lang); + } + + + /** + * Check if the element exists and is visible + * + * @param $context string catalog or content + * @param $id string id of the element + * @return bool + */ + private function checkId($context, $id) + { + $ret = false; + if (is_numeric($id)){ + if ("catalog" === $context){ + $cat = CategoryQuery::create()->findPk($id); + $ret = (null !== $cat && $cat->getVisible()); + } else { + $folder = FolderQuery::create()->findPk($id); + $ret = (null !== $folder && $folder->getVisible()); + } + } + return $ret; + } + +} \ No newline at end of file diff --git a/local/modules/Front/Controller/OrderController.php b/local/modules/Front/Controller/OrderController.php index 4791663f0..2c6f3072e 100644 --- a/local/modules/Front/Controller/OrderController.php +++ b/local/modules/Front/Controller/OrderController.php @@ -22,12 +22,11 @@ /*************************************************************************************/ namespace Front\Controller; +use Front\Front; use Propel\Runtime\Exception\PropelException; +use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Thelia\Cart\CartTrait; use Thelia\Controller\Front\BaseFrontController; -use Thelia\Core\Event\PdfEvent; -use Thelia\Core\HttpFoundation\Response; -use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Translation\Translator; use Thelia\Exception\TheliaProcessException; use Thelia\Form\Exception\FormValidationException; @@ -39,7 +38,7 @@ use Thelia\Form\OrderPayment; use Thelia\Log\Tlog; use Thelia\Model\AddressQuery; use Thelia\Model\AreaDeliveryModuleQuery; -use Thelia\Model\Base\OrderQuery; +use Thelia\Model\OrderQuery; use Thelia\Model\ConfigQuery; use Thelia\Model\ModuleQuery; use Thelia\Model\Order; @@ -104,11 +103,11 @@ class OrderController extends BaseFrontController $this->redirectToRoute("order.invoice"); } catch (FormValidationException $e) { - $message = sprintf(Translator::getInstance()->trans("Please check your input: %s"), $e->getMessage()); + $message = Translator::getInstance()->trans("Please check your input: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); } catch (PropelException $e) { $this->getParserContext()->setGeneralError($e->getMessage()); } catch (\Exception $e) { - $message = sprintf(Translator::getInstance()->trans("Sorry, an error occured: %s"), $e->getMessage()); + $message = Translator::getInstance()->trans("Sorry, an error occured: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); } if ($message !== false) { @@ -160,11 +159,11 @@ class OrderController extends BaseFrontController $this->redirectToRoute("order.payment.process"); } catch (FormValidationException $e) { - $message = sprintf(Translator::getInstance()->trans("Please check your input: %s"), $e->getMessage()); + $message = Translator::getInstance()->trans("Please check your input: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); } catch (PropelException $e) { $this->getParserContext()->setGeneralError($e->getMessage()); } catch (\Exception $e) { - $message = sprintf(Translator::getInstance()->trans("Sorry, an error occured: %s"), $e->getMessage()); + $message = Translator::getInstance()->trans("Sorry, an error occured: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN); } if ($message !== false) { @@ -202,7 +201,7 @@ class OrderController extends BaseFrontController if (null !== $placedOrder && null !== $placedOrder->getId()) { /* order has been placed */ - if($orderEvent->hasResponse()) { + if ($orderEvent->hasResponse()) { return $orderEvent->getResponse(); } else { $this->redirect(URL::getInstance()->absoluteUrl($this->getRoute('order.placed', array('order_id' => $orderEvent->getPlacedOrder()->getId())))); @@ -237,6 +236,29 @@ class OrderController extends BaseFrontController $this->getParserContext()->set("placed_order_id", $placedOrder->getId()); } + public function orderFailed($order_id, $message) + { + /* check if the placed order matched the customer */ + $failedOrder = OrderQuery::create()->findPk( + $this->getRequest()->attributes->get('order_id') + ); + + if (null === $failedOrder) { + throw new TheliaProcessException("No failed order", TheliaProcessException::NO_PLACED_ORDER, $failedOrder); + } + + $customer = $this->getSecurityContext()->getCustomerUser(); + + if (null === $customer || $failedOrder->getCustomerId() !== $customer->getId()) { + throw new TheliaProcessException("Received failed order id does not belong to the current customer", TheliaProcessException::PLACED_ORDER_ID_BAD_CURRENT_CUSTOMER, $placedOrder); + } + + $this->getParserContext() + ->set("failed_order_id", $failedOrder->getId()) + ->set("failed_order_message", $message) + ; + } + protected function getOrderEvent() { $order = $this->getOrder($this->getRequest()); @@ -261,18 +283,41 @@ class OrderController extends BaseFrontController public function generateInvoicePdf($order_id) { - /* check customer */ - $this->checkAuth(); + $this->checkOrderCustomer($order_id); + + return $this->generateOrderPdf($order_id, ConfigQuery::read('pdf_invoice_file', 'invoice')); } public function generateDeliveryPdf($order_id) { - /* check customer */ - $this->checkAuth(); + $this->checkOrderCustomer($order_id); + return $this->generateOrderPdf($order_id, ConfigQuery::read('pdf_delivery_file', 'delivery')); } + private function checkOrderCustomer($order_id) + { + $this->checkAuth(); + + $order = OrderQuery::create()->findPk($order_id); + $valid = true; + if ($order) { + $customerOrder = $order->getCustomer(); + $customer = $this->getSecurityContext()->getCustomerUser(); + + if ($customerOrder->getId() != $customer->getId()) { + $valid = false; + } + } else { + $valid = false; + } + + if (false === $valid) { + throw new AccessDeniedHttpException(); + } + } + public function getDeliveryModuleListAjaxAction() { $country = $this->getRequest()->get( @@ -286,5 +331,4 @@ class OrderController extends BaseFrontController return $this->render('ajax/order-delivery-module-list', $args); } - } diff --git a/local/modules/Front/Controller/SitemapController.php b/local/modules/Front/Controller/SitemapController.php new file mode 100644 index 000000000..df339c5bb --- /dev/null +++ b/local/modules/Front/Controller/SitemapController.php @@ -0,0 +1,152 @@ + + */ +class SitemapController extends BaseFrontController { + + + /** + * Folder name for sitemap cache + */ + const SITEMAP_CACHE_DIR = "sitemap"; + + /** + * Key prefix for sitemap cache + */ + const SITEMAP_CACHE_KEY = "sitemap"; + + /** + * @return Response + */ + public function generateAction() + { + + /** @var Request $request */ + $request = $this->getRequest(); + + // the locale : fr, en, + $lang = $request->query->get("lang", ""); + if ("" !== $lang) { + if (! $this->checkLang($lang)){ + $this->pageNotFound(); + } + } + // specific content : product, category, cms + $context = $request->query->get("context", ""); + if (! in_array($context, array("", "catalog", "content")) ){ + $this->pageNotFound(); + } + + $flush = $request->query->get("flush", ""); + + // check if sitemap already in cache + $cacheContent = false; + + $cacheDir = $this->getCacheDir(); + $cacheKey = self::SITEMAP_CACHE_KEY . $lang . $context; + $cacheExpire = intval(ConfigQuery::read("sitemap_ttl", '7200')) ?: 7200; + + $cacheDriver = new FilesystemCache($cacheDir); + if (!($this->checkAdmin() && "" !== $flush)){ + $cacheContent = $cacheDriver->fetch($cacheKey); + } else { + $cacheDriver->delete($cacheKey); + } + + // if not in cache + if (false === $cacheContent){ + // render the view + $cacheContent = $this->renderRaw( + "sitemap", + array( + "_lang_" => $lang, + "_context_" => $context + ) + ); + // save cache + $cacheDriver->save($cacheKey, $cacheContent, $cacheExpire); + } + + $response = new Response(); + $response->setContent($cacheContent); + $response->headers->set('Content-Type', 'application/xml'); + + return $response; + } + + + /** + * get the cache directory for sitemap + * + * @return mixed|string + */ + protected function getCacheDir() + { + $cacheDir = $this->container->getParameter("kernel.cache_dir"); + $cacheDir = rtrim($cacheDir, '/'); + $cacheDir .= '/' . self::SITEMAP_CACHE_DIR . '/'; + + return $cacheDir; + } + + /** + * Check if current user has ADMIN role + * + * @return bool + */ + protected function checkAdmin(){ + return $this->getSecurityContext()->hasAdminUser(); + } + + + /** + * Check if a lang is used + * + * @param $lang The lang code. e.g.: fr + * @return bool true if the language is used, otherwise false + */ + private function checkLang($lang) + { + // load locals + $lang = LangQuery::create() + ->findOneByCode($lang); + + return (null !== $lang); + } + +} \ No newline at end of file diff --git a/local/modules/Front/Front.php b/local/modules/Front/Front.php index 67498ba24..c085f27fe 100644 --- a/local/modules/Front/Front.php +++ b/local/modules/Front/Front.php @@ -27,9 +27,5 @@ use Thelia\Module\BaseModule; class Front extends BaseModule { - /** - * YOU HAVE TO IMPLEMENT HERE ABSTRACT METHODD FROM BaseModule Class - * Like install and destroy - */ - + const MESSAGE_DOMAIN = 'front'; } diff --git a/local/modules/Klikandpay b/local/modules/Klikandpay new file mode 160000 index 000000000..a72c066e7 --- /dev/null +++ b/local/modules/Klikandpay @@ -0,0 +1 @@ +Subproject commit a72c066e7400d2350dca24016a302582cb7e7b62 diff --git a/local/modules/TheliaDebugBar/Config/routing.xml b/local/modules/TheliaDebugBar/Config/routing.xml index 14361a729..cfc20f812 100644 --- a/local/modules/TheliaDebugBar/Config/routing.xml +++ b/local/modules/TheliaDebugBar/Config/routing.xml @@ -2,8 +2,4 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - - - TheliaDebugBar\Controller\Admin\TheliaDebugBarController::indexAction - \ No newline at end of file diff --git a/local/modules/TheliaDebugBar/Controller/Admin/TheliaDebguBarController.php b/local/modules/TheliaDebugBar/Controller/Admin/TheliaDebguBarController.php deleted file mode 100644 index e09ae6243..000000000 --- a/local/modules/TheliaDebugBar/Controller/Admin/TheliaDebguBarController.php +++ /dev/null @@ -1,18 +0,0 @@ -checkAuth(self::RESOURCE_CODE, array(), AccessManager::VIEW)) return $response; - - // Render the edition template. - return $this->render('tdb-index'); - } -} \ No newline at end of file diff --git a/local/modules/TheliaDebugBar/Controller/Admin/TheliaDebugBarController.php b/local/modules/TheliaDebugBar/Controller/Admin/TheliaDebugBarController.php deleted file mode 100644 index e09ae6243..000000000 --- a/local/modules/TheliaDebugBar/Controller/Admin/TheliaDebugBarController.php +++ /dev/null @@ -1,18 +0,0 @@ -checkAuth(self::RESOURCE_CODE, array(), AccessManager::VIEW)) return $response; - - // Render the edition template. - return $this->render('tdb-index'); - } -} \ No newline at end of file diff --git a/local/modules/TheliaDebugBar/DataCollector/PropelCollector.php b/local/modules/TheliaDebugBar/DataCollector/PropelCollector.php index 00d99f9d2..aab96bf40 100644 --- a/local/modules/TheliaDebugBar/DataCollector/PropelCollector.php +++ b/local/modules/TheliaDebugBar/DataCollector/PropelCollector.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace TheliaDebugBar\DataCollector; diff --git a/local/modules/TheliaDebugBar/Listeners/DebugBarListeners.php b/local/modules/TheliaDebugBar/Listeners/DebugBarListeners.php index 190844e40..2bb4a7af3 100644 --- a/local/modules/TheliaDebugBar/Listeners/DebugBarListeners.php +++ b/local/modules/TheliaDebugBar/Listeners/DebugBarListeners.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace TheliaDebugBar\Listeners; diff --git a/local/modules/TheliaDebugBar/Smarty/Plugin/DebugBar.php b/local/modules/TheliaDebugBar/Smarty/Plugin/DebugBar.php index e03b7797c..81e999b06 100644 --- a/local/modules/TheliaDebugBar/Smarty/Plugin/DebugBar.php +++ b/local/modules/TheliaDebugBar/Smarty/Plugin/DebugBar.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace TheliaDebugBar\Smarty\Plugin; diff --git a/local/modules/TheliaDebugBar/TheliaDebugBar.php b/local/modules/TheliaDebugBar/TheliaDebugBar.php index 466f50d5a..999c8cd40 100644 --- a/local/modules/TheliaDebugBar/TheliaDebugBar.php +++ b/local/modules/TheliaDebugBar/TheliaDebugBar.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace TheliaDebugBar; diff --git a/local/modules/Tinymce/Config/module.xml b/local/modules/Tinymce/Config/module.xml index 175017bd9..c27913441 100644 --- a/local/modules/Tinymce/Config/module.xml +++ b/local/modules/Tinymce/Config/module.xml @@ -2,10 +2,10 @@ Tinymce\Tinymce - Tinymce wysiwyg editor + TinyMCE WYSIWYG editor - éditeur wysiwyg Tinymce + Editeur visuel TinyMCE 0.1 diff --git a/local/modules/Tinymce/Listener/VerifyTinymceListener.php b/local/modules/Tinymce/Listener/VerifyTinymceListener.php index 4f984567f..2b8e5efce 100644 --- a/local/modules/Tinymce/Listener/VerifyTinymceListener.php +++ b/local/modules/Tinymce/Listener/VerifyTinymceListener.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Tinymce\Listener; @@ -54,7 +43,6 @@ class VerifyTinymceListener implements EventSubscriberInterface public function clearCache(CacheEvent $event) { if (true === file_exists(THELIA_WEB_DIR . '/tinymce')) { - echo "toto"; $fs = new Filesystem(); $directory = new \DirectoryIterator(THELIA_WEB_DIR . '/tinymce'); diff --git a/local/modules/Tinymce/Tinymce.php b/local/modules/Tinymce/Tinymce.php index 6a75b3ee4..08fac3139 100644 --- a/local/modules/Tinymce/Tinymce.php +++ b/local/modules/Tinymce/Tinymce.php @@ -1,24 +1,13 @@ . */ -/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ /*************************************************************************************/ namespace Tinymce; diff --git a/reset_install.bat b/reset_install.bat index 4deec3f46..1e2912f53 100644 --- a/reset_install.bat +++ b/reset_install.bat @@ -22,16 +22,16 @@ if exist local\config\database.yml ( ..\..\bin\propel build -v --output-dir=../../core/lib/ --enable-identifier-quoting echo [INFO] Building SQL CREATE file - ..\..\bin\propel sql:build -v --output-dir=..\..\install + ..\..\bin\propel sql:build -v --output-dir=..\..\setup echo [INFO] Reloading Thelia2 database cd ..\.. - del install\sqldb.map + del setup\sqldb.map php Thelia thelia:dev:reloadDB echo [INFO] Installing fixtures - php install\faker.php + php setup\faker.php echo [INFO] Clearing caches php Thelia cache:clear diff --git a/reset_install.sh b/reset_install.sh index 684b12abb..40216a643 100755 --- a/reset_install.sh +++ b/reset_install.sh @@ -21,15 +21,15 @@ echo -e "\n\033[01;34m[INFO] Building Models file\033[00m\n" ../../bin/propel build -v --output-dir=../../core/lib/ --enable-identifier-quoting echo -e "\n\033[01;34m[INFO] Building SQL CREATE file\033[00m\n" -../../bin/propel sql:build -v --output-dir=../../install/ +../../bin/propel sql:build -v --output-dir=../../setup/ echo -e "\n\033[01;34m[INFO] Reloading Thelia2 database\033[00m\n" cd ../.. -rm install/sqldb.map +rm setup/sqldb.map php Thelia thelia:dev:reloadDB echo -e "\n\033[01;34m[INFO] Installing fixtures\033[00m\n" -php install/faker.php +php setup/faker.php echo -e "\n\033[01;34m[INFO] Adding admin\033[00m\n" php Thelia admin:create --login_name thelia2 --password thelia2 --last_name thelia2 --first_name thelia2 diff --git a/run_casperjs.sh b/run_casperjs.sh index 88636a9d1..5bdca95f4 100755 --- a/run_casperjs.sh +++ b/run_casperjs.sh @@ -9,7 +9,7 @@ echo -e "\n\e[01;34m[INFO] Building Models file\e[00m\n" ../../bin/propel build -v --output-dir=../../core/lib/ echo -e "\n\e[01;34m[INFO] Building SQL CREATE file\e[00m\n" -../../bin/propel sql:build -v --output-dir=../../install/ +../../bin/propel sql:build -v --output-dir=../../setup/ echo -e "\n\e[01;34m[INFO] Reloaded Thelia2 database\e[00m\n" cd ../.. @@ -17,7 +17,7 @@ rm install/sqldb.map php Thelia thelia:dev:reloadDB echo -e "\n\e[01;34m[INFO] Installing fixtures\e[00m\n" -php install/faker.php +php setup/faker.php echo -e "\n\e[01;34m[INFO] Adding admin\e[00m\n" php Thelia thelia:create-admin --login_name thelia2 --password thelia2 --last_name thelia2 --first_name thelia2 diff --git a/install/.gitkeep b/setup/.gitkeep similarity index 100% rename from install/.gitkeep rename to setup/.gitkeep diff --git a/setup/.htaccess b/setup/.htaccess new file mode 100644 index 000000000..f239fe831 --- /dev/null +++ b/setup/.htaccess @@ -0,0 +1,2 @@ +order deny,allow +deny from all \ No newline at end of file diff --git a/install/INSTALL-TODO.txt b/setup/INSTALL-TODO.txt similarity index 100% rename from install/INSTALL-TODO.txt rename to setup/INSTALL-TODO.txt diff --git a/install/faker-assets/FreeSans.ttf b/setup/faker-assets/FreeSans.ttf similarity index 100% rename from install/faker-assets/FreeSans.ttf rename to setup/faker-assets/FreeSans.ttf diff --git a/install/faker.php b/setup/faker.php similarity index 99% rename from install/faker.php rename to setup/faker.php index 5df84b32f..4ae74a0e5 100644 --- a/install/faker.php +++ b/setup/faker.php @@ -10,6 +10,10 @@ use Thelia\Condition\ConditionCollection; use Thelia\Coupon\Type\RemoveXAmount; use Thelia\Coupon\Type\RemoveXPercent; +if (php_sapi_name() != 'cli') { + throw new \Exception('this script can only be launched with cli sapi'); +} + require __DIR__ . '/../core/bootstrap.php'; $thelia = new Thelia\Core\Thelia("dev", true); @@ -498,6 +502,7 @@ try { } catch (Exception $e) { echo "error : ".$e->getMessage()."\n"; + echo $e->getTraceAsString(); $con->rollBack(); } diff --git a/install/faker_100categories_1000products_4locales.php b/setup/faker_100categories_1000products_4locales.php similarity index 97% rename from install/faker_100categories_1000products_4locales.php rename to setup/faker_100categories_1000products_4locales.php index 4e31ca296..91a0f3828 100644 --- a/install/faker_100categories_1000products_4locales.php +++ b/setup/faker_100categories_1000products_4locales.php @@ -1,5 +1,7 @@ . */ /* */ /*************************************************************************************/ - +if (php_sapi_name() != 'cli') { + throw new \Exception('this script can only be launched with cli sapi'); +} require __DIR__ . '/../core/bootstrap.php'; $thelia = new Thelia\Core\Thelia("dev", true); @@ -81,7 +83,7 @@ function createProduct($faker, $categories, $template, $attribute, $feature, $co { echo "start creating products\n"; $fileSystem = new \Symfony\Component\Filesystem\Filesystem(); - if (($handle = fopen(THELIA_ROOT . '/install/import/products.csv', "r")) !== FALSE) { + if (($handle = fopen(THELIA_ROOT . '/setup/import/products.csv', "r")) !== FALSE) { $row=0; while (($data = fgetcsv($handle, 100000, ";")) !== FALSE) { $row++; @@ -132,7 +134,7 @@ function createProduct($faker, $categories, $template, $attribute, $feature, $co ->setProduct($product) ->setFile($image) ->save($con); - $fileSystem->copy(THELIA_ROOT . 'install/import/images/'.$image, THELIA_ROOT . 'local/media/images/product/'.$image, true); + $fileSystem->copy(THELIA_ROOT . 'setup/import/images/'.$image, THELIA_ROOT . 'local/media/images/product/'.$image, true); } $pses = explode(";", $data[12]); @@ -197,7 +199,7 @@ function createProduct($faker, $categories, $template, $attribute, $feature, $co function createBrand($con) { echo "start creating brands feature\n"; - if (($handle = fopen(THELIA_ROOT . '/install/import/brand.csv', "r")) !== FALSE) { + if (($handle = fopen(THELIA_ROOT . '/setup/import/brand.csv', "r")) !== FALSE) { $row=0; $feature = new \Thelia\Model\Feature(); $feature @@ -230,7 +232,7 @@ function createCategories($con) { echo "start creating categories\n"; $categories = array(); - if (($handle = fopen(THELIA_ROOT . '/install/import/categories.csv', "r")) !== FALSE) { + if (($handle = fopen(THELIA_ROOT . '/setup/import/categories.csv', "r")) !== FALSE) { $row=0; while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { $row++; @@ -257,7 +259,7 @@ function createCategories($con) function createColors($con) { echo "start creating colors attributes\n"; - if (($handle = fopen(THELIA_ROOT . '/install/import/colors.csv', "r")) !== FALSE) { + if (($handle = fopen(THELIA_ROOT . '/setup/import/colors.csv', "r")) !== FALSE) { $row=0; $attribute = new \Thelia\Model\Attribute(); $attribute diff --git a/install/import/brand.csv b/setup/import/brand.csv similarity index 100% rename from install/import/brand.csv rename to setup/import/brand.csv diff --git a/install/import/categories.csv b/setup/import/categories.csv similarity index 100% rename from install/import/categories.csv rename to setup/import/categories.csv diff --git a/install/import/colors.csv b/setup/import/colors.csv similarity index 100% rename from install/import/colors.csv rename to setup/import/colors.csv diff --git a/install/import/images/PROD001-1.jpg b/setup/import/images/PROD001-1.jpg similarity index 100% rename from install/import/images/PROD001-1.jpg rename to setup/import/images/PROD001-1.jpg diff --git a/install/import/images/PROD001-2.jpg b/setup/import/images/PROD001-2.jpg similarity index 100% rename from install/import/images/PROD001-2.jpg rename to setup/import/images/PROD001-2.jpg diff --git a/install/import/images/PROD001-3.jpg b/setup/import/images/PROD001-3.jpg similarity index 100% rename from install/import/images/PROD001-3.jpg rename to setup/import/images/PROD001-3.jpg diff --git a/install/import/images/PROD001-4.jpg b/setup/import/images/PROD001-4.jpg similarity index 100% rename from install/import/images/PROD001-4.jpg rename to setup/import/images/PROD001-4.jpg diff --git a/install/import/images/PROD001-5.jpg b/setup/import/images/PROD001-5.jpg similarity index 100% rename from install/import/images/PROD001-5.jpg rename to setup/import/images/PROD001-5.jpg diff --git a/install/import/images/PROD002-1.jpg b/setup/import/images/PROD002-1.jpg similarity index 100% rename from install/import/images/PROD002-1.jpg rename to setup/import/images/PROD002-1.jpg diff --git a/install/import/images/PROD002-2.jpg b/setup/import/images/PROD002-2.jpg similarity index 100% rename from install/import/images/PROD002-2.jpg rename to setup/import/images/PROD002-2.jpg diff --git a/install/import/images/PROD002-3.jpg b/setup/import/images/PROD002-3.jpg similarity index 100% rename from install/import/images/PROD002-3.jpg rename to setup/import/images/PROD002-3.jpg diff --git a/install/import/images/PROD002-4.jpg b/setup/import/images/PROD002-4.jpg similarity index 100% rename from install/import/images/PROD002-4.jpg rename to setup/import/images/PROD002-4.jpg diff --git a/install/import/images/PROD002-5.jpg b/setup/import/images/PROD002-5.jpg similarity index 100% rename from install/import/images/PROD002-5.jpg rename to setup/import/images/PROD002-5.jpg diff --git a/install/import/images/PROD002-6.jpg b/setup/import/images/PROD002-6.jpg similarity index 100% rename from install/import/images/PROD002-6.jpg rename to setup/import/images/PROD002-6.jpg diff --git a/install/import/images/PROD003-1.jpg b/setup/import/images/PROD003-1.jpg similarity index 100% rename from install/import/images/PROD003-1.jpg rename to setup/import/images/PROD003-1.jpg diff --git a/install/import/images/PROD003-2.jpg b/setup/import/images/PROD003-2.jpg similarity index 100% rename from install/import/images/PROD003-2.jpg rename to setup/import/images/PROD003-2.jpg diff --git a/install/import/images/PROD003-3.jpg b/setup/import/images/PROD003-3.jpg similarity index 100% rename from install/import/images/PROD003-3.jpg rename to setup/import/images/PROD003-3.jpg diff --git a/install/import/images/PROD004-1.jpg b/setup/import/images/PROD004-1.jpg similarity index 100% rename from install/import/images/PROD004-1.jpg rename to setup/import/images/PROD004-1.jpg diff --git a/install/import/images/PROD004-2.jpg b/setup/import/images/PROD004-2.jpg similarity index 100% rename from install/import/images/PROD004-2.jpg rename to setup/import/images/PROD004-2.jpg diff --git a/install/import/images/PROD005-1.jpg b/setup/import/images/PROD005-1.jpg similarity index 100% rename from install/import/images/PROD005-1.jpg rename to setup/import/images/PROD005-1.jpg diff --git a/install/import/images/PROD005-2.jpg b/setup/import/images/PROD005-2.jpg similarity index 100% rename from install/import/images/PROD005-2.jpg rename to setup/import/images/PROD005-2.jpg diff --git a/install/import/images/PROD005-3.jpg b/setup/import/images/PROD005-3.jpg similarity index 100% rename from install/import/images/PROD005-3.jpg rename to setup/import/images/PROD005-3.jpg diff --git a/install/import/images/PROD005-4.jpg b/setup/import/images/PROD005-4.jpg similarity index 100% rename from install/import/images/PROD005-4.jpg rename to setup/import/images/PROD005-4.jpg diff --git a/install/import/images/PROD005-5.jpg b/setup/import/images/PROD005-5.jpg similarity index 100% rename from install/import/images/PROD005-5.jpg rename to setup/import/images/PROD005-5.jpg diff --git a/install/import/images/PROD005-6.jpg b/setup/import/images/PROD005-6.jpg similarity index 100% rename from install/import/images/PROD005-6.jpg rename to setup/import/images/PROD005-6.jpg diff --git a/install/import/images/PROD006-1.jpg b/setup/import/images/PROD006-1.jpg similarity index 100% rename from install/import/images/PROD006-1.jpg rename to setup/import/images/PROD006-1.jpg diff --git a/install/import/images/PROD006-2.jpg b/setup/import/images/PROD006-2.jpg similarity index 100% rename from install/import/images/PROD006-2.jpg rename to setup/import/images/PROD006-2.jpg diff --git a/install/import/images/PROD006-3.jpg b/setup/import/images/PROD006-3.jpg similarity index 100% rename from install/import/images/PROD006-3.jpg rename to setup/import/images/PROD006-3.jpg diff --git a/install/import/images/PROD006-4.jpg b/setup/import/images/PROD006-4.jpg similarity index 100% rename from install/import/images/PROD006-4.jpg rename to setup/import/images/PROD006-4.jpg diff --git a/install/import/images/PROD006-5.jpg b/setup/import/images/PROD006-5.jpg similarity index 100% rename from install/import/images/PROD006-5.jpg rename to setup/import/images/PROD006-5.jpg diff --git a/install/import/images/PROD006-6.jpg b/setup/import/images/PROD006-6.jpg similarity index 100% rename from install/import/images/PROD006-6.jpg rename to setup/import/images/PROD006-6.jpg diff --git a/install/import/images/PROD007-1.jpg b/setup/import/images/PROD007-1.jpg similarity index 100% rename from install/import/images/PROD007-1.jpg rename to setup/import/images/PROD007-1.jpg diff --git a/install/import/images/PROD007-2.jpg b/setup/import/images/PROD007-2.jpg similarity index 100% rename from install/import/images/PROD007-2.jpg rename to setup/import/images/PROD007-2.jpg diff --git a/install/import/images/PROD007-3.jpg b/setup/import/images/PROD007-3.jpg similarity index 100% rename from install/import/images/PROD007-3.jpg rename to setup/import/images/PROD007-3.jpg diff --git a/install/import/images/PROD007-4.jpg b/setup/import/images/PROD007-4.jpg similarity index 100% rename from install/import/images/PROD007-4.jpg rename to setup/import/images/PROD007-4.jpg diff --git a/install/import/images/PROD008-1.jpg b/setup/import/images/PROD008-1.jpg similarity index 100% rename from install/import/images/PROD008-1.jpg rename to setup/import/images/PROD008-1.jpg diff --git a/install/import/images/PROD008-2.jpg b/setup/import/images/PROD008-2.jpg similarity index 100% rename from install/import/images/PROD008-2.jpg rename to setup/import/images/PROD008-2.jpg diff --git a/install/import/images/PROD008-3.jpg b/setup/import/images/PROD008-3.jpg similarity index 100% rename from install/import/images/PROD008-3.jpg rename to setup/import/images/PROD008-3.jpg diff --git a/install/import/images/PROD008-4.jpg b/setup/import/images/PROD008-4.jpg similarity index 100% rename from install/import/images/PROD008-4.jpg rename to setup/import/images/PROD008-4.jpg diff --git a/install/import/images/PROD008-5.jpg b/setup/import/images/PROD008-5.jpg similarity index 100% rename from install/import/images/PROD008-5.jpg rename to setup/import/images/PROD008-5.jpg diff --git a/install/import/images/PROD009-1.jpg b/setup/import/images/PROD009-1.jpg similarity index 100% rename from install/import/images/PROD009-1.jpg rename to setup/import/images/PROD009-1.jpg diff --git a/install/import/images/PROD009-2.jpg b/setup/import/images/PROD009-2.jpg similarity index 100% rename from install/import/images/PROD009-2.jpg rename to setup/import/images/PROD009-2.jpg diff --git a/install/import/images/PROD009-3.jpg b/setup/import/images/PROD009-3.jpg similarity index 100% rename from install/import/images/PROD009-3.jpg rename to setup/import/images/PROD009-3.jpg diff --git a/install/import/images/PROD010-1.jpg b/setup/import/images/PROD010-1.jpg similarity index 100% rename from install/import/images/PROD010-1.jpg rename to setup/import/images/PROD010-1.jpg diff --git a/install/import/images/PROD010-2.jpg b/setup/import/images/PROD010-2.jpg similarity index 100% rename from install/import/images/PROD010-2.jpg rename to setup/import/images/PROD010-2.jpg diff --git a/install/import/images/PROD010-3.jpg b/setup/import/images/PROD010-3.jpg similarity index 100% rename from install/import/images/PROD010-3.jpg rename to setup/import/images/PROD010-3.jpg diff --git a/install/import/images/PROD010-4.jpg b/setup/import/images/PROD010-4.jpg similarity index 100% rename from install/import/images/PROD010-4.jpg rename to setup/import/images/PROD010-4.jpg diff --git a/install/import/images/PROD011-1.jpg b/setup/import/images/PROD011-1.jpg similarity index 100% rename from install/import/images/PROD011-1.jpg rename to setup/import/images/PROD011-1.jpg diff --git a/install/import/images/PROD011-2.jpg b/setup/import/images/PROD011-2.jpg similarity index 100% rename from install/import/images/PROD011-2.jpg rename to setup/import/images/PROD011-2.jpg diff --git a/install/import/images/PROD011-3.jpg b/setup/import/images/PROD011-3.jpg similarity index 100% rename from install/import/images/PROD011-3.jpg rename to setup/import/images/PROD011-3.jpg diff --git a/install/import/images/PROD011-4.jpg b/setup/import/images/PROD011-4.jpg similarity index 100% rename from install/import/images/PROD011-4.jpg rename to setup/import/images/PROD011-4.jpg diff --git a/install/import/images/PROD012-1.jpg b/setup/import/images/PROD012-1.jpg similarity index 100% rename from install/import/images/PROD012-1.jpg rename to setup/import/images/PROD012-1.jpg diff --git a/install/import/images/PROD012-2.jpg b/setup/import/images/PROD012-2.jpg similarity index 100% rename from install/import/images/PROD012-2.jpg rename to setup/import/images/PROD012-2.jpg diff --git a/install/import/images/PROD013-1.jpg b/setup/import/images/PROD013-1.jpg similarity index 100% rename from install/import/images/PROD013-1.jpg rename to setup/import/images/PROD013-1.jpg diff --git a/install/import/images/PROD014-1.jpg b/setup/import/images/PROD014-1.jpg similarity index 100% rename from install/import/images/PROD014-1.jpg rename to setup/import/images/PROD014-1.jpg diff --git a/install/import/images/PROD014-2.jpg b/setup/import/images/PROD014-2.jpg similarity index 100% rename from install/import/images/PROD014-2.jpg rename to setup/import/images/PROD014-2.jpg diff --git a/install/import/images/PROD014-3.jpg b/setup/import/images/PROD014-3.jpg similarity index 100% rename from install/import/images/PROD014-3.jpg rename to setup/import/images/PROD014-3.jpg diff --git a/install/import/images/PROD014-4.jpg b/setup/import/images/PROD014-4.jpg similarity index 100% rename from install/import/images/PROD014-4.jpg rename to setup/import/images/PROD014-4.jpg diff --git a/install/import/images/PROD015-1.jpg b/setup/import/images/PROD015-1.jpg similarity index 100% rename from install/import/images/PROD015-1.jpg rename to setup/import/images/PROD015-1.jpg diff --git a/install/import/images/PROD015-2.jpg b/setup/import/images/PROD015-2.jpg similarity index 100% rename from install/import/images/PROD015-2.jpg rename to setup/import/images/PROD015-2.jpg diff --git a/install/import/images/PROD016-1.jpg b/setup/import/images/PROD016-1.jpg similarity index 100% rename from install/import/images/PROD016-1.jpg rename to setup/import/images/PROD016-1.jpg diff --git a/install/import/images/PROD017-1.jpg b/setup/import/images/PROD017-1.jpg similarity index 100% rename from install/import/images/PROD017-1.jpg rename to setup/import/images/PROD017-1.jpg diff --git a/install/import/images/PROD017-2.jpg b/setup/import/images/PROD017-2.jpg similarity index 100% rename from install/import/images/PROD017-2.jpg rename to setup/import/images/PROD017-2.jpg diff --git a/install/import/images/PROD017-3.jpg b/setup/import/images/PROD017-3.jpg similarity index 100% rename from install/import/images/PROD017-3.jpg rename to setup/import/images/PROD017-3.jpg diff --git a/install/import/images/PROD017-4.jpg b/setup/import/images/PROD017-4.jpg similarity index 100% rename from install/import/images/PROD017-4.jpg rename to setup/import/images/PROD017-4.jpg diff --git a/install/import/images/PROD018-1.jpg b/setup/import/images/PROD018-1.jpg similarity index 100% rename from install/import/images/PROD018-1.jpg rename to setup/import/images/PROD018-1.jpg diff --git a/install/import/images/PROD019-1.jpg b/setup/import/images/PROD019-1.jpg similarity index 100% rename from install/import/images/PROD019-1.jpg rename to setup/import/images/PROD019-1.jpg diff --git a/install/import/images/PROD019-2.jpg b/setup/import/images/PROD019-2.jpg similarity index 100% rename from install/import/images/PROD019-2.jpg rename to setup/import/images/PROD019-2.jpg diff --git a/install/import/images/PROD019-3.jpg b/setup/import/images/PROD019-3.jpg similarity index 100% rename from install/import/images/PROD019-3.jpg rename to setup/import/images/PROD019-3.jpg diff --git a/install/import/images/PROD019-4.jpg b/setup/import/images/PROD019-4.jpg similarity index 100% rename from install/import/images/PROD019-4.jpg rename to setup/import/images/PROD019-4.jpg diff --git a/install/import/images/PROD019-5.jpg b/setup/import/images/PROD019-5.jpg similarity index 100% rename from install/import/images/PROD019-5.jpg rename to setup/import/images/PROD019-5.jpg diff --git a/install/import/images/PROD020-1.jpg b/setup/import/images/PROD020-1.jpg similarity index 100% rename from install/import/images/PROD020-1.jpg rename to setup/import/images/PROD020-1.jpg diff --git a/install/import/images/PROD021-1.jpg b/setup/import/images/PROD021-1.jpg similarity index 100% rename from install/import/images/PROD021-1.jpg rename to setup/import/images/PROD021-1.jpg diff --git a/install/import/images/PROD021-2.jpg b/setup/import/images/PROD021-2.jpg similarity index 100% rename from install/import/images/PROD021-2.jpg rename to setup/import/images/PROD021-2.jpg diff --git a/install/import/images/PROD021-3.jpg b/setup/import/images/PROD021-3.jpg similarity index 100% rename from install/import/images/PROD021-3.jpg rename to setup/import/images/PROD021-3.jpg diff --git a/install/import/images/PROD021-4.jpg b/setup/import/images/PROD021-4.jpg similarity index 100% rename from install/import/images/PROD021-4.jpg rename to setup/import/images/PROD021-4.jpg diff --git a/install/import/images/PROD022-1.jpg b/setup/import/images/PROD022-1.jpg similarity index 100% rename from install/import/images/PROD022-1.jpg rename to setup/import/images/PROD022-1.jpg diff --git a/install/import/images/PROD022-2.jpg b/setup/import/images/PROD022-2.jpg similarity index 100% rename from install/import/images/PROD022-2.jpg rename to setup/import/images/PROD022-2.jpg diff --git a/install/import/images/PROD022-3.jpg b/setup/import/images/PROD022-3.jpg similarity index 100% rename from install/import/images/PROD022-3.jpg rename to setup/import/images/PROD022-3.jpg diff --git a/install/import/images/PROD022-4.jpg b/setup/import/images/PROD022-4.jpg similarity index 100% rename from install/import/images/PROD022-4.jpg rename to setup/import/images/PROD022-4.jpg diff --git a/install/import/images/PROD022-5.jpg b/setup/import/images/PROD022-5.jpg similarity index 100% rename from install/import/images/PROD022-5.jpg rename to setup/import/images/PROD022-5.jpg diff --git a/install/import/images/PROD023-1.jpg b/setup/import/images/PROD023-1.jpg similarity index 100% rename from install/import/images/PROD023-1.jpg rename to setup/import/images/PROD023-1.jpg diff --git a/install/import/images/PROD023-2.jpg b/setup/import/images/PROD023-2.jpg similarity index 100% rename from install/import/images/PROD023-2.jpg rename to setup/import/images/PROD023-2.jpg diff --git a/install/import/images/PROD023-3.jpg b/setup/import/images/PROD023-3.jpg similarity index 100% rename from install/import/images/PROD023-3.jpg rename to setup/import/images/PROD023-3.jpg diff --git a/install/import/images/PROD023-4.jpg b/setup/import/images/PROD023-4.jpg similarity index 100% rename from install/import/images/PROD023-4.jpg rename to setup/import/images/PROD023-4.jpg diff --git a/install/import/images/PROD023-5.jpg b/setup/import/images/PROD023-5.jpg similarity index 100% rename from install/import/images/PROD023-5.jpg rename to setup/import/images/PROD023-5.jpg diff --git a/install/import/images/PROD023-6.jpg b/setup/import/images/PROD023-6.jpg similarity index 100% rename from install/import/images/PROD023-6.jpg rename to setup/import/images/PROD023-6.jpg diff --git a/install/import/images/PROD024-1.jpg b/setup/import/images/PROD024-1.jpg similarity index 100% rename from install/import/images/PROD024-1.jpg rename to setup/import/images/PROD024-1.jpg diff --git a/install/import/images/PROD024-2.jpg b/setup/import/images/PROD024-2.jpg similarity index 100% rename from install/import/images/PROD024-2.jpg rename to setup/import/images/PROD024-2.jpg diff --git a/install/import/images/PROD024-3.jpg b/setup/import/images/PROD024-3.jpg similarity index 100% rename from install/import/images/PROD024-3.jpg rename to setup/import/images/PROD024-3.jpg diff --git a/install/import/images/PROD024-4.jpg b/setup/import/images/PROD024-4.jpg similarity index 100% rename from install/import/images/PROD024-4.jpg rename to setup/import/images/PROD024-4.jpg diff --git a/install/import/images/PROD024-5.jpg b/setup/import/images/PROD024-5.jpg similarity index 100% rename from install/import/images/PROD024-5.jpg rename to setup/import/images/PROD024-5.jpg diff --git a/install/import/images/PROD025-1.jpg b/setup/import/images/PROD025-1.jpg similarity index 100% rename from install/import/images/PROD025-1.jpg rename to setup/import/images/PROD025-1.jpg diff --git a/install/import/images/PROD025-2.jpg b/setup/import/images/PROD025-2.jpg similarity index 100% rename from install/import/images/PROD025-2.jpg rename to setup/import/images/PROD025-2.jpg diff --git a/install/import/images/PROD025-3.jpg b/setup/import/images/PROD025-3.jpg similarity index 100% rename from install/import/images/PROD025-3.jpg rename to setup/import/images/PROD025-3.jpg diff --git a/install/import/images/PROD026-1.jpg b/setup/import/images/PROD026-1.jpg similarity index 100% rename from install/import/images/PROD026-1.jpg rename to setup/import/images/PROD026-1.jpg diff --git a/install/import/images/PROD027-1.jpg b/setup/import/images/PROD027-1.jpg similarity index 100% rename from install/import/images/PROD027-1.jpg rename to setup/import/images/PROD027-1.jpg diff --git a/install/import/images/PROD028-1.jpg b/setup/import/images/PROD028-1.jpg similarity index 100% rename from install/import/images/PROD028-1.jpg rename to setup/import/images/PROD028-1.jpg diff --git a/install/import/images/PROD029-1.jpg b/setup/import/images/PROD029-1.jpg similarity index 100% rename from install/import/images/PROD029-1.jpg rename to setup/import/images/PROD029-1.jpg diff --git a/install/import/images/PROD030-1.jpg b/setup/import/images/PROD030-1.jpg similarity index 100% rename from install/import/images/PROD030-1.jpg rename to setup/import/images/PROD030-1.jpg diff --git a/install/import/images/PROD030-2.jpg b/setup/import/images/PROD030-2.jpg similarity index 100% rename from install/import/images/PROD030-2.jpg rename to setup/import/images/PROD030-2.jpg diff --git a/install/import/images/PROD030-3.jpg b/setup/import/images/PROD030-3.jpg similarity index 100% rename from install/import/images/PROD030-3.jpg rename to setup/import/images/PROD030-3.jpg diff --git a/install/import/images/PROD030-4.jpg b/setup/import/images/PROD030-4.jpg similarity index 100% rename from install/import/images/PROD030-4.jpg rename to setup/import/images/PROD030-4.jpg diff --git a/install/import/products.csv b/setup/import/products.csv similarity index 100% rename from install/import/products.csv rename to setup/import/products.csv diff --git a/install/insert.sql b/setup/insert.sql similarity index 73% rename from install/insert.sql rename to setup/insert.sql index 2d53b3801..2da553904 100644 --- a/install/insert.sql +++ b/setup/insert.sql @@ -1,8 +1,10 @@ INSERT INTO `lang`(`id`,`title`,`code`,`locale`,`url`,`date_format`,`time_format`,`datetime_format`,`decimal_separator`,`thousands_separator`,`decimals`,`by_default`,`created_at`,`updated_at`)VALUES (1, 'Français', 'fr', 'fr_FR', '', 'd/m/Y', 'H:i:s', 'd/m/y H:i:s', ',', ' ', '2', '0', NOW(), NOW()), (2, 'English', 'en', 'en_US', '', 'm-d-Y', 'h:i:s', 'm-d-Y h:i:s', '.', ' ', '2', '1', NOW(), NOW()), -(3, 'castellano', 'es', 'es_ES', '', 'm-d-Y', 'h:i:s', 'm-d-Y h:i:s', ',', '.', '2', '0', NOW(), NOW()), -(4, 'Italiano', 'it', 'it_IT', '', 'd/m/Y', 'H:i:s', 'd/m/y H:i:s', ',', ' ', '2', '0', NOW(), NOW()); +(3, 'Castellano', 'es', 'es_ES', '', 'm-d-Y', 'h:i:s', 'm-d-Y h:i:s', ',', '.', '2', '0', NOW(), NOW()), +(4, 'Italiano', 'it', 'it_IT', '', 'd/m/Y', 'H:i:s', 'd/m/y H:i:s', ',', ' ', '2', '0', NOW(), NOW()), +(5, 'Russian', 'ru', 'ru_RU', '', 'j.n.Y', 'H:i:s', 'j.n.Y H:i:s', ',', ' ', '2', 0, NOW(), NOW()), +(6, 'Czech', 'cs', 'cs_CZ', '', 'j.n.Y', 'H:i:s', 'j.n.Y H:i:s', ',', ' ', '2', 0, NOW(), NOW()); INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES ('session_config.handlers', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler', 0, 0, NOW(), NOW()), @@ -39,11 +41,15 @@ INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updat ('store_name','', 0, 1, NOW(), NOW()), ('store_email','', 0, 1, NOW(), NOW()), ('one_domain_foreach_lang','0', 1, 1, NOW(), NOW()), -('thelia_version','2.0.0-RC1', 1, 1, NOW(), NOW()), +('thelia_version','2.0.1', 1, 1, NOW(), NOW()), ('thelia_major_version','2', 1, 1, NOW(), NOW()), ('thelia_minus_version','0', 1, 1, NOW(), NOW()), -('thelia_release_version','0', 1, 1, NOW(), NOW()), -('thelia_extra_version','RC1', 1, 1, NOW(), NOW()); +('thelia_release_version','1', 1, 1, NOW(), NOW()), +('thelia_extra_version','', 1, 1, NOW(), NOW()), +('front_cart_country_cookie_name','fcccn', 1, 1, NOW(), NOW()), +('front_cart_country_cookie_expires','2592000', 1, 1, NOW(), NOW()), +('sitemap_ttl','7200', 1, 1, NOW(), NOW()), +('feed_ttl','7200', 1, 1, NOW(), NOW()); INSERT INTO `config_i18n` (`id`, `locale`, `title`, `description`, `chapo`, `postscriptum`) VALUES @@ -1269,7 +1275,17 @@ INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES (21, 'admin.configuration.shipping-zone', NOW(), NOW()), (22, 'admin.configuration.tax', NOW(), NOW()), (23, 'admin.configuration.template', NOW(), NOW()), -(24, 'admin.configuration.system-log', NOW(), NOW()); +(24, 'admin.configuration.system-log', NOW(), NOW()), +(25, 'admin.cache', NOW(), NOW()), +(26, 'admin.home', NOW(), NOW()), +(27, 'admin.configuration.store', NOW(), NOW()), +(28, 'admin.configuration.variable', NOW(), NOW()), +(29, 'admin.configuration.admin-logs', NOW(), NOW()), +(30, 'admin.configuration.system-logs', NOW(), NOW()), +(31, 'admin.configuration.advanced', NOW(), NOW()), +(32, 'admin.configuration.translations', NOW(), NOW()), +(33, 'admin.export', NOW(), NOW()), +(34, 'admin.tools', NOW(), NOW()); /** generated with command : php Thelia thelia:generate-resources --output sql-i18n @@ -1322,16 +1338,35 @@ INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES (23, 'en_US', 'Configuration / Template'), (23, 'fr_FR', 'Configuration / Template'), (24, 'en_US', 'Configuration / System Log'), -(24, 'fr_FR', 'Configuration / Logs système'); +(24, 'fr_FR', 'Configuration / Logs système'), +(25, 'en_US', 'Configuration / Cache'), +(25, 'fr_FR', 'Configuration / Cache'), +(26, 'en_US', 'Back-office home page'), +(26, 'fr_FR', 'Page d''acceuil de l''administration'), +(27, 'en_US', 'Store information configuration'), +(27, 'fr_FR', 'Informations sur la boutique'), +(28, 'en_US', 'Configuration variables'), +(28, 'fr_FR', 'Variables de configuration'), +(29, 'en_US', 'View administration logs'), +(29, 'fr_FR', 'Consulter les logs d''administration'), +(30, 'en_US', 'Logging system configuration'), +(30, 'fr_FR', 'Configuration du système de log'), +(31, 'en_US', 'Advanced configuration'), +(31, 'fr_FR', 'Configuration avancée'), +(32, 'en_US', 'Translations'), +(32, 'fr_FR', 'Traductions'), +(33, 'en_US', 'Back-office export management'), +(33, 'fr_FR', 'gestion des exports'), +(34, 'en_US', 'Tools panel'), +(34, 'fr_FR', 'Outils'); -INSERT INTO `message` (`id`, `name`, `secured`, `created_at`, `updated_at`, `version`, `version_created_at`, `version_created_by`) VALUES -(1, 'order_confirmation', NULL, NOW(), NOW(), 2, NOW(), NULL), -(2, 'lost_password', NULL, NOW(), NOW(), 2, NOW(), NULL); +INSERT INTO `message` (`id`, `name`, `secured`, `text_layout_file_name`, `text_template_file_name`, `html_layout_file_name`, `html_template_file_name`, `created_at`, `updated_at`) VALUES +(1, 'order_confirmation', NULL, NULL, NULL, NULL, 'order_confirmation.html', NOW(), NOW()), +(2, 'lost_password', NULL, NULL, NULL, NULL, 'password.html', NOW(), NOW()); INSERT INTO `message_i18n` (`id`, `locale`, `title`, `subject`, `text_message`, `html_message`) VALUES -(1, 'en_US', 'order confirmation', 'Commande : Commande : {$order_ref}', '{assign var="order_id" value=1}\r\n\r\n{loop name="order.invoice" type="order" id=$order_id customer="*"}\r\n {loop name="currency.order" type="currency" id=$CURRENCY}\r\n {assign "orderCurrency" $CODE}\r\n {/loop}\r\n{loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS}\r\n{loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}\\r\\n\r\n{$ADDRESS1} {$ADDRESS2} {$ADDRESS3}\\r\\n\r\n{$ZIPCODE} {$CITY}\\r\\n\r\n{loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}\\r\\n\r\n{/loop}\r\nConfirmation de commande {$REF} du {format_date date=$INVOICE_DATE}\\r\\n\\r\\n\r\nLes articles commandés:\\r\\n\r\n{loop type="order_product" name="order-products" order=$ID}\r\n{if $WAS_IN_PROMO == 1}\r\n {assign "realPrice" $PROMO_PRICE}\r\n {assign "realTax" $PROMO_PRICE_TAX}\r\n {assign "realTaxedPrice" $TAXED_PROMO_PRICE}\r\n{else}\r\n {assign "realPrice" $PRICE}\r\n {assign "realTax" $PRICE_TAX}\r\n {assign "realTaxedPrice" $TAXED_PRICE}\r\n{/if}\r\n \\r\\n\r\n Article : {$TITLE}\r\n{ifloop rel="combinations"}\r\n {loop type="order_product_attribute_combination" name="combinations" order_product=$ID}\r\n {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}\\r\\n\r\n{/loop}\r\n{/ifloop}\\r\\n\r\n Quantité : {$QUANTITY}\\r\\n\r\n Prix unitaire TTC : {$realTaxedPrice} {$orderCurrency}\\r\\n\r\n{/loop}\r\n\\r\\n-----------------------------------------\\r\\n\r\nMontant total TTC : {$TOTAL_TAXED_AMOUNT - $POSTAGE} {$orderCurrency} \\r\\n\r\nFrais de port TTC : {$POSTAGE} {$orderCurrency} \\r\\n\r\nSomme totale: {$TOTAL_TAXED_AMOUNT} {$orderCurrency} \\r\\n\r\n==================================\\r\\n\\r\\n\r\nVotre facture est disponible dans la rubrique mon compte sur {config key="url_site"}\r\n{/loop}', '{loop name="order.invoice" type="order" id=$order_id customer="*"}\r\n {loop name="currency.order" type="currency" id=$CURRENCY}\r\n {assign "orderCurrency" $SYMBOL}\r\n {/loop}\r\n{loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"}\r\n {assign var="customer_ref" value=$REF}\r\n{/loop}\r\n\r\n\r\n\r\n \r\n courriel de confirmation de commande de {config key="url_site"} \r\n {literal}\r\n \r\n {/literal}\r\n\r\n\r\n
\r\n

{config key="store_name"}

\r\n

Confirmation de commande

\r\n

N° {$REF} du {format_date date=$INVOICE_DATE output="date"}

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {loop type="order_product" name="order-products" order=$ID}\r\n {if $WAS_IN_PROMO == 1}\r\n {assign "realPrice" $PROMO_PRICE}\r\n {assign "realTax" $PROMO_PRICE_TAX}\r\n {assign "realTaxedPrice" $TAXED_PROMO_PRICE}\r\n {else}\r\n {assign "realPrice" $PRICE}\r\n {assign "realTax" $PRICE_TAX}\r\n {assign "realTaxedPrice" $TAXED_PRICE}\r\n {/if}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {/loop}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
RéférenceDésignationP.U. €Qté
{$REF}{$TITLE}\r\n {ifloop rel="combinations"}\r\n {loop type="order_product_attribute_combination" name="combinations" order_product=$ID}\r\n {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}
\r\n {/loop}\r\n {/ifloop}\r\n
{$orderCurrency} {$realTaxedPrice}{$QUANTITY}
 
Montant total avant remise €{$orderCurrency} {$TOTAL_TAXED_AMOUNT - $POSTAGE}
Port €{$orderCurrency} {$POSTAGE}
Montant total de la commande €{$orderCurrency} {$TOTAL_TAXED_AMOUNT}
\r\n
\r\n

LIVRAISON : {loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}

\r\n {loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS}\r\n

N° de client : {$customer_ref}

\r\n

Nom :\r\n {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}

\r\n

N° et rue :\r\n {$ADDRESS1}

\r\n

Complément : {$ADDRESS2}\r\n {$ADDRESS3}

\r\n

Code postal : {$ZIPCODE}

\r\n

Ville : {$CITY}

\r\n

Pays : {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}

\r\n
\r\n {/loop}\r\n
\r\n

FACTURATION : paiement par {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}

\r\n {loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS}\r\n

N° de client : {$customer_ref}

\r\n

Nom :\r\n {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}

\r\n

N° et rue :\r\n {$ADDRESS1}

\r\n

Complément : {$ADDRESS2}\r\n {$ADDRESS3}

\r\n

Code postal : {$ZIPCODE}

\r\n

Ville : {$CITY}

\r\n

Pays : {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}

\r\n
\r\n {/loop}\r\n

Le suivi de votre commande est disponible dans la rubrique mon compte sur {config key="url_site"}

\r\n
\r\n\r\n\r\n{/loop}'), -(1, 'fr_FR', 'Confirmation de commande', 'Commande : {$order_ref}', '{assign var="order_id" value=1}\r\n\r\n{loop name="order.invoice" type="order" id=$order_id customer="*"}\r\n {loop name="currency.order" type="currency" id=$CURRENCY}\r\n {assign "orderCurrency" $CODE}\r\n {/loop}\r\n{loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS}\r\n{loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}\\r\\n\r\n{$ADDRESS1} {$ADDRESS2} {$ADDRESS3}\\r\\n\r\n{$ZIPCODE} {$CITY}\\r\\n\r\n{loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}\\r\\n\r\n{/loop}\r\nConfirmation de commande {$REF} du {format_date date=$INVOICE_DATE}\\r\\n\\r\\n\r\nLes articles commandés:\\r\\n\r\n{loop type="order_product" name="order-products" order=$ID}\r\n{if $WAS_IN_PROMO == 1}\r\n {assign "realPrice" $PROMO_PRICE}\r\n {assign "realTax" $PROMO_PRICE_TAX}\r\n {assign "realTaxedPrice" $TAXED_PROMO_PRICE}\r\n{else}\r\n {assign "realPrice" $PRICE}\r\n {assign "realTax" $PRICE_TAX}\r\n {assign "realTaxedPrice" $TAXED_PRICE}\r\n{/if}\r\n \\r\\n\r\n Article : {$TITLE}\r\n{ifloop rel="combinations"}\r\n {loop type="order_product_attribute_combination" name="combinations" order_product=$ID}\r\n {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}\\r\\n\r\n{/loop}\r\n{/ifloop}\\r\\n\r\n Quantité : {$QUANTITY}\\r\\n\r\n Prix unitaire TTC : {$realTaxedPrice} {$orderCurrency}\\r\\n\r\n{/loop}\r\n\\r\\n-----------------------------------------\\r\\n\r\nMontant total TTC : {$TOTAL_TAXED_AMOUNT - $POSTAGE} {$orderCurrency} \\r\\n\r\nFrais de port TTC : {$POSTAGE} {$orderCurrency} \\r\\n\r\nSomme totale: {$TOTAL_TAXED_AMOUNT} {$orderCurrency} \\r\\n\r\n==================================\\r\\n\\r\\n\r\nVotre facture est disponible dans la rubrique mon compte sur {config key="url_site"}\r\n{/loop}', '{loop name="order.invoice" type="order" id=$order_id customer="*"}\r\n {loop name="currency.order" type="currency" id=$CURRENCY}\r\n {assign "orderCurrency" $SYMBOL}\r\n {/loop}\r\n{loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"}\r\n {assign var="customer_ref" value=$REF}\r\n{/loop}\r\n\r\n\r\n\r\n \r\n courriel de confirmation de commande de {config key="url_site"} \r\n {literal}\r\n \r\n {/literal}\r\n\r\n\r\n
\r\n

{config key="store_name"}

\r\n

Confirmation de commande

\r\n

N° {$REF} du {format_date date=$INVOICE_DATE output="date"}

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {loop type="order_product" name="order-products" order=$ID}\r\n {if $WAS_IN_PROMO == 1}\r\n {assign "realPrice" $PROMO_PRICE}\r\n {assign "realTax" $PROMO_PRICE_TAX}\r\n {assign "realTaxedPrice" $TAXED_PROMO_PRICE}\r\n {else}\r\n {assign "realPrice" $PRICE}\r\n {assign "realTax" $PRICE_TAX}\r\n {assign "realTaxedPrice" $TAXED_PRICE}\r\n {/if}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {/loop}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
RéférenceDésignationP.U. €Qté
{$REF}{$TITLE}\r\n {ifloop rel="combinations"}\r\n {loop type="order_product_attribute_combination" name="combinations" order_product=$ID}\r\n {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}
\r\n {/loop}\r\n {/ifloop}\r\n
{$orderCurrency} {$realTaxedPrice}{$QUANTITY}
 
Montant total avant remise €{$orderCurrency} {$TOTAL_TAXED_AMOUNT - $POSTAGE}
Port €{$orderCurrency} {$POSTAGE}
Montant total de la commande €{$orderCurrency} {$TOTAL_TAXED_AMOUNT}
\r\n
\r\n

LIVRAISON : {loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}

\r\n {loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS}\r\n

N° de client : {$customer_ref}

\r\n

Nom :\r\n {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}

\r\n

N° et rue :\r\n {$ADDRESS1}

\r\n

Complément : {$ADDRESS2}\r\n {$ADDRESS3}

\r\n

Code postal : {$ZIPCODE}

\r\n

Ville : {$CITY}

\r\n

Pays : {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}

\r\n
\r\n {/loop}\r\n
\r\n

FACTURATION : paiement par {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}

\r\n {loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS}\r\n

N° de client : {$customer_ref}

\r\n

Nom :\r\n {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}

\r\n

N° et rue :\r\n {$ADDRESS1}

\r\n

Complément : {$ADDRESS2}\r\n {$ADDRESS3}

\r\n

Code postal : {$ZIPCODE}

\r\n

Ville : {$CITY}

\r\n

Pays : {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}

\r\n
\r\n {/loop}\r\n

Le suivi de votre commande est disponible dans la rubrique mon compte sur {config key="url_site"}

\r\n
\r\n\r\n\r\n{/loop}'), -(2, 'en_US', 'Your new password', 'Your new password', 'Your new passord is : {$password}', '\r\n\r\n\r\n\r\nchanging password email for {config key="urlsite"} \r\n{literal}\r\n\r\n{/literal}\r\n\r\n\r\n
\r\n
\r\n

{config key="store_name"}

\r\n

Changement de mot de passe

\r\n
You have lost your password
\r\nYour new password is {$password}.
\r\n
\r\n
\r\n

Vous pouvez à présent vous connecter sur {config key="urlsite"}.
Please, change this password after your first connection

\r\n\r\n'), -(2, 'fr_FR', 'Votre nouveau mot de passe', 'Votre nouveau mot de passe', 'Votre nouveau mot de passe est : {$password}', '\r\n\r\n\r\n\r\ncourriel de confirmation de changement de mot de passe de {config key="urlsite"} \r\n{literal}\r\n\r\n{/literal}\r\n\r\n\r\n
\r\n
\r\n

{config key="store_name"}

\r\n

Changement de mot de passe

\r\n
Vous avez perdu votre mot de passe.
\r\nVotre nouveau mot de passe est {$password}.
\r\n
\r\n
\r\n

Vous pouvez à présent vous connecter sur {config key="urlsite"}.
N''oubliez pas de modifier votre mot de passe.

\r\n\r\n'); - +(1, 'en_US', 'order confirmation', 'Order : {$order_ref}', '{assign var="order_id" value=1}\\r\\n\\r\\n{loop name="order.invoice" type="order" id=$order_id customer="*"}\\r\\n {loop name="currency.order" type="currency" id=$CURRENCY}\\r\\n {assign "orderCurrency" $CODE}\\r\\n {/loop}\\r\\n{loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS}\\r\\n{loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}\\\\r\\\\n\\r\\n{$ADDRESS1} {$ADDRESS2} {$ADDRESS3}\\\\r\\\\n\\r\\n{$ZIPCODE} {$CITY}\\\\r\\\\n\\r\\n{loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}\\\\r\\\\n\\r\\n{/loop}\\r\\nConfirmation de commande {$REF} du {format_date date=$INVOICE_DATE}\\\\r\\\\n\\\\r\\\\n\\r\\nLes articles commandés:\\\\r\\\\n\\r\\n{loop type="order_product" name="order-products" order=$ID}\\r\\n{if $WAS_IN_PROMO == 1}\\r\\n {assign "realPrice" $PROMO_PRICE}\\r\\n {assign "realTax" $PROMO_PRICE_TAX}\\r\\n {assign "realTaxedPrice" $TAXED_PROMO_PRICE}\\r\\n{else}\\r\\n {assign "realPrice" $PRICE}\\r\\n {assign "realTax" $PRICE_TAX}\\r\\n {assign "realTaxedPrice" $TAXED_PRICE}\\r\\n{/if}\\r\\n \\\\r\\\\n\\r\\n Article : {$TITLE}\\r\\n{ifloop rel="combinations"}\\r\\n {loop type="order_product_attribute_combination" name="combinations" order_product=$ID}\\r\\n {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}\\\\r\\\\n\\r\\n{/loop}\\r\\n{/ifloop}\\\\r\\\\n\\r\\n Quantité : {$QUANTITY}\\\\r\\\\n\\r\\n Prix unitaire TTC : {$realTaxedPrice} {$orderCurrency}\\\\r\\\\n\\r\\n{/loop}\\r\\n\\\\r\\\\n-----------------------------------------\\\\r\\\\n\\r\\nMontant total TTC : {$TOTAL_TAXED_AMOUNT - $POSTAGE} {$orderCurrency} \\\\r\\\\n\\r\\nFrais de port TTC : {$POSTAGE} {$orderCurrency} \\\\r\\\\n\\r\\nSomme totale: {$TOTAL_TAXED_AMOUNT} {$orderCurrency} \\\\r\\\\n\\r\\n==================================\\\\r\\\\n\\\\r\\\\n\\r\\nVotre facture est disponible dans la rubrique mon compte sur {config key="url_site"}\\r\\n{/loop}', NULL), +(1, 'fr_FR', 'Confirmation de commande', 'Commande : {$order_ref}', '{assign var="order_id" value=1}\\r\\n\\r\\n{loop name="order.invoice" type="order" id=$order_id customer="*"}\\r\\n {loop name="currency.order" type="currency" id=$CURRENCY}\\r\\n {assign "orderCurrency" $CODE}\\r\\n {/loop}\\r\\n{loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS}\\r\\n{loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}\\\\r\\\\n\\r\\n{$ADDRESS1} {$ADDRESS2} {$ADDRESS3}\\\\r\\\\n\\r\\n{$ZIPCODE} {$CITY}\\\\r\\\\n\\r\\n{loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}\\\\r\\\\n\\r\\n{/loop}\\r\\nConfirmation de commande {$REF} du {format_date date=$INVOICE_DATE}\\\\r\\\\n\\\\r\\\\n\\r\\nLes articles commandés:\\\\r\\\\n\\r\\n{loop type="order_product" name="order-products" order=$ID}\\r\\n{if $WAS_IN_PROMO == 1}\\r\\n {assign "realPrice" $PROMO_PRICE}\\r\\n {assign "realTax" $PROMO_PRICE_TAX}\\r\\n {assign "realTaxedPrice" $TAXED_PROMO_PRICE}\\r\\n{else}\\r\\n {assign "realPrice" $PRICE}\\r\\n {assign "realTax" $PRICE_TAX}\\r\\n {assign "realTaxedPrice" $TAXED_PRICE}\\r\\n{/if}\\r\\n \\\\r\\\\n\\r\\n Article : {$TITLE}\\r\\n{ifloop rel="combinations"}\\r\\n {loop type="order_product_attribute_combination" name="combinations" order_product=$ID}\\r\\n {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}\\\\r\\\\n\\r\\n{/loop}\\r\\n{/ifloop}\\\\r\\\\n\\r\\n Quantité : {$QUANTITY}\\\\r\\\\n\\r\\n Prix unitaire TTC : {$realTaxedPrice} {$orderCurrency}\\\\r\\\\n\\r\\n{/loop}\\r\\n\\\\r\\\\n-----------------------------------------\\\\r\\\\n\\r\\nMontant total TTC : {$TOTAL_TAXED_AMOUNT - $POSTAGE} {$orderCurrency} \\\\r\\\\n\\r\\nFrais de port TTC : {$POSTAGE} {$orderCurrency} \\\\r\\\\n\\r\\nSomme totale: {$TOTAL_TAXED_AMOUNT} {$orderCurrency} \\\\r\\\\n\\r\\n==================================\\\\r\\\\n\\\\r\\\\n\\r\\nVotre facture est disponible dans la rubrique mon compte sur {config key="url_site"}\\r\\n{/loop}', NULL), +(2, 'en_US', 'Your new password', 'Your new password', 'Your new passord is : {$password}', NULL), +(2, 'fr_FR', 'Votre nouveau mot de passe', 'Votre nouveau mot de passe', 'Votre nouveau mot de passe est : {$password}', NULL); diff --git a/install/tax_faker.php b/setup/tax_faker.php similarity index 96% rename from install/tax_faker.php rename to setup/tax_faker.php index ea3080872..2ac350601 100644 --- a/install/tax_faker.php +++ b/setup/tax_faker.php @@ -1,5 +1,7 @@ = 4.1.x +# It "suspends judgement" for fkey relationships until are tables are set. +SET FOREIGN_KEY_CHECKS = 0; + +UPDATE `config` SET `value`='2.0.1' WHERE `name`='thelia_version'; +UPDATE `config` SET `value`='1' WHERE `name`='thelia_release_version'; +UPDATE `config` SET `value`='' WHERE `name`='thelia_extra_version'; + +INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES +('front_cart_country_cookie_name','fcccn', 1, 1, NOW(), NOW()); +INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES +('front_cart_country_cookie_expires','2592000', 1, 1, NOW(), NOW()); +INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES +('sitemap_ttl','7200', 1, 1, NOW(), NOW()); +INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES +('feed_ttl','7200', 1, 1, NOW(), NOW()); + +ALTER TABLE `module` ADD INDEX `idx_module_activate` (`activate`); + +SELECT @max := MAX(`id`) FROM `resource`; +SET @max := @max+1; + + +INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES +(@max, 'admin.configuration.store', NOW(), NOW()); + +INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES +(@max, 'en_US', 'Store information configuration'), +(@max, 'fr_FR', 'Informations sur la boutique'); + +SET @max := @max+1; + +INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES +(@max, 'admin.configuration.variable', NOW(), NOW()); + +INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES +(@max, 'en_US', 'Configuration variables'), +(@max, 'fr_FR', 'Variables de configuration'); + +SET @max := @max+1; + +INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES + (@max, 'admin.configuration.admin-logs', NOW(), NOW()); + +INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES + (@max, 'en_US', 'View administration logs'), + (@max, 'fr_FR', 'Consulter les logs d\'administration'); + +SET @max := @max+1; + +INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES + (@max, 'admin.configuration.system-logs', NOW(), NOW()); + +INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES + (@max, 'en_US', 'Logging system configuration'), + (@max, 'fr_FR', 'Configuration du système de log'); + +SET @max := @max+1; + +INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES + (@max, 'admin.configuration.advanced', NOW(), NOW()); + +INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES + (@max, 'en_US', 'Advanced configuration'), + (@max, 'fr_FR', 'Configuration avancée'); + +SET @max := @max+1; + +INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES + (@max, 'admin.configuration.translations', NOW(), NOW()); + +INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES + (@max, 'en_US', 'Translations'), + (@max, 'fr_FR', 'Traductions'); + +SET @max := @max+1; + +INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES +(@max, 'admin.tools', NOW(), NOW()); + +INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES +(@max, 'en_US', 'Tools panel'), +(@max, 'fr_FR', 'Outils'); + +SET @max := @max+1; + +INSERT INTO `resource` (`id`, `code`, `created_at`, `updated_at`) VALUES +(@max, 'admin.export', NOW(), NOW()); + +INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES +(@max, 'en_US', 'Back-office export management'), +(@max, 'fr_FR', 'gestion des exports'); + + +SET @max := @max+1; + +INSERT INTO `resource` (`id`, `code`, `created_at`, `updated_at`) VALUES +(@max, 'admin.export.customer.newsletter', NOW(), NOW()); + +INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES +(@max, 'en_US', 'export of newsletter subscribers'), +(@max, 'fr_FR', 'export des inscrits à la newsletter'); + +SELECT @max := MAX(`id`) FROM `lang`; +SET @max := @max+1; + +INSERT INTO `lang`(`id`,`title`,`code`,`locale`,`url`,`date_format`,`time_format`,`datetime_format`,`decimal_separator`,`thousands_separator`,`decimals`,`by_default`,`created_at`,`updated_at`)VALUES +(@max, 'Russian', 'ru', 'ru_RU', '', 'j.n.Y', 'H:i:s', 'j.n.Y H:i:s', ',', ' ', '2', 0, NOW(), NOW()); + +SET @max := @max+1; + +INSERT INTO `lang`(`id`,`title`,`code`,`locale`,`url`,`date_format`,`time_format`,`datetime_format`,`decimal_separator`,`thousands_separator`,`decimals`,`by_default`,`created_at`,`updated_at`)VALUES +(@max, 'Czech', 'cs', 'cs_CZ', '', 'j.n.Y', 'H:i:s', 'j.n.Y H:i:s', ',', ' ', '2', 0, NOW(), NOW()); + + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/templates/backOffice/default/I18n/cs_CZ.php b/templates/backOffice/default/I18n/cs_CZ.php new file mode 100644 index 000000000..634c0e768 --- /dev/null +++ b/templates/backOffice/default/I18n/cs_CZ.php @@ -0,0 +1,4 @@ + ' (default)', + '%count more...' => '%count more...', '© Thelia 2013' => '© Thelia 2013', '(edit)' => '(edit)', 'Check the list of ISO 639-1 codes' => 'Check the list of ISO 639-1 codes', + 'Check the list of ISO 639-1 codes' => 'Check the list of ISO 639-1 codes', '0 combinations' => '0 combinations', + 'Cannot translate all fields. According to your PHP configuration, forms cannot contains more than %current_max_input_vars input fields, but at least %required_max_input_vars are required. Please change the value of max_input_vars in your PHP configuration of change the translation file by hand.' => 'Cannot translate all fields. According to your PHP configuration, forms cannot contains more than %current_max_input_vars input fields, but at least %required_max_input_vars are required. Please change the value of max_input_vars in your PHP configuration of change the translation file by hand.', 'Congratulations, all text is now translated !' => 'Congratulations, all text is now translated !', 'Did not found any text to translate. It\'s probably normal. If not, please be sure to use Smarty\'s "intl" function in templates, or the Translator::trans() method in PHP files.' => 'Did not found any text to translate. It\'s probably normal. If not, please be sure to use Smarty\'s "intl" function in templates, or the Translator::trans() method in PHP files.', + 'Warning, some of your shipping zones are not attached to any delivery module:' => 'Warning, some of your shipping zones are not attached to any delivery module:', 'A content could be attached to more than one folder. Select here the additional folders for this content.' => 'A content could be attached to more than one folder. Select here the additional folders for this content.', 'A product could be attached to more than one category. Select here the additional categories for this product.' => 'A product could be attached to more than one category. Select here the additional categories for this product.', 'A short description, used when a summary or an introduction is required' => 'A short description, used when a summary or an introduction is required', @@ -18,6 +22,7 @@ return array( 'Actions' => 'Actions', 'Activate this log destination' => 'Activate this log destination', 'Add' => 'Add', + 'Add a condition' => 'Add a condition', 'Add a new Customer' => 'Add a new Customer', 'Add a new address' => 'Add a new address', 'Add a new category' => 'Add a new category', @@ -32,7 +37,7 @@ return array( 'Add a new product attribute' => 'Add a new product attribute', 'Add a new product feature' => 'Add a new product feature', 'Add a new product template' => 'Add a new product template', - 'Add a new shipping configuration' => 'Add a new shipping configuration', + 'Add a new shipping zone' => 'Add a new shipping zone', 'Add a new variable' => 'Add a new variable', 'Add tax to this group' => 'Add tax to this group', 'Add this attribute to all product templates' => 'Add this attribute to all product templates', @@ -46,14 +51,18 @@ return array( 'Administration logs' => 'Administration logs', 'Administration profiles' => 'Administration profiles', 'Administrators' => 'Administrators', + 'Advanced configuration' => 'Advanced configuration', + 'Advanced configuration and tools' => 'Advanced configuration and tools', + 'Afficher ce profil' => 'Afficher ce profil', + 'All countries are assigned to a shipping zone.' => 'All countries are assigned to a shipping zone.', 'All orders' => 'All orders', 'Alpha code 2' => 'Alpha code 2', 'Alpha code 3' => 'Alpha code 3', 'Amount' => 'Amount', 'An error occured' => 'An error occured', 'And' => 'And', - 'Application field' => 'Application field', 'Apply' => 'Apply', + 'Associated countries' => 'Associated countries', 'Associations' => 'Associations', 'Attribute' => 'Attribute', 'Attribute Combinations' => 'Attribute Combinations', @@ -68,13 +77,12 @@ return array( 'Average cart' => 'Average cart', 'Back' => 'Back', 'Back-office home' => 'Back-office home', + 'Back-office template you want to translate' => 'Back-office template you want to translate', 'Back-office templates' => 'Back-office templates', 'Back-office users' => 'Back-office users', - 'Browse' => 'Browse', 'Browse files' => 'Browse files', 'Browse this category' => 'Browse this category', 'Browse this folder' => 'Browse this folder', - 'Can\'t be cumulative' => 'Can\'t be cumulative', 'Can\'t load documents, please refresh this page.' => 'Can\'t load documents, please refresh this page.', 'Can\'t load images, please refresh this page.' => 'Can\'t load images, please refresh this page.', 'Can\'t reorder documents, please refresh this page.' => 'Can\'t reorder documents, please refresh this page.', @@ -92,7 +100,9 @@ return array( 'Cellular phone number' => 'Cellular phone number', 'Change this administrator' => 'Change this administrator', 'Change this attribute' => 'Change this attribute', + 'Change this condition' => 'Change this condition', 'Change this country' => 'Change this country', + 'Change this coupon' => 'Change this coupon', 'Change this currency' => 'Change this currency', 'Change this feature' => 'Change this feature', 'Change this language' => 'Change this language', @@ -101,7 +111,6 @@ return array( 'Change this product feature' => 'Change this product feature', 'Change this product template' => 'Change this product template', 'Change this profile' => 'Change this profile', - 'Change this shipping configuration' => 'Change this shipping configuration', 'Change this shipping zone' => 'Change this shipping zone', 'Change this tax' => 'Change this tax', 'Change this tax rule' => 'Change this tax rule', @@ -117,14 +126,13 @@ return array( 'Close' => 'Close', 'Close administation session' => 'Close administration session', 'Code' => 'Code', - 'Code :' => 'Code :', + 'Combinable with other promotions' => 'Combinable with other promotions', 'Combination EAN Code' => 'Combination EAN Code', 'Combination builder' => 'Combination builder', 'Combination reference' => 'Combination reference', 'Company' => 'Company', - 'Condition type :' => 'Condition type :', - 'Condition\'s category :' => 'Condition\'s category :', - 'Conditions' => 'Conditions', + 'Condition category :' => 'Condition category :', + 'Condition description' => 'Condition description', 'Configuration' => 'Configuration', 'Configuration mailing system' => 'Configuration mailing system', 'Configure' => 'Configure', @@ -136,16 +144,18 @@ return array( 'Contents in %fold' => 'Contents in %fold', 'Copy source text in input field' => 'Copy source text in input field', 'Countries' => 'Countries', + 'Countries assigned to this zone' => 'Countries assigned to this zone', 'Countries that have the same tax rule' => 'Countries that have the same tax rule', 'Country' => 'Country', 'Country description' => 'Country description', 'Country short description' => 'Country short description', 'Country title' => 'Country title', 'Coupon' => 'Coupon', - 'Coupon : ' => 'Coupon : ', 'Coupon code' => 'Coupon code', + 'Coupon code * :' => 'Coupon code * :', + 'Coupon conditions' => 'Coupon conditions', + 'Coupon type * :' => 'Coupon type * :', 'Coupons' => 'Coupons', - 'Coupons : ' => 'Coupons : ', 'Create' => 'Create', 'Create a customer address' => 'Create a customer address', 'Create a new administrator' => 'Create a new administrator', @@ -166,7 +176,7 @@ return array( 'Create a new product' => 'Create a new product', 'Create a new product template' => 'Create a new product template', 'Create a new profile' => 'Create a new profile', - 'Create a new shipping configuration' => 'Create a new shipping configuration', + 'Create a new shipping zone' => 'Create a new shipping zone', 'Create a new tax' => 'Create a new tax', 'Create a new tax rule' => 'Create a new tax rule', 'Create a new variable' => 'Create a new variable', @@ -186,7 +196,7 @@ return array( 'Create this mailing template' => 'Create this mailing template', 'Create this product' => 'Create this product', 'Create this product template' => 'Create this product template', - 'Create this shipping configuration' => 'Create this shipping configuration', + 'Create this shipping zone' => 'Create this shipping zone', 'Create this value' => 'Create this value', 'Create this variable' => 'Create this variable', 'Currencies' => 'Currencies', @@ -198,6 +208,7 @@ return array( 'Current quantity' => 'Current quantity', 'Current version' => 'Current version', 'Customer' => 'Customer', + 'Customer export' => 'Customer export', 'Customer informations' => 'Customer information', 'Customers' => 'Customers', 'Customers list' => 'Customers list', @@ -232,7 +243,7 @@ return array( 'Delete mailing template' => 'Delete mailing template', 'Delete product' => 'Delete product', 'Delete profile' => 'Delete profile', - 'Delete shipping configuration' => 'Delete shipping configuration', + 'Delete shipping zone' => 'Delete shipping zone', 'Delete tax' => 'Delete tax', 'Delete tax rule' => 'Delete tax rule', 'Delete template' => 'Delete template', @@ -241,6 +252,7 @@ return array( 'Delete this attribute' => 'Delete this attribute', 'Delete this category and all its contents' => 'Delete this category and all its contents', 'Delete this combination' => 'Delete this combination', + 'Delete this condition' => 'Delete this condition', 'Delete this content' => 'Delete this content', 'Delete this country' => 'Delete this country', 'Delete this currency' => 'Delete this currency', @@ -255,7 +267,7 @@ return array( 'Delete this product feature' => 'Delete this product feature', 'Delete this product template' => 'Delete this product template', 'Delete this profile' => 'Delete this profile', - 'Delete this shipping configuration' => 'Delete this shipping configuration', + 'Delete this shipping zone' => 'Delete this shipping zone', 'Delete this tax' => 'Delete this tax', 'Delete this tax rule' => 'Delete this tax rule', 'Delete this value' => 'Delete this value', @@ -267,7 +279,7 @@ return array( 'Description' => 'Description', 'Destinations' => 'Destinations', 'Details' => 'Details', - 'Disabled coupons' => 'Disabled coupons', + 'Disabled' => 'Disabled', 'Discount' => 'Discount', 'Do not use a product template' => 'Do not use a product template', 'Do you really want to add this attribute to all product templates ?' => 'Do you really want to add this attribute to all product templates ?', @@ -279,6 +291,7 @@ return array( 'Do you really want to delete this attribute value ?' => 'Do you really want to delete this attribute value ?', 'Do you really want to delete this category and all its content ?' => 'Do you really want to delete this category and all its content ?', 'Do you really want to delete this combination ?' => 'Do you really want to delete this combination ?', + 'Do you really want to delete this condition ?' => 'Do you really want to delete this condition ?', 'Do you really want to delete this content ?' => 'Do you really want to delete this content ?', 'Do you really want to delete this country ?' => 'Do you really want to delete this country ?', 'Do you really want to delete this currency ?' => 'Do you really want to delete this currency ?', @@ -287,23 +300,23 @@ return array( 'Do you really want to delete this feature ? It will be removed from all product templates.' => 'Do you really want to delete this feature ? It will be removed from all product templates.', 'Do you really want to delete this feature value ?' => 'Do you really want to delete this feature value ?', 'Do you really want to delete this folder and all its content ?' => 'Do you really want to delete this folder and all its content ?', + 'Do you really want to delete this image ?' => 'Do you really want to delete this image ?', 'Do you really want to delete this language ?' => 'Do you really want to delete this language ?', 'Do you really want to delete this mailing template ?' => 'Do you really want to delete this mailing template ?', 'Do you really want to delete this module ?' => 'Do you really want to delete this module ?', 'Do you really want to delete this product ?' => 'Do you really want to delete this product ?', 'Do you really want to delete this profile ?' => 'Do you really want to delete this profile ?', - 'Do you really want to delete this shipping configuration ?' => 'Do you really want to delete this shipping configuration ?', + 'Do you really want to delete this shipping zone ?' => 'Do you really want to delete this shipping zone ?', 'Do you really want to delete this tax ?' => 'Do you really want to delete this tax ?', 'Do you really want to delete this tax rule ?' => 'Do you really want to delete this tax rule ?', 'Do you really want to delete this template ? It will be removed from all products.' => 'Do you really want to delete this template ? It will be removed from all products.', 'Do you really want to delete this variable ?' => 'Do you really want to delete this variable ?', - 'Do you really want to enable this element ?' => 'Do you really want to enable this element ?', 'Do you really want to remove the content from this folder ?' => 'Do you really want to remove the content from this folder ?', 'Do you really want to remove the product from this category ?' => 'Do you really want to remove the product from this category ?', 'Do you really want to remove this accessory from the product ?' => 'Do you really want to remove this accessory from the product ?', 'Do you really want to remove this attribute from all product templates ? You\'ll loose all product related data for this attribute.' => 'Do you really want to remove this attribute from all product templates ? You\'ll loose all product related data for this attribute.', 'Do you really want to remove this attribute from the template ?' => 'Do you really want to remove this attribute from the template ?', - 'Do you really want to remove this country ?' => 'Do you really want to remove this country ?', + 'Do you really want to remove this country from this shipping zone ?' => 'Do you really want to remove this country from this shipping zone ?', 'Do you really want to remove this feature from all product templates ? You\'ll loose all product related data for this feature.' => 'Do you really want to remove this feature from all product templates ? You\'ll loose all product related data for this feature.', 'Do you really want to remove this feature from the template ?' => 'Do you really want to remove this feature from the template ?', 'Do you really want to remove this related content ?' => 'Do you really want to remove this related content ?', @@ -320,10 +333,10 @@ return array( 'Drop files to upload' => 'Drop files to upload', 'Drop tax here to create a tax group' => 'Drop tax here to create a tax group', 'Drop tax here to delete from group' => 'Drop tax here to delete from group', + 'E-mail template you want to translate' => 'E-mail template you want to translate', 'E-mail templates' => 'E-mail templates', 'EAN Code' => 'EAN Code', 'Ecotax is a tax wich add a defined amount (throug a product feature) to the product price.' => 'Ecotax is a tax wich add a defined amount (throug a product feature) to the product price.', - 'Edit' => 'Edit', 'Edit a country' => 'Edit a country', 'Edit a currency' => 'Edit a currency', 'Edit a customer' => 'Edit a customer', @@ -351,6 +364,7 @@ return array( 'Edit country "%name"' => 'Edit country "%name"', 'Edit currency "%name"' => 'Edit currency "%name"', 'Edit customer %firstname %lastname' => 'Edit customer %firstname %lastname', + 'Edit customer %firstname %lastname (Ref : %ref)' => 'Edit customer %firstname %lastname (Ref : %ref)', 'Edit delivery address' => 'Edit delivery address', 'Edit document "%name"' => 'Edit document "%name"', 'Edit feature "%name"' => 'Edit feature "%name"', @@ -372,14 +386,13 @@ return array( 'Edit prices in %curr' => 'Edit prices in %curr', 'Edit product' => 'Edit product', 'Edit product %title' => 'Edit product %title', - 'Edit shipping configuration %title' => 'Edit shipping configuration %title', - 'Edit shipping zone %title' => 'Edit shipping zone %title', 'Edit tax rule taxes' => 'Edit tax rule taxes', 'Edit template "%name"' => 'Edit template "%name"', 'Edit this address' => 'Edit this address', 'Edit this category' => 'Edit this category', 'Edit this content' => 'Edit this content', 'Edit this customer' => 'Edit this customer', + 'Edit this delivery zone' => 'Edit this delivery zone', 'Edit this folder' => 'Edit this folder', 'Edit this module' => 'Edit this module', 'Edit this order' => 'Edit this order', @@ -390,25 +403,27 @@ return array( 'Editing %title' => 'Editing %title', 'Editing attribute "%name"' => 'Editing attribute "%name"', 'Editing country "%name"' => 'Editing country "%name"', + 'Editing coupon "%title"' => 'Editing coupon "%title"', 'Editing currency "%name"' => 'Editing currency "%name"', - 'Editing customer "%name"' => 'Editing customer "%name"', 'Editing document "%name"' => 'Editing document "%name"', 'Editing feature "%name"' => 'Editing feature "%name"', 'Editing image "%name"' => 'Editing image "%name"', 'Editing mailing template "%name"' => 'Editing mailing template "%name"', 'Editing module' => 'Editing module', 'Editing profile' => 'Editing profile', - 'Editing shipping configuration "%name"' => 'Editing shipping configuration "%name"', + 'Editing profile \'%name\'' => 'Editing profile \'%name\'', + 'Editing shipping configuration for module "%name"' => 'Editing shipping configuration for module "%name"', 'Editing shipping zone "%name"' => 'Editing shipping zone "%name"', 'Editing tax' => 'Editing tax', 'Editing tax rule' => 'Editing tax rule', 'Editing template "%name"' => 'Editing template "%name"', 'Editing variable "%name"' => 'Editing variable "%name"', + 'Email' => 'Email', 'Email address' => 'Email address', 'Email used when you send an email to your customers (Order confirmations, etc).' => 'Email used when you send an email to your customers (Order confirmations, etc).', 'Enable remote SMTP use : ' => 'Enable remote SMTP use : ', 'Enable/Disable' => 'Enable/Disable', - 'Enabled coupons' => 'Enabled coupons', + 'Enabled' => 'Enabled', 'Encryption' => 'Encryption', 'Encryption :' => 'Encryption :', 'Enter here all possible attribute values.' => 'Enter here all possible attribute values.', @@ -422,12 +437,15 @@ return array( 'Enter here the folder name in the default language (%title)' => 'Enter here the folder name in the default language (%title)', 'Enter here the mailing template purpose in the default language (%title)' => 'Enter here the mailing template purpose in the default language (%title)', 'Enter here the product name in the default language (%title)' => 'Enter here the product name in the default language (%title)', - 'Enter here the product price in the default currency (%title)' => 'Enter here the product price in the default currency (%title)', + 'Enter here the product price in %title' => 'Enter here the product price in %title', 'Enter here the product reference' => 'Enter here the product reference', + 'Enter here the product tax price in %title' => 'Enter here the product tax price in %title', 'Enter here the product weight, in Kilogrammes' => 'Enter here the product weight, in Kilogrammes', 'Enter here the template name in the default language (%title)' => 'Enter here the template name in the default language (%title)', 'Enter here the value in the current edit language (%language_name)' => 'Enter here the value in the current edit language (%language_name)', 'Enter here the value in the current edit language (%title)' => 'Enter here the value in the current edit language (%title)', + 'Enter here the value in the default language (%title)' => 'Enter here the value in the default language (%title)', + 'Enter information in the default language (%title)' => 'Enter information in the default language (%title)', 'Enter new accessory position' => 'Enter new accessory position', 'Enter new attribute position' => 'Enter new attribute position', 'Enter new category position' => 'Enter new category position', @@ -444,7 +462,10 @@ return array( 'Example :' => 'Example :', 'Existing combinations will be deleted. Do you want to continue ?' => 'Existing combinations will be deleted. Do you want to continue ?', 'Expiration date' => 'Expiration date', - 'Expiration date :' => 'Expiration date :', + 'Expiration date * :' => 'Expiration date * :', + 'Expired' => 'Expired', + 'Export' => 'Export', + 'Exports' => 'Exports', 'Failed to get converted prices. Please try again.' => 'Failed to get converted prices. Please try again.', 'Failed to get prices. Please try again.' => 'Failed to get prices. Please try again.', 'Fax number' => 'Fax number', @@ -457,24 +478,33 @@ return array( 'Features' => 'Features', 'File' => 'File', 'File names' => 'File names', - 'Files manager' => 'Files manager', 'First Name' => 'First Name', 'First name' => 'First name', 'First orders' => 'First orders', 'FirstName' => 'FirstName', 'Firstname' => 'Firstname', + 'Flush the Thelia internal cache' => 'Flush the Thelia internal cache', + 'Flush the assets cache directory' => 'Flush the assets cache directory', + 'Flush the images and documents cache' => 'Flush the images and documents cache', 'Folder created on %date_create. Last modification: %date_change' => 'Folder created on %date_create. Last modification: %date_change', 'Folder title' => 'Folder title', 'Folders' => 'Folders', 'Folders in %fold' => 'Folders in %fold', + 'Format: %fmt, e.g. %date' => 'Format: %fmt, e.g. %date', 'French 19.6% VAT is a tax which add a 19.6% tax to the product price.' => 'French 19.6% VAT is a tax which add a 19.6% tax to the product price.', 'French 19.6% VAT with ecotax is the applicance of the ecotax (on the product price) then the applicance of the 19.6% tax (on the product price + the ecotax amount).' => 'French 19.6% VAT with ecotax is the applicance of the ecotax (on the product price) then the applicance of the 19.6% tax (on the product price + the ecotax amount).', 'From' => 'From', + 'Front-office template you want to translate' => 'Front-office template you want to translate', 'Front-office templates' => 'Front-office templates', 'General' => 'General', 'General configuration' => 'General configuration', 'General description' => 'General description', + 'General tools' => 'General tools', 'Go to administration home' => 'Go to administration home', + 'Go to first page' => 'Go to first page', + 'Go to last page' => 'Go to last page', + 'Go to next page' => 'Go to next page', + 'Go to previous page' => 'Go to previous page', 'H:i:s' => 'H:i:s', 'HTML version of this message' => 'HTML version of this message', 'Home' => 'Home', @@ -502,12 +532,7 @@ return array( 'Invoice date' => 'Invoice date', 'Invoice informations' => 'Invoice information', 'Invoice reference' => 'Invoice reference', - 'Is available on special offers' => 'Is available on special offers', - 'Is cumulative' => 'Is cumulative', - 'Is disabled' => 'Is disabled', - 'Is enabled' => 'Is enabled', - 'Is removing postage' => 'Is removing postage', - 'Is unlimited' => 'Is unlimited', + 'Items to translate' => 'Items to translate', 'Keep the most important part of your description in the first 150-160 characters.' => 'Keep the most important part of your description in the first 150-160 characters.', 'Kg' => 'Kg', 'Label' => 'Label', @@ -524,8 +549,8 @@ return array( 'Latest version available' => 'Latest version available', 'Leave empty to keep current password' => 'Leave empty to keep current password', 'Lire la suite' => 'Lire la suite', - 'List' => 'List', 'Loading Thelia lastest news...' => 'Loading Thelia lastest news...', + 'Loading...' => 'Loading...', 'Locale' => 'Locale', 'Log lines format' => 'Log lines format', 'Log lines header format. You may use the following variables: ' => 'Log lines header format. You may use the following variables: ', @@ -538,20 +563,25 @@ return array( 'Mailing templates' => 'Mailing templates', 'Make sure it uses keywords found within the page itself.' => 'Make sure it uses keywords found within the page itself.', 'Make sure that your title is clear, and contains many of the keywords within the page itself.' => 'Make sure that your title is clear, and contains many of the keywords within the page itself.', + 'Manage attributes included in this product template' => 'Manage attributes included in this product template', + 'Manage features included in this product template' => 'Manage features included in this product template', 'Manage module rights' => 'Manage module rights', 'Manage resource rights' => 'Manage resource rights', 'Manage taxes' => 'Manage taxes', 'Manage the tax rule taxes appliance order' => 'Manage the tax rule taxes appliance order', - 'Max usage :' => 'Max usage :', - 'May be cumulative' => 'May be cumulative', + 'Maximum usage count :' => 'Maximum usage count :', 'Message created on %date_create. Last modification: %date_change' => 'Message created on %date_create. Last modification: %date_change', 'Message level' => 'Message level', 'Messages which have a level greater or equal to the selected level will be added to the log destinations. ' => 'Messages which have a level greater or equal to the selected level will be added to the log destinations. ', 'Module' => 'Module', 'Module access rights' => 'Module access rights', + 'Module component' => 'Module component', 'Module created on %date_create. Last modification: %date_change' => 'Module created on %date_create. Last modification: %date_change', + 'Module you want to translate' => 'Module you want to translate', 'Modules' => 'Modules', 'More information about ISO 4217' => 'More information about ISO 4217', + 'More pages after' => 'More pages after', + 'More pages before' => 'More pages before', 'NONE' => 'NONE', 'Name' => 'Name', 'New' => 'New', @@ -578,9 +608,8 @@ return array( 'Online' => 'Online', 'Online products' => 'Online products', 'Oops! An Error Occurred' => 'Oops! An Error Occurred', - 'Or' => 'Or', - 'Order #' => 'Order #', - 'Order %ref' => 'Order %ref', + 'Order %ref - ID %id' => 'Order %ref - ID %id', + 'Order details' => 'Order details', 'Order n°' => 'Order n°', 'Order status:' => 'Order status:', 'Ordered products' => 'Ordered products', @@ -590,6 +619,7 @@ return array( 'Originating function name ' => 'Originating function name ', 'Other addresses' => 'Other addresses', 'Overall sales' => 'Overall sales', + 'PDF template you want to translate' => 'PDF template you want to translate', 'PDF templates' => 'PDF templates', 'PDF | Invoice' => 'PDF | Invoice', 'PDF | Purchase order' => 'PDF | Purchase order', @@ -604,8 +634,8 @@ return array( 'Phone' => 'Phone', 'Phone number' => 'Phone number', 'Please retry' => 'Please retry', - 'Please save your Coupon in oder to affect it some conditions' => 'Please save your Coupon in oder to affect it some conditions', - 'Please select a condition category' => 'Please select a condition category', + 'Please save this coupon first to define coupon conditions' => 'Please save this coupon first to define coupon conditions', + 'Please select a condition' => 'Please select a condition', 'Please select a coupon type' => 'Please select a coupon type', 'Please select another condition' => 'Please select another condition', 'Please select items to translate' => 'Please select items to translate', @@ -613,6 +643,7 @@ return array( 'Please select the E-mail template to translate' => 'Please select the E-mail template to translate', 'Please select the F.O. template to translate' => 'Please select the F.O. template to translate', 'Please select the PDF template to translate' => 'Please select the PDF template to translate', + 'Please select the module component' => 'Please select the module component', 'Please select the module to translate' => 'Please select the module to translate', 'Please wait, loading' => 'Please wait, loading', 'Port' => 'Port', @@ -644,6 +675,7 @@ return array( 'Product features' => 'Product features', 'Product price' => 'Product price', 'Product price including taxes' => 'Product price including taxes', + 'Product tax price' => 'Product tax price', 'Product templates' => 'Product templates', 'Product title' => 'Product title', 'Product weight' => 'Product weight', @@ -655,6 +687,7 @@ return array( 'Profile created on %date_create. Last modification: %date_change' => 'Profile created on %date_create. Last modification: %date_change', 'Profiles' => 'Profiles', 'Promotion' => 'Promotion', + 'Provides free shipping' => 'Provides free shipping', 'Published by OpenStudio' => 'Published by OpenStudio', 'Purpose' => 'Purpose', 'Quantity' => 'Quantity', @@ -698,13 +731,15 @@ return array( 'Save changes' => 'Save changes', 'Save this address' => 'Save this address', 'Save this condition' => 'Save this condition', - 'Save your modifications' => 'Save your modifications', 'Search' => 'Search', + 'Search for \'%term\'' => 'Search for \'%term\'', 'Select a category and click (+) to add it to the additional category list' => 'Select a category and click (+) to add it to the additional category list', 'Select a category to get its products' => 'Select a category to get its products', 'Select a category...' => 'Select a category...', 'Select a content and click (+) to add it to this category' => 'Select a content and click (+) to add it to this category', 'Select a content and click (+) to add it to this product' => 'Select a content and click (+) to add it to this product', + 'Select a feature and click (+) to add it to this template' => 'Select a feature and click (+) to add it to this template', + 'Select a feature...' => 'Select a feature...', 'Select a folder and click (+) to add it to the additional folder list' => 'Select a folder and click (+) to add it to the additional folder list', 'Select a folder content...' => 'Select a folder content...', 'Select a folder to get its content' => 'Select a folder to get its content', @@ -717,23 +752,20 @@ return array( 'Select an attribute and click (+) to view available values' => 'Select an attribute and click (+) to view available values', 'Select an attribute value...' => 'Select an attribute value...', 'Select an attribute...' => 'Select an attribute...', - 'Select an feature and click (+) to add it to this template' => 'Select an feature and click (+) to add it to this template', - 'Select an feature...' => 'Select an feature...', 'Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.' => 'Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.', 'Select here the tax applicable to this product' => 'Select here the tax applicable to this product', - 'Select the E-mail template you want to translate' => 'Select the E-mail template you want to translate', - 'Select the PDF template you want to translate' => 'Select the PDF template you want to translate', - 'Select the back-office template you want to translate' => 'Select the back-office template you want to translate', - 'Select the front-office template you want to translate' => 'Select the front-office template you want to translate', - 'Select the module you want to translate' => 'Select the module you want to translate', - 'Select which items you want to translate' => 'Select which items you want to translate', 'Send a mail to this customer' => 'Send a mail to this customer', 'Send files' => 'Send files', 'Sequential number of log line' => 'Sequential number of log line', 'Set as default tax rule' => 'Set as default tax rule', 'Shipping configuration' => 'Shipping configuration', - 'Shipping configuration name' => 'Shipping configuration name', + 'Shipping configuration of delivery module "%title"' => 'Shipping configuration of delivery module "%title"', + 'Shipping zone' => 'Shipping zone', + 'Shipping zone "%title"' => 'Shipping zone "%title"', + 'Shipping zone name' => 'Shipping zone name', 'Shipping zones' => 'Shipping zones', + 'Shipping zones for this module' => 'Shipping zones for this module', + 'Shipping zones management' => 'Shipping zones management', 'Shop' => 'Shop', 'Shop Informations' => 'Shop Information', 'Short conclusion' => 'Short conclusion', @@ -803,6 +835,7 @@ return array( 'Thelia Shipping configuration' => 'Thelia Shipping configuration', 'Thelia Shipping zones' => 'Thelia Shipping zones', 'Thelia System Variables' => 'Thelia System Variables', + 'Thelia caches flushing' => 'Thelia caches flushing', 'Thelia configuration' => 'Thelia configuration', 'Thelia contributions' => 'Thelia contributions', 'Thelia core' => 'Thelia core', @@ -813,7 +846,12 @@ return array( 'Thelia product templates' => 'Thelia product templates', 'Thelia support forum' => 'Thelia support forum', 'Thelia system variables' => 'Thelia system variables', + 'Thelia tools' => 'Thelia tools', 'Thelia, the open source e-commerce solution' => 'Thelia, the open source e-commerce solution', + 'There are no shipping zones attached to this module.' => 'There are no shipping zones attached to this module.', + 'There is currently no active module here.' => 'There is currently no active module here.', + 'There is currently no available attributes.' => 'There is currently no available attributes.', + 'There is currently no available features.' => 'There is currently no available features.', 'There is no documents attached to this %type.' => 'There is no documents attached to this %type.', 'There is no images attached to this %type.' => 'There is no images attached to this %type.', 'They are some administrator which are linked to this administrator. Please edit/remove them before deleting this administrator.' => 'They are some administrator which are linked to this administrator. Please edit/remove them before deleting this administrator.', @@ -822,20 +860,24 @@ return array( 'This category doesn\'t contains any products. To add a new product, click the + button above.' => 'This category doesn\'t contains any products. To add a new product, click the + button above.', 'This category has no sub-categories.' => 'This category has no sub-categories.', 'This category has no sub-categories. To create a new one, click the + button above.' => 'This category has no sub-categories. To create a new one, click the + button above.', - 'This coupon is disabled, you can enable at the bottom of this form.' => 'This coupon is disabled, you can enable at the bottom of this form.', 'This customer has not defined any delivery address' => 'This customer has not defined any delivery address', + 'This delivery module handles all shipping zones.' => 'This delivery module handles all shipping zones.', 'This folder doesn\'t contains any contents. To add a new content, click the + button above.' => 'This folder doesn\'t contains any contents. To add a new content, click the + button above.', 'This folder has no sub-folders.' => 'This folder has no sub-folders.', 'This folder has no sub-folders. To create a new one, click the + button above.' => 'This folder has no sub-folders. To create a new one, click the + button above.', + 'This is the code entered by your customers to use this coupon' => 'This is the code entered by your customers to use this coupon', 'This is the message purpose, such as \'Order confirmation\'.' => 'This is the message purpose, such as \'Order confirmation\'.', 'This is the subject of the e-mail, such as \'Your order is confirmed\'.' => 'This is the subject of the e-mail, such as \'Your order is confirmed\'.', 'This mailing template could not be changed.' => 'This mailing template could not be changed.', + 'This module cannot be started, some files are probably missing.' => 'This module cannot be started, some files are probably missing.', 'This month' => 'This month', 'This product contains no accessories' => 'This product contains no accessories', 'This product contains no contents' => 'This product contains no contents', 'This product doesn\'t belong to any additional category.' => 'This product doesn\'t belong to any additional category.', 'This product doesn\'t belong to any additional folder.' => 'This product doesn\'t belong to any additional folder.', + 'This product has no combination. The default price is used. Click here to create a new combination.' => 'This product has no combination. The default price is used. Click here to create a new combination.', 'This product template does not contains any features' => 'This product template does not contains any features', + 'This shipping zone does not contains any country.' => 'This shipping zone does not contains any country.', 'This template contains no attributes' => 'This template contains no attributes', 'This template contains no features' => 'This template contains no features', 'This the unique name of this message. Do not change this value unless you understand what you do.' => 'This the unique name of this message. Do not change this value unless you understand what you do.', @@ -844,12 +886,14 @@ return array( 'Timeout' => 'Timeout', 'Timeout :' => 'Timeout :', 'Title' => 'Title', - 'Title :' => 'Title :', + 'Title * :' => 'Title * :', 'To' => 'To', 'To create a new content, select an existing folder, or create a new one.' => 'To create a new content, select an existing folder, or create a new one.', 'To create a new product, select an existing category, or create a new one.' => 'To create a new product, select an existing category, or create a new one.', 'To remove a value from the combination, select it and click "remove"' => 'To remove a value from the combination, select it and click "remove"', + 'To use features or attributes on this product, please select a product template. You can define product templates in the configuration section of the administration.' => 'To use features or attributes on this product, please select a product template. You can define product templates in the configuration section of the administration.', 'Today' => 'Today', + 'Tools' => 'Tools', 'Top level' => 'Top level', 'Top level Contents' => 'Top level Contents', 'Top level Products' => 'Top level Products', @@ -861,17 +905,19 @@ return array( 'Transaction reference' => 'Transaction reference', 'Translation' => 'Translation', 'Translations' => 'Translation', - 'Type :' => 'Type :', + 'Unassigned countries' => 'Unassigned countries', 'Unit taxed price' => 'Unit taxed price', 'Unit. price' => 'Unit. price', 'Unlimited' => 'Unlimited', + 'Unlimited number of uses' => 'Unlimited number of uses', 'Update' => 'Update', 'Update an administrator' => 'Update an administrator', 'Update coupon' => 'Update coupon', 'Update rates' => 'Update rates', 'Update tax rule taxes' => 'Update tax rule taxes', 'Update this image' => 'Update this image', - 'Usage left' => 'Usage left', + 'Usage count' => 'Usage count', + 'Usages left' => 'Usages left', 'Use Ctrl+click to select more than one value. You can also clear selected values.' => 'Use Ctrl+click to select more than one value. You can also clear selected values.', 'Use HTML message defined below' => 'Use HTML message defined below', 'Use Text message defined below' => 'Use Text message defined below', @@ -883,6 +929,7 @@ return array( 'Username' => 'Username', 'Username :' => 'Username :', 'Using a domain or subdomain for each language' => 'Using a domain or subdomain for each language', + 'Valid on special offers' => 'Valid on special offers', 'Value' => 'Value', 'Variable created on %date_create. Last modification: %date_change' => 'Variable created on %date_create. Last modification: %date_change', 'Variable name' => 'Variable name', @@ -890,30 +937,31 @@ return array( 'Variable value' => 'Variable value', 'Version %ver' => 'Version %ver', 'View' => 'View', - 'View only missing translations' => 'View only missing translations', + 'View only missing translations.' => 'View only missing translations.', 'View shop' => 'View shop', 'View site' => 'View site', 'Visibility' => 'Visibility', 'Warning' => 'Warning', 'Weight
(Kg)' => 'Weight
(Kg)', 'Welcome' => 'Welcome', - 'Will be available on special offers' => 'Will be available on special offers', - 'Will remove postage' => 'Will remove postage', - 'Won\'t be available on special offers' => 'Won\'t be available on special offers', - 'Won\'t remove postage' => 'Won\'t remove postage', 'Yes' => 'Yes', 'Yesterday sales' => 'Yesterday sales', 'You can attach here some content to this category' => 'You can attach here some content to this category', 'You can attach here some content to this product' => 'You can attach here some content to this product', 'You can attach this product to more categories in the details tab.' => 'You can attach this product to more categories in the details tab.', + 'You can change attributes and their positions in the attributes configuration page.' => 'You can change attributes and their positions in the attributes configuration page.', + 'You can change feature and their positions in the features configuration page.' => 'You can change feature and their positions in the features configuration page.', + 'You can change template attributes and their positions in the template configuration page.' => 'You can change template attributes and their positions in the template configuration page.', + 'You can change templates features and their positions in the template configuration page.' => 'You can change templates features and their positions in the template configuration page.', 'You can change the default category (%title) in the "General" tab.' => 'You can change the default category (%title) in the "General" tab.', 'You can change the default folder (%title) in the "General" tab.' => 'You can change the default folder (%title) in the "General" tab.', 'You can\'t delete this administrator' => 'You can\'t delete this administrator', 'You can\'t delete this profile' => 'You can\'t delete this profile', 'You don\'t need to use commas or other punctuations.' => 'You don\'t need to use commas or other punctuations.', + 'You may also quickly create combinations from products attributes using the Combination Builder.' => 'You may also quickly create combinations from products attributes using the Combination Builder.', 'Your current IP address is %ip' => 'Your current IP address is %ip', 'Zip code' => 'Zip code', - 'Zones' => 'Zones', + 'Zone name' => 'Zone name', 'activate' => 'activate', 'activate %title module' => 'activate %title module', 'activation' => 'activation', @@ -925,17 +973,18 @@ return array( 'd-m-Y' => 'd-m-Y', 'date form' => 'date form', 'date in yyyy-mm-dd format' => 'date in yyyy-mm-dd format', - 'days left' => 'days left', 'deactivate' => 'deactivate', 'deactivation' => 'deactivation', + 'delete image' => 'delete image', 'en_US' => 'en_US', 'firstname & lastname' => 'firstname & lastname', 'hour in hh:mm:ss format' => 'hour in hh:mm:ss format', 'last order' => 'last order', 'long description' => 'long description', - 'max usage' => 'max usage', + 'newsletter subscribers' => 'newsletter subscribers', 'order amount' => 'order amount', 'orders for this customer' => 'orders for this customer', + 'permanent discount' => 'permanent discount (in percent)', 'short description' => 'short description', 'tax rules' => 'tax rules', 'taxes' => 'taxes', @@ -944,5 +993,4 @@ return array( 'tracking reference' => 'tracking reference', 'uncheck all' => 'uncheck all', 'you can combine taxes in tax rules and chose if they are applied one after the other or at the same time : it allows to apply taxes on an already taxed price or not.' => 'you can combine taxes in tax rules and chose if they are applied one after the other or at the same time : it allows to apply taxes on an already taxed price or not.', - 'yyyy-mm-dd' => 'yyyy-mm-dd', ); diff --git a/templates/backOffice/default/I18n/fr_FR.php b/templates/backOffice/default/I18n/fr_FR.php index 02a5357b5..d921d7932 100755 --- a/templates/backOffice/default/I18n/fr_FR.php +++ b/templates/backOffice/default/I18n/fr_FR.php @@ -2,22 +2,27 @@ return array( ' (default)' => '(défaut)', + '%count more...' => '%count de plus...', '© Thelia 2013' => '© Thelia 2013', '(edit)' => '(modification)', 'Check the list of ISO 639-1 codes' => 'Consulter la liste des codes ISO 639-1', + 'Check the list of ISO 639-1 codes' => 'Liste des codes ISO 639-1', '0 combinations' => '0 combinaisons', - 'Congratulations, all text is now translated !' => 'Félicitations, Toute la traduction a été effectué', + 'Cannot translate all fields. According to your PHP configuration, forms cannot contains more than %current_max_input_vars input fields, but at least %required_max_input_vars are required. Please change the value of max_input_vars in your PHP configuration of change the translation file by hand.' => 'Limitation système bloquante ! Votre configuration PHP limite le nombre de champs d\'une forme HTML à %current_max_input_vars champs. Au moins %required_max_input_vars champs sont nécessaires pour effectuer les traductions. Merci de modifier en conséquence la variable max_input_vars de votre configuration PHP. Vous pouvez aussi modifier les fichiers de traduction à la main.', + 'Congratulations, all text is now translated !' => 'Félicitations, tous les textes ont été traduits !', 'Did not found any text to translate. It\'s probably normal. If not, please be sure to use Smarty\'s "intl" function in templates, or the Translator::trans() method in PHP files.' => 'Aucun texte à traduire. C\'est probablement normal. Si ce n\'est pas le cas vérifiez que vous utilisez bien la fonction Smarty "intl" ou bien le translator Translator::trans dans un fichier php', + 'Warning, some of your shipping zones are not attached to any delivery module:' => 'Attention, les zones de livraison suivantes ne sont associées à aucun module:', 'A content could be attached to more than one folder. Select here the additional folders for this content.' => 'Un contenu peut être rattaché à plusieurs dossiers. Sélectionnez ici les dossiers dans lesquels ce contenu apparaîtra', 'A product could be attached to more than one category. Select here the additional categories for this product.' => 'Un produit peut être associé à plusieurs rubriques. Sélectionner les rubrique pour lesquels le produit sera associé', 'A short description, used when a summary or an introduction is required' => 'Une courte description, utilisée lorsqu\'un résumé ou une introduction est requise', - 'A short post-description information' => 'champs d\'information complémentaire', + 'A short post-description information' => 'Champs d\'information complémentaire', 'Aborted orders' => 'Paniers abandonnés', 'Accessory title' => 'Titre de l\'accessoire', 'Action' => 'Action', 'Actions' => 'Actions', 'Activate this log destination' => 'Activer cette destination', 'Add' => 'Ajouter', + 'Add a condition' => 'Ajouter une condition', 'Add a new Customer' => 'Ajouter un client', 'Add a new address' => 'Ajouter une nouvelle adresse', 'Add a new category' => 'Ajouter une catégorie', @@ -31,29 +36,33 @@ return array( 'Add a new product' => 'Ajouter un nouveau produit', 'Add a new product attribute' => 'Ajouter une nouvelle déclinaison produit', 'Add a new product feature' => 'Ajouter une nouvelle caractéristique produit', - 'Add a new product template' => 'Ajouter un nouveau template produit', - 'Add a new shipping configuration' => 'Ajouter une nouvelle configuration de livraison', + 'Add a new product template' => 'Ajouter un nouveau gabarit de produit', + 'Add a new shipping zone' => 'Ajouter une nouvelle zone de livraison', 'Add a new variable' => 'Ajouter une nouvelle variable', 'Add tax to this group' => 'Ajouter une taxe à ce groupe', - 'Add this attribute to all product templates' => 'Ajouter cette déclinaison à tous les templates produit', + 'Add this attribute to all product templates' => 'Ajouter cette déclinaison à tous les gabarits de produit', 'Add this country' => 'Ajouter ce pays', - 'Add this feature to all product templates' => 'Ajouter cette caractéristique à tous les templates produit', - 'Add to all product templates' => 'Ajouter à tous les templates produit', + 'Add this feature to all product templates' => 'Ajouter cette caractéristique à tous les gabarits de produit', + 'Add to all product templates' => 'Ajouter à tous les gabarits de produit', 'Additional Folders' => 'Dossiers associés', 'Additional address' => 'Adresse complémentaire', 'Additional categories' => 'Rubriques supplémentaires', 'Address' => 'Adresse', 'Administration logs' => 'Journal des logs', - 'Administration profiles' => 'Gestion des administrateurs', + 'Administration profiles' => 'Profils d\'administration', 'Administrators' => 'Administrateurs', + 'Advanced configuration' => 'Configuration avancée', + 'Advanced configuration and tools' => 'Outils et configuration avancés', + 'Afficher ce profil' => 'Afficher ce profil', + 'All countries are assigned to a shipping zone.' => 'Tous les pays sont assignés à une zone de livraison.', 'All orders' => 'Toutes les commandes', 'Alpha code 2' => 'Code alpha 2', 'Alpha code 3' => 'Code alpha 3', 'Amount' => 'Montant', 'An error occured' => 'Une erreur est survenue', 'And' => 'Et', - 'Application field' => 'Champs d\'application', 'Apply' => 'Appliquer', + 'Associated countries' => 'Pays dans la zone', 'Associations' => 'Associations', 'Attribute' => 'Déclinaison', 'Attribute Combinations' => 'Combinaison de déclinaisons', @@ -68,13 +77,12 @@ return array( 'Average cart' => 'Panier moyen', 'Back' => 'Retour', 'Back-office home' => 'Accueil administration', - 'Back-office templates' => 'templates Back-office', + 'Back-office template you want to translate' => 'Template back-office à traduire', + 'Back-office templates' => 'Templates Back-office', 'Back-office users' => 'Utilisateur du B.O', - 'Browse' => 'Parcourir', 'Browse files' => 'Parcourir les fichiers', 'Browse this category' => 'Parcourir cette catégorie', 'Browse this folder' => 'Parcourir ce dossier', - 'Can\'t be cumulative' => 'Ne peut pas se cumuler', 'Can\'t load documents, please refresh this page.' => 'Impossible de charger les documents. Rechargez la page', 'Can\'t load images, please refresh this page.' => 'Impossible de charger l\'image. Rechargez la page', 'Can\'t reorder documents, please refresh this page.' => 'Impossible de trier les documents. Rechargez la page', @@ -88,28 +96,29 @@ return array( 'Categories in %cat' => 'Rubrique dans %cat', 'Category created on %date_create. Last modification: %date_change' => 'Rubrique créée le %date_create. Dernière modification le %date_change', 'Category title' => 'Titre de la rubrique', - 'Cellular phone' => 'téléphone portable', + 'Cellular phone' => 'Téléphone portable', 'Cellular phone number' => 'Numéro de portable', 'Change this administrator' => 'Modifier cet administrateur', 'Change this attribute' => 'Modifier cette déclinaison', + 'Change this condition' => 'Modifier cette condition', 'Change this country' => 'Modifier ce pays', + 'Change this coupon' => 'Modifier ce code promo', 'Change this currency' => 'Modifier cette devise', 'Change this feature' => 'Modifier cette caractéristique', 'Change this language' => 'Modifier cette langue', 'Change this mailing template' => 'Modifier ce template de mailing', 'Change this product attribute' => 'Modifier cette déclinaison produit', 'Change this product feature' => 'Modifier cette caractéristique produit', - 'Change this product template' => 'Modifier ce template produit', + 'Change this product template' => 'Modifier ce gabarit de produit', 'Change this profile' => 'Changer ce profil', - 'Change this shipping configuration' => 'Modifier cette configuration de livraison', 'Change this shipping zone' => 'Modifier cette zone de livraison', 'Change this tax' => 'Modifier cette taxe', 'Change this tax rule' => 'Modifier cette règle de taxe', - 'Change this template' => 'Modifier ce template', + 'Change this template' => 'Modifier ce gabarit', 'Change this variable' => 'Modifier cette variable', 'Chapo' => 'Chapeau', - 'Check this box if you want to add this attributes to all product templates' => 'Cochez cette case si vous voulez ajouter cette déclinaison à tous les templates produits', - 'Check this box if you want to add this features to all product templates' => 'Cochez cette case si voulez ajouter cette caractéristique à tous les templates produit.', + 'Check this box if you want to add this attributes to all product templates' => 'Cochez cette case si vous voulez ajouter cette déclinaison à tous les gabarits de produits', + 'Check this box if you want to add this features to all product templates' => 'Cochez cette case si voulez ajouter cette caractéristique à tous les gabarits de produit.', 'Choose a country' => 'Choisissez un pays', 'City' => 'Ville', 'Classic modules' => 'Modules classic', @@ -117,14 +126,13 @@ return array( 'Close' => 'Fermer', 'Close administation session' => 'Quitter l\'interface d\'administration', 'Code' => 'Code', - 'Code :' => 'Code : ', + 'Combinable with other promotions' => 'Cumulable avec d\'autres promotions', 'Combination EAN Code' => 'Combinaison de code EAN', - 'Combination builder' => 'générateur de combinaison', + 'Combination builder' => 'Générateur de combinaison', 'Combination reference' => 'Référence de la combinaison', 'Company' => 'Entreprise', - 'Condition type :' => 'Type de condition', - 'Condition\'s category :' => 'Rubrique de la condition', - 'Conditions' => 'Conditions', + 'Condition category :' => 'Catégorie de condition', + 'Condition description' => 'Type de condition', 'Configuration' => 'Configuration', 'Configuration mailing system' => 'Configuration du système de mailing', 'Configure' => 'Configurer', @@ -136,16 +144,18 @@ return array( 'Contents in %fold' => 'Contenus dans %fold', 'Copy source text in input field' => 'Copier la source dans le champs de traduction', 'Countries' => 'Pays', + 'Countries assigned to this zone' => 'Pays inclus dans cette zone', 'Countries that have the same tax rule' => 'Pays qui ont les même règles de taxe', 'Country' => 'Pays', 'Country description' => 'Description du pays', 'Country short description' => 'Courte description du pays', 'Country title' => 'Titre du pays', 'Coupon' => 'Code promo', - 'Coupon : ' => 'Code promo :', 'Coupon code' => 'Code promo', - 'Coupons' => 'Codes Promo', - 'Coupons : ' => 'Codes promo : ', + 'Coupon code * :' => 'Code promo * :', + 'Coupon conditions' => 'Conditions d\'utilisation', + 'Coupon type * :' => 'Type de promotion * :', + 'Coupons' => 'Codes promo', 'Create' => 'Créer', 'Create a customer address' => 'Créer une adresse', 'Create a new administrator' => 'Créer un nouvel administrateur', @@ -164,9 +174,9 @@ return array( 'Create a new language' => 'Créer une nouvelle langue', 'Create a new mailing template' => 'Créer un nouveau template de mailing', 'Create a new product' => 'Créer un nouveau produit', - 'Create a new product template' => 'Créer un nouveau template produit', + 'Create a new product template' => 'Créer un nouveau gabarit de produit', 'Create a new profile' => 'Créer un nouveau profil', - 'Create a new shipping configuration' => 'Créer une nouvelle configuration de livraison', + 'Create a new shipping zone' => 'Créer une nouvelle zone de livraison', 'Create a new tax' => 'Créer une nouvelle taxe', 'Create a new tax rule' => 'Créer une nouvelle règle de taxe', 'Create a new variable' => 'Créer une nouvelle variable', @@ -185,8 +195,8 @@ return array( 'Create this language' => 'Créer cette langue', 'Create this mailing template' => 'Créer ce template de mailing', 'Create this product' => 'Créer ce produit', - 'Create this product template' => 'Créer ce template produit', - 'Create this shipping configuration' => 'Créer cette nouvelle configuration de livraison', + 'Create this product template' => 'Créer ce gabarit de produit', + 'Create this shipping zone' => 'Créer cette zone de livraison', 'Create this value' => 'Créer cette valeur', 'Create this variable' => 'Ajouter cette variable', 'Currencies' => 'Devises', @@ -198,6 +208,7 @@ return array( 'Current quantity' => 'Quantité actuelle', 'Current version' => 'Version en cours', 'Customer' => 'Client', + 'Customer export' => 'Export client', 'Customer informations' => 'Informations client', 'Customers' => 'Clients', 'Customers list' => 'Liste des clients', @@ -232,15 +243,16 @@ return array( 'Delete mailing template' => 'Supprimer ce template de mailing', 'Delete product' => 'Supprimer ce produit', 'Delete profile' => 'Supprimer le profil', - 'Delete shipping configuration' => 'Supprimer cette configuration de livraison', + 'Delete shipping zone' => 'Supprimer une zone de livraison', 'Delete tax' => 'Supprimer la taxe', 'Delete tax rule' => 'Supprimer cette règle de taxe', - 'Delete template' => 'Supprimer ce template produit', + 'Delete template' => 'Supprimer ce gabarit de produit', 'Delete this accessory' => 'Supprimer cet accessoire', 'Delete this administrator' => 'Supprimer cet administrateur', - 'Delete this attribute' => 'supprimer cette déclinaison', + 'Delete this attribute' => 'Supprimer cette déclinaison', 'Delete this category and all its contents' => 'Supprimer cette rubrique et tout ce qu\'elle contient ?', 'Delete this combination' => 'Supprimer cette combinaison', + 'Delete this condition' => 'Supprimer cette condition', 'Delete this content' => 'Supprimer ce contenu', 'Delete this country' => 'Supprimer ce pays', 'Delete this currency' => 'Supprimer cette devise', @@ -253,9 +265,9 @@ return array( 'Delete this product' => 'Supprimer ce produit', 'Delete this product attribute' => 'Supprimer cette déclinaison produit', 'Delete this product feature' => 'Supprimer cette caractéristique produit', - 'Delete this product template' => 'Supprimer ce template produit', + 'Delete this product template' => 'Supprimer ce gabarit de produit', 'Delete this profile' => 'Supprimer ce profil', - 'Delete this shipping configuration' => 'Supprimer cette configuration de livraison', + 'Delete this shipping zone' => 'Supprimer cette zone de livraison', 'Delete this tax' => 'Supprimer cette taxe', 'Delete this tax rule' => 'Supprimer cette règle de taxe', 'Delete this value' => 'Supprimer cette valeur', @@ -267,45 +279,46 @@ return array( 'Description' => 'Description', 'Destinations' => 'Destinations', 'Details' => 'Détails', - 'Disabled coupons' => 'Codes promo désactivés', + 'Disabled' => 'Désactivé', 'Discount' => 'Remise', 'Do not use a product template' => 'Ne pas utiliser de gabarit', - 'Do you really want to add this attribute to all product templates ?' => 'Voulez-vous vraiment ajouter cette déclinaison de tous les templates produit ?', - 'Do you really want to add this feature to all product templates ?' => 'Voulez-vous vraiment ajouter cette caractéristique à tous les templates produit ?', + 'Do you really want to add this attribute to all product templates ?' => 'Voulez-vous vraiment ajouter cette déclinaison de tous les gabarits de produit ?', + 'Do you really want to add this feature to all product templates ?' => 'Voulez-vous vraiment ajouter cette caractéristique à tous les gabarits de produit ?', 'Do you really want to cancel this order ?' => 'Voulez-vous vraiment supprimer cette commande ?', 'Do you really want to delete this address ?' => 'Voulez-vous vraiment supprimer cette adresse ?', 'Do you really want to delete this administrator ?' => 'Confirmez-vous la suppression de cet administrateur ?', - 'Do you really want to delete this attribute ? It will be removed from all product templates.' => 'Voulez-vous vraiment supprimer cette déclinaison ? Elle sera supprimée de tous les templates produit.', + 'Do you really want to delete this attribute ? It will be removed from all product templates.' => 'Voulez-vous vraiment supprimer cette déclinaison ? Elle sera supprimée de tous les gabarits de produit.', 'Do you really want to delete this attribute value ?' => 'Voulez-vous vraiment supprimer cette déclinaison ?', 'Do you really want to delete this category and all its content ?' => 'Voulez-vous vraiment supprimer cette rubrique et tout ce qu\'elle contient ?', 'Do you really want to delete this combination ?' => 'Voulez-vous vraiment supprimer cette combinaison ?', + 'Do you really want to delete this condition ?' => 'Supprimer cette condition ?', 'Do you really want to delete this content ?' => 'Voulez-vous vraiment supprimer ce contenu ?', 'Do you really want to delete this country ?' => 'Voulez-vous vraiment supprimer ce pays ?', 'Do you really want to delete this currency ?' => 'Voulez-vous vraiment supprimer cette devise ?', 'Do you really want to delete this customer ?' => 'Voulez-vous supprimer ce client ?', 'Do you really want to delete this element ?' => 'Voulez-vous vraiment supprimer cet élément ?', - 'Do you really want to delete this feature ? It will be removed from all product templates.' => 'Voulez-vous vraiment supprimer cette caractéristique ? Elle sera supprimée de tous les templates produit', + 'Do you really want to delete this feature ? It will be removed from all product templates.' => 'Voulez-vous vraiment supprimer cette caractéristique ? Elle sera supprimée de tous les gabarits de produit', 'Do you really want to delete this feature value ?' => 'Voulez-vous vraiment supprimer cette valeur de caractéristique ?', 'Do you really want to delete this folder and all its content ?' => 'Voulez-vous vraiment supprimer ce dossier et tous ses contenus ?', + 'Do you really want to delete this image ?' => 'Confirmez-vous la suppression de cette image ?', 'Do you really want to delete this language ?' => 'Voulez-vous vraiment supprimer cette langue ?', 'Do you really want to delete this mailing template ?' => 'Voulez-vous vraiment supprimer ce template de mailing ?', 'Do you really want to delete this module ?' => 'Voulez-vous vraiment supprimer ce module ?', 'Do you really want to delete this product ?' => 'Voulez-vous vraiment supprimer ce produit ?', 'Do you really want to delete this profile ?' => 'Voulez-vous vraiment supprimer ce profil ?', - 'Do you really want to delete this shipping configuration ?' => 'Voulez-vous vraiment supprimer cette configuration de livraison ?', + 'Do you really want to delete this shipping zone ?' => 'Confirmez vous la suppression de cette zone de livraison ?', 'Do you really want to delete this tax ?' => 'Voulez-vous vraiment supprimer cette taxe ?', 'Do you really want to delete this tax rule ?' => 'Voulez-vous vraiment supprimer cette règle de taxe ?', - 'Do you really want to delete this template ? It will be removed from all products.' => 'Voulez-vous vraiment supprimer ce template ? Il sera supprimé de tous les produits.', + 'Do you really want to delete this template ? It will be removed from all products.' => 'Voulez-vous vraiment supprimer ce gabarit ? Il sera supprimé de tous les produits.', 'Do you really want to delete this variable ?' => 'Voulez-vous vraiment supprimer cette variable ?', - 'Do you really want to enable this element ?' => 'Voulez-vous vraiment activer cet élément ?', 'Do you really want to remove the content from this folder ?' => 'Voulez-vous vraiment enlever le contenu de ce dossier ?', 'Do you really want to remove the product from this category ?' => 'êtes-vous sur de vouloir enlever le produit de cette rubrique', 'Do you really want to remove this accessory from the product ?' => 'êtes-vous sur de vouloir supprimer cet accessoire ?', - 'Do you really want to remove this attribute from all product templates ? You\'ll loose all product related data for this attribute.' => 'Voulez-vous vraiment supprimer cette déclinaison de tous les templates produits ? Vous allez perdre toutes les informations produit liées à cette déclinaison.', - 'Do you really want to remove this attribute from the template ?' => 'êtes-vous sur de vouloir retirer cette déclinaison de ce template', - 'Do you really want to remove this country ?' => 'Voulez-vous vraiment enlever ce pays ?', - 'Do you really want to remove this feature from all product templates ? You\'ll loose all product related data for this feature.' => 'Voulez-vous vraiment enlever cette caractéristique de tous les templates produit ? Vous allez perdre toutes les informations des produits liées à cette caractéristique.', - 'Do you really want to remove this feature from the template ?' => 'Voulez-vous vraiment supprimer cette caractéristique de ce template ?', + 'Do you really want to remove this attribute from all product templates ? You\'ll loose all product related data for this attribute.' => 'Voulez-vous vraiment supprimer cette déclinaison de tous les gabarits de produits ? Vous allez perdre toutes les informations produit liées à cette déclinaison.', + 'Do you really want to remove this attribute from the template ?' => 'Etes-vous sur de vouloir retirer cette déclinaison de ce gabarit ?', + 'Do you really want to remove this country from this shipping zone ?' => 'Voulez-vous retirer ce pays de la zone de livraison ?', + 'Do you really want to remove this feature from all product templates ? You\'ll loose all product related data for this feature.' => 'Voulez-vous vraiment enlever cette caractéristique de tous les gabarits de produit ? Vous allez perdre toutes les informations des produits liées à cette caractéristique.', + 'Do you really want to remove this feature from the template ?' => 'Voulez-vous vraiment supprimer cette caractéristique de ce gabarit ?', 'Do you really want to remove this related content ?' => 'Voulez-vous vraiment supprimer ce contenu lié ?', 'Do you really want to remove this related content from the product ?' => 'êtes-vous sur de vouloir supprimer ce contenu associé ?', 'Do you really want to remove this zone ?' => 'Voulez-vous vraiment supprimer cette zone ?', @@ -320,10 +333,10 @@ return array( 'Drop files to upload' => 'Déposez des fichiers à envoyer', 'Drop tax here to create a tax group' => 'Déposer une taxe ici afin de créer un groupe de taxe', 'Drop tax here to delete from group' => 'Déposer une taxe ici afin de la supprimer du groupe', - 'E-mail templates' => 'templates E-mail', + 'E-mail template you want to translate' => 'Template e-mail à traduire', + 'E-mail templates' => 'Templates E-mail', 'EAN Code' => 'Code EAN', 'Ecotax is a tax wich add a defined amount (throug a product feature) to the product price.' => 'L\'écotaxe est une taxe qui ajoute un montant défini (grâce à une caractéristique produit) au prix du produit.', - 'Edit' => 'Editer', 'Edit a country' => 'Modifier un pays', 'Edit a currency' => 'Modifier une devise', 'Edit a customer' => 'Éditer un client', @@ -339,7 +352,7 @@ return array( 'Edit a system variable' => 'Modifier une variable système', 'Edit a tax' => 'Modifier une taxe', 'Edit a tax rule' => 'Modifier une règle de taxe', - 'Edit a template' => 'Modifier un template', + 'Edit a template' => 'Modifier un gabarit', 'Edit an attribute' => 'Modifier une déclinaison', 'Edit an image' => 'Modifier une image', 'Edit an order' => 'Editer une commande', @@ -351,9 +364,10 @@ return array( 'Edit country "%name"' => 'Modifier le pays "%name"', 'Edit currency "%name"' => 'Modifier la devise "%name"', 'Edit customer %firstname %lastname' => 'Modification du client %firstname %lastname ', + 'Edit customer %firstname %lastname (Ref : %ref)' => 'Modification du client %firstname %lastname (Ref : %ref) ', 'Edit delivery address' => 'Editer l\'adresse de livraison', 'Edit document "%name"' => 'Modifier le document "%name"', - 'Edit feature "%name"' => 'modifier la caractéristique "%name"', + 'Edit feature "%name"' => 'Modifier la caractéristique "%name"', 'Edit folder' => 'Modifier le dossier', 'Edit folder %title' => 'Modifier le dossier %title', 'Edit image "%name"' => 'Modifier l\'image "%name"', @@ -372,14 +386,13 @@ return array( 'Edit prices in %curr' => 'Modifier les prix en %curr', 'Edit product' => 'Modifier le produit', 'Edit product %title' => 'Modifier le produit %title', - 'Edit shipping configuration %title' => 'Modifier la configuration de livraison %title', - 'Edit shipping zone %title' => 'Modifier la zone de livraison %title', 'Edit tax rule taxes' => 'Modifier les taxes de la règle de taxe', - 'Edit template "%name"' => 'Modifier le template "%name"', + 'Edit template "%name"' => 'Modifier le gabarit "%name"', 'Edit this address' => 'Editer cette adresse', 'Edit this category' => 'Editer cette rubrique', 'Edit this content' => 'Modifier ce contenu', 'Edit this customer' => 'Modifier ce client', + 'Edit this delivery zone' => 'Modifier cette zone de livraison', 'Edit this folder' => 'Modifier ce dossier', 'Edit this module' => 'Modifier ce module', 'Edit this order' => 'Editer cette commande', @@ -390,25 +403,27 @@ return array( 'Editing %title' => 'En cours de modification de %title', 'Editing attribute "%name"' => 'En cours de modification de la déclinaison "%name"', 'Editing country "%name"' => 'En cours de modification du pays "%name"', + 'Editing coupon "%title"' => 'Edition du code promo "%title" ', 'Editing currency "%name"' => 'En cours de modification de la devise "%name"', - 'Editing customer "%name"' => 'Edition du client "%name"', 'Editing document "%name"' => 'Modification du document "%name"', 'Editing feature "%name"' => 'En cours de modification de la caractéristique "%name"', 'Editing image "%name"' => 'Modification de l\'image "%name"', 'Editing mailing template "%name"' => 'En cours de modification du template de mailing "%name"', 'Editing module' => 'Module en cours de modification', 'Editing profile' => 'Modification du profil', - 'Editing shipping configuration "%name"' => 'En cours de modification de la configuration de livraison "%name"', - 'Editing shipping zone "%name"' => 'En cours de modification de la zone de livraison "%name"', + 'Editing profile \'%name\'' => 'Edition du profil \'%name\' ', + 'Editing shipping configuration for module "%name"' => 'Configuration des zones de livraison du module "%title" ', + 'Editing shipping zone "%name"' => 'Modification de la zone de livraison "%name"', 'Editing tax' => 'En cours de modification de la taxe', 'Editing tax rule' => 'En cours de modification de la règle de taxe', - 'Editing template "%name"' => 'Modification du template "%name"', + 'Editing template "%name"' => 'Modification du gabarit "%name"', 'Editing variable "%name"' => 'Modification de la variable "%name" ', + 'Email' => 'Email', 'Email address' => 'Adresse e-mail', - 'Email used when you send an email to your customers (Order confirmations, etc).' => 'adresse email utilisé pour envoyer les mails à vos clients', + 'Email used when you send an email to your customers (Order confirmations, etc).' => 'Adresse email utilisé pour envoyer les mails à vos clients', 'Enable remote SMTP use : ' => 'Activer l\'utilisation d\'un serveur SMTP distant:', 'Enable/Disable' => 'Activer/Désactiver', - 'Enabled coupons' => 'Codes promo disponibles', + 'Enabled' => 'Activé', 'Encryption' => 'Chiffrement', 'Encryption :' => 'Chiffrement :', 'Enter here all possible attribute values.' => 'Entrez ici toutes les valeurs de déclinaison possible.', @@ -420,13 +435,17 @@ return array( 'Enter here the feature name in the default language (%title)' => 'Renseigner le nom de la caractéristique dans la langue par défaut (%title)', 'Enter here the feature value as free text' => 'Indiquez ici la valeur de la caractéristique', 'Enter here the folder name in the default language (%title)' => 'Entrez ici le nom du dossier dans la langue par défaut (%title)', + 'Enter here the mailing template purpose in the default language (%title)' => 'Renseigner l\'objet du mail dans la langue par défaut (%title)', 'Enter here the product name in the default language (%title)' => 'Entrez ici le nom du produit dans la langue par défaut (%title)', - 'Enter here the product price in the default currency (%title)' => 'entrez ici le prix du produit dans la langue par défaut (%title)', + 'Enter here the product price in %title' => 'Indiquez ici le prix HT en %title ', 'Enter here the product reference' => 'Entrez ici la nouvelle référence produit', + 'Enter here the product tax price in %title' => 'Indiquez ici le prix TTC en %title ', 'Enter here the product weight, in Kilogrammes' => 'Entrez ici le poids du produit, en Kilogrammes', - 'Enter here the template name in the default language (%title)' => 'Renseignez le nom du template dans la langue par défaut (%title)', + 'Enter here the template name in the default language (%title)' => 'Renseignez le nom du gabarit dans la langue par défaut (%title)', 'Enter here the value in the current edit language (%language_name)' => 'Rensignez la valeur dans la langue d\'édition actuelle (%language_name)', 'Enter here the value in the current edit language (%title)' => 'Entrez la valeur dans la langue d\'édition courante (%title)', + 'Enter here the value in the default language (%title)' => 'Indiquez la valeur pour la langue par défaut (%title) ', + 'Enter information in the default language (%title)' => 'Entrez les informations dans la langue par défaut (%title) ', 'Enter new accessory position' => 'Renseigner la nouvelle position pour cet accessoire', 'Enter new attribute position' => 'Modifier la position de la déclinaison', 'Enter new category position' => 'Classement de la catégorie', @@ -443,7 +462,10 @@ return array( 'Example :' => 'Exemple :', 'Existing combinations will be deleted. Do you want to continue ?' => 'Les combinaisons existantes seront supprimées. Voulez-vous continuer ?', 'Expiration date' => 'Date de fin de validité', - 'Expiration date :' => 'Date de fin de validité : ', + 'Expiration date * :' => 'Date d\'expiration * :', + 'Expired' => 'Expiré', + 'Export' => 'Export', + 'Exports' => 'Exports', 'Failed to get converted prices. Please try again.' => 'Erreur lors de la récupération des prix convertis. Veuillez réessayer.', 'Failed to get prices. Please try again.' => 'Erreur lors de la récupération des prix. Veuillez réessayer.', 'Fax number' => 'Numéro de fax', @@ -456,24 +478,33 @@ return array( 'Features' => 'Caractéristiques', 'File' => 'Fichier', 'File names' => 'Nom du fichier', - 'Files manager' => 'Gestionnaire de fichiers', 'First Name' => 'Prénom', 'First name' => 'Prénom', 'First orders' => 'Premières commandes', 'FirstName' => 'Prénom', 'Firstname' => 'Prénom', + 'Flush the Thelia internal cache' => 'Vider le cache interne de Thelia', + 'Flush the assets cache directory' => 'Vider le cache des assets web', + 'Flush the images and documents cache' => 'Vider le caches des images et documents', 'Folder created on %date_create. Last modification: %date_change' => 'Dossier créé le %date_create. Dernière modification le %date_change', 'Folder title' => 'Titre du dossier', 'Folders' => 'Dossiers', 'Folders in %fold' => 'Dossier dans %fold', + 'Format: %fmt, e.g. %date' => 'Format: %fmt, ex. %date ', 'French 19.6% VAT is a tax which add a 19.6% tax to the product price.' => 'La TVA française de 20% est une taxe qui ajoute 20% au prix du produit.', 'French 19.6% VAT with ecotax is the applicance of the ecotax (on the product price) then the applicance of the 19.6% tax (on the product price + the ecotax amount).' => 'La TVA française de 20% avec écotaxe est l\'application de l\'écotaxe (sur le prix du produit) puis l\'application de la taxe de20% (sur le prix du produit + le montant écotaxe).', 'From' => 'De', - 'Front-office templates' => 'templates Front-office', + 'Front-office template you want to translate' => 'Template front-office à traduire', + 'Front-office templates' => 'Templates Front-office', 'General' => 'Général', 'General configuration' => 'Configuration générale', 'General description' => 'Description générale', + 'General tools' => 'outils généraux', 'Go to administration home' => 'Aller à l\'accueil de l\'interface d\'administration', + 'Go to first page' => 'Aller à la première page', + 'Go to last page' => 'Aller à la dernière page', + 'Go to next page' => 'Aller à la page suivante', + 'Go to previous page' => 'Aller à la page précédente', 'H:i:s' => 'H:i:s', 'HTML version of this message' => 'Version HTML du message', 'Home' => 'Accueil', @@ -501,12 +532,7 @@ return array( 'Invoice date' => 'Date de facturation', 'Invoice informations' => 'Informations de facturation', 'Invoice reference' => 'Facture ref', - 'Is available on special offers' => 'Est valide sur les offres promotionnelles', - 'Is cumulative' => 'Est cumulable', - 'Is disabled' => 'désactivé', - 'Is enabled' => 'Est activé', - 'Is removing postage' => 'Offre les frais de port', - 'Is unlimited' => 'Est illimité', + 'Items to translate' => 'Elément à traduire', 'Keep the most important part of your description in the first 150-160 characters.' => 'Votre description ne devrait pas dépasser 150 à 160 caractères', 'Kg' => 'Kg', 'Label' => 'Libellé', @@ -523,8 +549,8 @@ return array( 'Latest version available' => 'Dernière version disponible', 'Leave empty to keep current password' => 'Laisser ce champ vide pour ne pas modifier le mot de passe', 'Lire la suite' => 'Lire la suite', - 'List' => 'Liste', 'Loading Thelia lastest news...' => 'Chargement des dernières information Thelia...', + 'Loading...' => 'Chargement...', 'Locale' => 'Paramètre régional', 'Log lines format' => 'Format d\'une ligne de log', 'Log lines header format. You may use the following variables: ' => 'Format d\'une ligne de log. Vous pouvez utiliser ces variables : ', @@ -533,24 +559,29 @@ return array( 'Long description :' => 'Description longue', 'Mailing system' => 'Envoi des e-mails', 'Mailing template name' => 'Nom du template de mailing', - 'Mailing template purpose' => 'Objectif du template de mailing', + 'Mailing template purpose' => 'Role du template de mailing', 'Mailing templates' => 'Template e-mail', 'Make sure it uses keywords found within the page itself.' => 'Assurez vous d\'utiliser des mots-clés présents dans la page courante', 'Make sure that your title is clear, and contains many of the keywords within the page itself.' => 'Assurez-vous d\'avoir un titre clair et qui contient les mots-clés correspondant à la page en cours', + 'Manage attributes included in this product template' => 'Gestion des déclinaisons présentes dans ce gabarit de produit', + 'Manage features included in this product template' => 'Gestion des caractéristiques présentes dans ce gabarit de produit', 'Manage module rights' => 'Gestion des droits pour les modules', 'Manage resource rights' => 'Gestion de droits pour les ressources', 'Manage taxes' => 'Gérer les taxes', 'Manage the tax rule taxes appliance order' => 'Gérer les règles de taxe et leur ordre d\'application', - 'Max usage :' => 'Utilisations max : ', - 'May be cumulative' => 'Peut être cumulé', + 'Maximum usage count :' => 'Nombre maximum d\'utilisations', 'Message created on %date_create. Last modification: %date_change' => 'Message créé le %date_create. Dernière modification le %date_change', 'Message level' => 'Message level', 'Messages which have a level greater or equal to the selected level will be added to the log destinations. ' => 'Les messages avec un niveau d\'erreur supérieur ou égal à celui sélectionné seront rajoutés dans les logs', 'Module' => 'Module', 'Module access rights' => 'Droits d\'accès pour les modules', + 'Module component' => 'Composant du module', 'Module created on %date_create. Last modification: %date_change' => 'Module crée le %date_create. Dernière modification le %date_change', + 'Module you want to translate' => 'Module à traduire', 'Modules' => 'Modules', 'More information about ISO 4217' => 'Plus d\'information à propos de l\'ISO 4217', + 'More pages after' => 'Pages suivantes', + 'More pages before' => 'Pages précédentes', 'NONE' => 'AUCUN', 'Name' => 'Nom', 'New' => 'Nouveau', @@ -569,7 +600,7 @@ return array( 'No mailing template has been created yet. Click the + button to create one.' => 'Aucun template de mailing n\'a encore été créé. Cliquez sur le bouton + pour en ajouter un.', 'No product attribute has been created yet. Click the + button to create one.' => 'Aucune déclinaison produit n\'a encore été créée. Cliquez sur le bouton + pour en créer une.', 'No product feature has been created yet. Click the + button to create one.' => 'Aucune caractéristique produit n\'a encore été ajoutée. Cliquez sur le bouton + pour en créer une.', - 'No product template has been created yet. Click the + button to create one.' => 'Aucun template produit n\'a encore été créé. Cliquez sur le bouton + pour en créer une.', + 'No product template has been created yet. Click the + button to create one.' => 'Aucun gabarit de produit n\'a encore été créé. Cliquez sur le bouton + pour en créer une.', 'No value has been created yet. Click the + button to create one.' => 'Aucune valeur n\'a encore été crée. Cliquez sur le bouton + pour en créer une.', 'N° ISO' => 'N° ISO', 'OK' => 'OK', @@ -577,9 +608,8 @@ return array( 'Online' => 'En ligne', 'Online products' => 'Produits en ligne', 'Oops! An Error Occurred' => 'Oops ! Une erreur est survenue', - 'Or' => 'Ou', - 'Order #' => 'Commande #', - 'Order %ref' => 'Commande %ref', + 'Order %ref - ID %id' => 'Commande %ref - ID %id ', + 'Order details' => 'Détail de la commande', 'Order n°' => 'Commande n°', 'Order status:' => 'Statut de la commande : ', 'Ordered products' => 'Produits commandés', @@ -589,7 +619,8 @@ return array( 'Originating function name ' => 'Originating function name ', 'Other addresses' => 'Autres adresses', 'Overall sales' => 'Total des ventes', - 'PDF templates' => 'templates PDF', + 'PDF template you want to translate' => 'Template PDF à traduire', + 'PDF templates' => 'Templates PDF', 'PDF | Invoice' => 'Facture PDF', 'PDF | Purchase order' => 'Bon de commande PDF', 'Page not found' => 'Page non trouvée', @@ -603,15 +634,16 @@ return array( 'Phone' => 'Téléphone', 'Phone number' => 'Numéro de téléphone', 'Please retry' => 'Merci de réessayer', - 'Please save your Coupon in oder to affect it some conditions' => 'Veuillez sauvegarder votre code promo afin de pouvoir lui affecter des conditions', - 'Please select a condition category' => 'Merci d\'entrer le type de condition', + 'Please save this coupon first to define coupon conditions' => 'Enregistrez ce nouveau code promo pour définir les conditions d\'utilisation', + 'Please select a condition' => 'Choisissez une condition', 'Please select a coupon type' => 'Merci d\'entrer le type de code', 'Please select another condition' => 'Merci de sélectionner une autre condition', 'Please select items to translate' => 'Veuillez sélectionner un élément', - 'Please select the B.O. template to translate' => 'Sélectionnez le template back-office que vous souhaitez traduire', + 'Please select the B.O. template to translate' => 'Sélectionnez le template back-office à traduire', 'Please select the E-mail template to translate' => 'Sélectionnez le template de mail à traduire', - 'Please select the F.O. template to translate' => 'Sélectionnez le template front-office que vous souhaitez traduire', + 'Please select the F.O. template to translate' => 'Sélectionnez le template front-office à traduire', 'Please select the PDF template to translate' => 'Sélectionnez le template PDF à traduire', + 'Please select the module component' => 'Choisissez un composant du module', 'Please select the module to translate' => 'Sélectionnez le module à traduire', 'Please wait, loading' => 'Chargement, veuillez patienter', 'Port' => 'Port', @@ -631,7 +663,7 @@ return array( 'Price incl. taxes' => 'Prix TTC', 'Price
w/ taxes (%currency)' => 'Prix
avec taxes (%currency)', 'Price
w/o taxes (%currency)' => 'Prix
sans taxes (%currency)', - 'Pricing' => 'défintion des prix', + 'Pricing' => 'Définition des prix', 'Product' => 'Produit', 'Product Attributes' => 'Déclinaisons du produit', 'Product EAN Code' => 'Code EAN du produit', @@ -643,7 +675,8 @@ return array( 'Product features' => 'Caractéristiques produit', 'Product price' => 'Prix du produit', 'Product price including taxes' => 'Prix du produit taxes incluses', - 'Product templates' => 'Template produit', + 'Product tax price' => 'Prix TTC', + 'Product templates' => 'Gabarits de produit', 'Product title' => 'Titre du produit', 'Product weight' => 'Poids du produit', 'Products' => 'Produits', @@ -654,8 +687,10 @@ return array( 'Profile created on %date_create. Last modification: %date_change' => 'Profil crée le %date_create. Dernière modification le %date_change ', 'Profiles' => 'Profils', 'Promotion' => 'Promo', + 'Provides free shipping' => 'Offre le port', 'Published by OpenStudio' => 'Développé par OpenStudio', 'Purpose' => 'Objet', + 'Quantity' => 'Quantité', 'Quickly create combinations using the combination builder' => 'Créer rapidement une combinaison via le générateur de combinaison', 'Rate' => 'Taux', 'Rate from Euro' => 'Taux à partir de l\'Euro', @@ -669,13 +704,13 @@ return array( 'Remove attribute' => 'Supprimer la déclinaison', 'Remove country' => 'Enlever ce pays', 'Remove feature' => 'Enlever la caractéristique', - 'Remove from all product templates' => 'Enlever de tous les templates produit', + 'Remove from all product templates' => 'Enlever de tous les gabarits de produit', 'Remove from category' => 'Supprimer de la rubrique', 'Remove related content' => 'Enlever les contenus liés', 'Remove selected values' => 'Enlever les valeur sélectionnées', 'Remove the product from this category' => 'Enlever ce produit de cette rubrique', - 'Remove this attribute from all product templates' => 'Enlever cette déclinaison de tous les template produit', - 'Remove this feature from all product templates' => 'Enlever cette caractéristique de tous les templates produit', + 'Remove this attribute from all product templates' => 'Enlever cette déclinaison de tous les gabarits de produit', + 'Remove this feature from all product templates' => 'Enlever cette caractéristique de tous les gabarits de produit', 'Remove zone' => 'Supprimer la zone', 'Resource' => 'Ressource', 'Resource access rights' => 'Droits d\'accès pour les ressources', @@ -685,8 +720,8 @@ return array( 'SEO' => 'SEO', 'Sale' => 'En promo', 'Sale price incl. taxes' => 'Prix promo TTC', - 'Sale price
w/ taxes (%currency)' => 'Prix promo
HT (%currency)', - 'Sale price
w/o taxes (%currency)' => 'Prix promo
TTC (%currency)', + 'Sale price
w/ taxes (%currency)' => 'Prix promo
TTC (%currency)', + 'Sale price
w/o taxes (%currency)' => 'Prix promo
HT (%currency)', 'Sales' => 'Ventes', 'Sales excluding shipping' => 'Ventes hors frais de port', 'Sales statistics' => 'Statistiques de vente', @@ -696,13 +731,15 @@ return array( 'Save changes' => 'Enregistrer les modifications', 'Save this address' => 'Sauvegarder cette adresse', 'Save this condition' => 'Enregistrer cette condition', - 'Save your modifications' => 'Enregistrer les modifications', 'Search' => 'Recherche', + 'Search for \'%term\'' => 'Recherche de \'%term\'', 'Select a category and click (+) to add it to the additional category list' => 'Sélectionner une rubrique et cliquez sur (+) pour la rajouter dans la liste des rubrique associées', 'Select a category to get its products' => 'Sélectionner une rubrique pour avoir les produits qu\'elle contient', 'Select a category...' => 'Sélectionner une rubrique...', 'Select a content and click (+) to add it to this category' => 'Selectionnez un contenu et cliquez sur (+) pour l\'ajouter à cette rubrique', 'Select a content and click (+) to add it to this product' => 'Sélectionner un contenu et cliquer sur (+) pour l\'associer au produit', + 'Select a feature and click (+) to add it to this template' => 'Choisissez une caractéristique et cliquez (+) pour l\'ajouter à ce gabarit', + 'Select a feature...' => 'Choisissez une caractéristique', 'Select a folder and click (+) to add it to the additional folder list' => 'Sélectionnez un dossier et cliquez sur (+) afin de l\'ajouter à la liste des dossiers aditionnels', 'Select a folder content...' => 'Choisissez un dossier de contenu...', 'Select a folder to get its content' => 'Choisissez un dossier de contenu pour lister ses contenus', @@ -711,27 +748,24 @@ return array( 'Select a product...' => 'Sélectionner un produit...', 'Select a tax tule' => 'Sélectionnez une règle de taxes', 'Select a value click (+) to add it to the combination' => 'Sélectionnez une valeur et cliquez sur (+) pour l\'ajouter à la combinaison', - 'Select an attribute and click (+) to add it to this template' => 'Sélectionner une déclinaison et cliquer sur (+) pour l\'ajouter à ce template', + 'Select an attribute and click (+) to add it to this template' => 'Sélectionner une déclinaison et cliquer sur (+) pour l\'ajouter à ce gabarit', 'Select an attribute and click (+) to view available values' => 'Sélectionnez une déclinaison et cliquez sur (+) pour voir les valeurs disponibles', 'Select an attribute value...' => 'Sélectionnez une valeur de déclinaison...', 'Select an attribute...' => 'Sélectionnez une déclinaison...', - 'Select an feature and click (+) to add it to this template' => 'Selectionnez une caractéristique et cliquez sur (+) pour l\'ajouter à ce template', - 'Select an feature...' => 'Sélectionnez une caractéristique...', 'Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.' => 'Sélectionnez les valeurs de déclinaison à combiner. Vous pouvez entrer une valeur par défaut pour certains champs des combinaisons générées.', 'Select here the tax applicable to this product' => 'Sélectionnez ici la taxe applicable sur ce produit', - 'Select the E-mail template you want to translate' => 'Sélectionnez le template de mail à traduire', - 'Select the PDF template you want to translate' => 'Sélectionnez le template PDF à traduire', - 'Select the back-office template you want to translate' => 'Sélectionnez le template back-office que vous souhaitez traduire', - 'Select the front-office template you want to translate' => 'Sélectionnez le template front-office que vous souhaitez traduire', - 'Select the module you want to translate' => 'Sélectionnez le module à traduire', - 'Select which items you want to translate' => 'Sélectionnez l\'élément que vous souhaitez traduire', 'Send a mail to this customer' => 'Contacter ce client par mail', 'Send files' => 'Envoyer des fichiers', 'Sequential number of log line' => 'Sequential number of log line', 'Set as default tax rule' => 'Configurer en tant que règle par défaut', 'Shipping configuration' => 'Configuration du transport', - 'Shipping configuration name' => 'Nom de la configuration de livraison', + 'Shipping configuration of delivery module "%title"' => 'Configuration des zones de livraison du module "%title" ', + 'Shipping zone' => 'Zone de livraison', + 'Shipping zone "%title"' => 'Zone de livraison "%title"', + 'Shipping zone name' => 'Nom de la zone de livraison', 'Shipping zones' => 'Zones de livraison', + 'Shipping zones for this module' => 'Zones de livraison associées à ce module', + 'Shipping zones management' => 'Zones de livraison', 'Shop' => 'Boutique', 'Shop Informations' => 'Informations sur la boutique', 'Short conclusion' => 'Courte conclusion', @@ -747,14 +781,14 @@ return array( 'Sorry, feature ID=%id was not found.' => 'Désolé, la caractéristique ID=%id n\'a pas été trouvé', 'Sorry, image ID=%id was not found.' => 'Désolé, l\'image ID=%id n\'a pas été trouvé', 'Sorry, message ID=%id was not found.' => 'Désolé, le message ID=%id n\'a pas été trouvé', - 'Sorry, template ID=%id was not found.' => 'Désolé, le template ID=%id n\'a pas été trouvé', + 'Sorry, template ID=%id was not found.' => 'Désolé, le gabarit ID=%id n\'a pas été trouvé', 'Sorry, variable ID=%id was not found.' => 'Désolé, la variable ID=%id n\'a pas été trouvé', 'Source IP' => 'IP source', 'Source IP :' => 'IP source : ', 'Status' => 'Etat', 'Stock' => 'Stock', 'Store' => 'Information boutique', - 'Store Business Identification Number (SIRET, etc).' => 'identifiant de la boutique (SIRET, etc)', + 'Store Business Identification Number (SIRET, etc).' => 'Identifiant de la boutique (SIRET, etc)', 'Store address' => 'Adresse de la boutique', 'Store configuration' => 'Configuration de la boutique', 'Street address' => 'Adresse', @@ -776,9 +810,9 @@ return array( 'Taxes' => 'Taxes', 'Taxes define the amount of money which is added to a bought product.' => 'Les taxes correspondent au montant ajouté au prix HT d\'un produit acheté', 'Taxes rules' => 'Règles de taxes', - 'Template name' => 'Nom du template', - 'Template title' => 'Titre du template', - 'Templates' => 'Templates', + 'Template name' => 'Nom du gabarit', + 'Template title' => 'Titre du gabarit', + 'Templates' => 'Gabarits de produit', 'Text version of this message' => 'Version texte du message', 'The HTML TITLE element is the most important element on your web page.' => 'L\'élément HTML TITLE est le plus important dans votre page', 'The default pricing is used when no combination is defined.' => 'Le prix pas défaut est utilisez lorsqu\'aucune combinaison n\'est utilisé', @@ -797,21 +831,27 @@ return array( 'Thelia Mailing Templates' => 'Template de Mailing Thelia', 'Thelia Product Attributes' => 'Déclinaisons du produit Thelia', 'Thelia Product Features' => 'Caractéristiques produit de Thelia', - 'Thelia Product Templates' => 'Templates produit Thelia', + 'Thelia Product Templates' => 'Gabarits produit Thelia', 'Thelia Shipping configuration' => 'Configuration des livraisons Thelia', 'Thelia Shipping zones' => 'Zone de livraison de Thelia', 'Thelia System Variables' => 'Variables Thelia', + 'Thelia caches flushing' => 'Vidage des caches Thelia', 'Thelia configuration' => 'Configuration thelia', 'Thelia contributions' => 'Contributions de Thelia', 'Thelia core' => 'Coeur de Thelia', 'Thelia informations' => 'Informations Thelia', 'Thelia mailing templates' => 'Template de mailing Thelia', 'Thelia product attributes' => 'Déclinaisons du produit Thelia', - 'Thelia product features' => 'caractéristiques produit de Thelia', - 'Thelia product templates' => 'templates produit Thelia', + 'Thelia product features' => 'Caractéristiques produit de Thelia', + 'Thelia product templates' => 'Gabarits de produit Thelia', 'Thelia support forum' => 'Forum de Thelia', 'Thelia system variables' => 'Variables Thelia', + 'Thelia tools' => 'Outils Thelia', 'Thelia, the open source e-commerce solution' => 'Thelia, la solution e-commerce libre', + 'There are no shipping zones attached to this module.' => 'Ce module de transport n\'est associé à aucune zone de livraison', + 'There is currently no active module here.' => 'Il n\'y a aucun module actif ici', + 'There is currently no available attributes.' => 'Aucune déclinaison n\'est disponbible.', + 'There is currently no available features.' => 'Aucune caractéristique n\'est disponbible.', 'There is no documents attached to this %type.' => 'Il n\'y a aucun document lié à ce %type.', 'There is no images attached to this %type.' => 'Il n\'y a pas d\'image liée à ce %type.', 'They are some administrator which are linked to this administrator. Please edit/remove them before deleting this administrator.' => 'Cet administrateur est lié avec un ou plusieurs autres administrateurs. Supprimez ou modifiez ces administrateurs d\'abord.', @@ -820,34 +860,40 @@ return array( 'This category doesn\'t contains any products. To add a new product, click the + button above.' => 'Cette rubrique n\'a aucun produit. Pour créer un nouveau produit, cliquer sur le bouton + ci-dessus. ', 'This category has no sub-categories.' => 'Cette rubrique n\'a pas de sous-rubrique.', 'This category has no sub-categories. To create a new one, click the + button above.' => 'Cette rubrique n\'a pas de sous-rubrique. Pour en créer une nouvelle, cliquez sur le bouton + ci-dessus.', - 'This coupon is disabled, you can enable at the bottom of this form.' => 'Le code promo est désactivé. Vous pouvez l\'activer au début de ce formulaire', 'This customer has not defined any delivery address' => 'Ce client n\'a pas saisi aucune adresse de livraison', + 'This delivery module handles all shipping zones.' => 'Ce module livre dans toutes les zones de livraison.', 'This folder doesn\'t contains any contents. To add a new content, click the + button above.' => 'Ce dossier n\'a aucun contenu. Pour ajouter un nouveau contenu, cliquez sur le bouton + ci-dessus.', 'This folder has no sub-folders.' => 'Ce dossier n\'a pas de sous-dossiers.', 'This folder has no sub-folders. To create a new one, click the + button above.' => 'Ce dossier n\'a pas de sous-dossiers. Afin de créer un nouveau, cliquez sur le bouton + ci-dessus.', + 'This is the code entered by your customers to use this coupon' => 'Il s\'agit du code qui sera saisi par vos clients', 'This is the message purpose, such as \'Order confirmation\'.' => 'Titre du message (ex : confirmation de commande)', 'This is the subject of the e-mail, such as \'Your order is confirmed\'.' => 'Sujet du message (ex : votre commande est validée)', 'This mailing template could not be changed.' => 'Le template de mailing ne peut pas être changé', + 'This module cannot be started, some files are probably missing.' => 'Ce module ne peut pas être démarré, il manque sans doute des fichiers.', 'This month' => 'Ce mois', 'This product contains no accessories' => 'Ce produit n\'a aucun accessoire', 'This product contains no contents' => 'Ce produit n\'a aucun contenu associé', 'This product doesn\'t belong to any additional category.' => 'Ce produit n\'est associé à aucune rubrique supplémentaire', 'This product doesn\'t belong to any additional folder.' => 'Ce produit n\'appartient à aucun dossier addoitionnel', + 'This product has no combination. The default price is used. Click here to create a new combination.' => 'Ce produit n\'a pas de combinaison. Le prix par défaut est utilisé. Créer une nouvelle combinaison. ', 'This product template does not contains any features' => 'Ce gabarit de produit ne comporte aucune caractéristique', - 'This template contains no attributes' => 'Ce template n\'a pas de déclinaison', - 'This template contains no features' => 'Ce template ne contient aucune caractéristique', + 'This shipping zone does not contains any country.' => 'Cette zone de livraison ne comporte aucun pays', + 'This template contains no attributes' => 'Ce gabarit n\'a pas de déclinaison', + 'This template contains no features' => 'Ce gabarit ne contient aucune caractéristique', 'This the unique name of this message. Do not change this value unless you understand what you do.' => 'Ceci est le nom unique du message. Ne le modifiez que si vous savez ce que vous faîtes', 'This variable could not be changed.' => 'Cette variable ne peut pas être modifié', 'This year' => 'Cette année', 'Timeout' => 'Délai d\'attente expiré', 'Timeout :' => 'Délai d\'attente expiré : ', 'Title' => 'Titre', - 'Title :' => 'Titre : ', + 'Title * :' => 'Titre * : ', 'To' => 'A', 'To create a new content, select an existing folder, or create a new one.' => 'Pour créer un nouveau contenu, sélectionnez un dossier existant ou créez en un nouveau', 'To create a new product, select an existing category, or create a new one.' => 'Pour créer un nouveau produit, veuillez sélectionner une rubrique existante ou en créer une nouvelle', 'To remove a value from the combination, select it and click "remove"' => 'Afin de supprimer une valeur de la combinaison, sélectionnez la et cliquez sur "Enlever"', + 'To use features or attributes on this product, please select a product template. You can define product templates in the configuration section of the administration.' => 'Pour utiliser les déclinaisons et les caractéristiques sur ce produit, choisissez un tempplate produit. Vous pouvez gérer les gabarits de produit dans la section configuration de l\'administration.', 'Today' => 'Aujourd\'hui', + 'Tools' => 'Outils', 'Top level' => 'Niveau 1', 'Top level Contents' => 'Contenus de niveau 1', 'Top level Products' => 'Produits mis en avant', @@ -859,17 +905,19 @@ return array( 'Transaction reference' => 'Référence de la transaction', 'Translation' => 'Traductions', 'Translations' => 'Traductions', - 'Type :' => 'Type : ', + 'Unassigned countries' => 'Pays sans zone de livraison', 'Unit taxed price' => 'Prix unitaire TTC', 'Unit. price' => 'Prix unitaire', 'Unlimited' => 'Illimité', + 'Unlimited number of uses' => 'Nombre d\'utilisations illimité', 'Update' => 'Mettre à jour', 'Update an administrator' => 'Mettre à jour cet administrateur', 'Update coupon' => 'Mettre à jour le code', 'Update rates' => 'Mettre à jour les taux', 'Update tax rule taxes' => 'Mettre à jour les taxes de la règle de taxe', 'Update this image' => 'Modifier cette image', - 'Usage left' => 'Utilisation restante', + 'Usage count' => 'Nombre d\'utilisations', + 'Usages left' => 'Utulisations restantes', 'Use Ctrl+click to select more than one value. You can also clear selected values.' => 'Utilisez Ctrl+clic pour choisir plus d\'une valeur. Vous pouvez aussi tout désélectionner.', 'Use HTML message defined below' => 'Utiliser le message HTML définie ci-dessous', 'Use Text message defined below' => 'Utiliser la version texte définie ci-dessous', @@ -880,7 +928,8 @@ return array( 'Used in your store front' => 'Utilisé dans le front de votre boutique', 'Username' => 'Nom d\'utilisateur', 'Username :' => 'Nom d\'utilisateur : ', - 'Using a domain or subdomain for each language' => 'utiliser un domaine ou un sous domaine pour chaque langue', + 'Using a domain or subdomain for each language' => 'Utiliser un domaine ou un sous domaine pour chaque langue', + 'Valid on special offers' => 'Valide pour les offres spéciales', 'Value' => 'Valeur', 'Variable created on %date_create. Last modification: %date_change' => 'Variable créée le %date_create. Dernière modification: %date_change', 'Variable name' => 'Nom de la variable', @@ -888,52 +937,54 @@ return array( 'Variable value' => 'Valeur de la variable', 'Version %ver' => 'Version %ver', 'View' => 'Voir', - 'View only missing translations' => 'N\'afficher que les traductions manquantes', + 'View only missing translations.' => 'Afficher uniquement les traductions manquantes', 'View shop' => 'Voir la boutique', 'View site' => 'Voir le site', 'Visibility' => 'Visibilité', 'Warning' => 'Attention', 'Weight
(Kg)' => 'Poids
(Kg)', 'Welcome' => 'Bienvenue', - 'Will be available on special offers' => 'Sera disponible pour les produits en promotion', - 'Will remove postage' => 'Supprimera les frais de port', - 'Won\'t be available on special offers' => 'N\'est pas disponible pour les offres spéciales', - 'Won\'t remove postage' => 'Ne supprimera pas les frais de port', 'Yes' => 'Oui', 'Yesterday sales' => 'Ventes de la veille', 'You can attach here some content to this category' => 'Vous pouvez lier ici des contenus à cette rubrique', 'You can attach here some content to this product' => 'Vous pouvez associer des contenus avec ce produit', 'You can attach this product to more categories in the details tab.' => 'Vous pouvez lier ce produit à plusieurs rubriques dans l\'onglet détail.', + 'You can change attributes and their positions in the attributes configuration page.' => 'Vous pouvez modifier les déclinaisons et leur position dans la gestion des déclinaisons.', + 'You can change feature and their positions in the features configuration page.' => 'Vous pouvez modifier les caractéristiques et leur position dans la gestion des caractéristiques.', + 'You can change template attributes and their positions in the template configuration page.' => 'Vous pouvez modifier les déclinaisons du gabarit et leur position dans la configuration des gabarits de produit. ', + 'You can change templates features and their positions in the template configuration page.' => 'Vous pouvez modifier les caractéristiques du gabarit et leur position dans la configuration des gabarits de produit.', 'You can change the default category (%title) in the "General" tab.' => 'Vous pouvez changer la catégorie par défaut (%title) dans l\'onglet "Général"', 'You can change the default folder (%title) in the "General" tab.' => 'Vous pouvez modifier le dossier par défaut (%title) dans l\'onglet "Général".', 'You can\'t delete this administrator' => 'Vous ne pouvez pas supprimer cet administrateur', 'You can\'t delete this profile' => 'Vous ne pouvez pas supprimer ce profil', 'You don\'t need to use commas or other punctuations.' => 'Vous n\'avez pas besoin d\'utiliser de virgules ou d\'autres signes de ponctuation', + 'You may also quickly create combinations from products attributes using the Combination Builder.' => 'Vous pouvez aussi créer rapidement une série de combinaisons avec le gestionnaire de combinaisons.', 'Your current IP address is %ip' => 'Votre adresse IP est %ip', 'Zip code' => 'Code postal', - 'Zones' => 'Zones', - 'activate' => 'activer', + 'Zone name' => 'Nom de la zone', + 'activate' => 'Activer', 'activate %title module' => 'Activez le module %title', 'activation' => 'Activation', 'and' => 'et', 'classic modules' => 'Modules classiques', 'code' => 'code', 'company' => 'entreprise', - 'customer ref' => 'ref client', + 'customer ref' => 'référence client', 'd-m-Y' => 'd-m-Y', 'date form' => 'formulaire de date', 'date in yyyy-mm-dd format' => 'date in yyyy-mm-dd format', - 'days left' => 'jours restants', 'deactivate' => 'désactiver', 'deactivation' => 'désactivation', + 'delete image' => 'Supprimer l\'image', 'en_US' => 'en_US', 'firstname & lastname' => 'Prénom & nom', 'hour in hh:mm:ss format' => 'hour in hh:mm:ss format', 'last order' => 'Dernière commande', 'long description' => 'description longue', - 'max usage' => 'utilisations max', + 'newsletter subscribers' => 'Inscrits à la newsletter', 'order amount' => 'Montant de la commande', 'orders for this customer' => 'commandes pour ce client', + 'permanent discount' => 'Remise permanente (en pourcentage)', 'short description' => 'description court', 'tax rules' => 'règles de taxe', 'taxes' => 'taxes', @@ -942,5 +993,4 @@ return array( 'tracking reference' => 'Reference Tracking', 'uncheck all' => 'tout décocher', 'you can combine taxes in tax rules and chose if they are applied one after the other or at the same time : it allows to apply taxes on an already taxed price or not.' => 'vous pouvez combiner des taxes en règles de taxe et choisir si elle sont appliquées l\'une après l\'autre ou en même temps: cela permet d\'appliquer des taxes sur un produit déjà taxé ou non.', - 'yyyy-mm-dd' => 'yyyy-mm-dd', ); diff --git a/templates/backOffice/default/I18n/it_IT.php b/templates/backOffice/default/I18n/it_IT.php index 58f83ebb2..a3937e40b 100755 --- a/templates/backOffice/default/I18n/it_IT.php +++ b/templates/backOffice/default/I18n/it_IT.php @@ -1,806 +1,948 @@ '', - 'Back-office home' => '', - 'Thelia Back Office' => '', - 'Version %ver' => '', - 'View site' => '', - 'View shop' => '', - 'Profil' => '', - 'Close administation session' => '', - 'Logout' => '', - 'Home' => '', - 'Customers' => '', - 'Orders' => '', - 'All orders' => '', - 'Catalog' => '', - 'Folders' => '', - 'Coupons' => '', - 'Configuration' => '', - 'Modules' => '', - 'Search' => '', - 'Thelia, solution e-commerce libre' => '', - 'Dashboard' => '', - 'Sales' => '', - 'New customers' => '', - 'First orders' => '', - 'Aborted orders' => '', - 'Shop Informations' => '', - 'Categories' => '', - 'Products' => '', - 'Online products' => '', - 'Offline products' => '', - 'Pending orders' => '', - 'In process orderst' => '', - 'Shipped orders' => '', - 'Canceled orders' => '', - 'Sales statistics' => '', - 'Today' => '', - 'This month' => '', - 'This year' => '', - 'Overall sales' => '', - 'Sales excluding shipping' => '', - 'Yesterday sales' => '', - 'Waiting orders' => '', - 'In process orders' => '', - 'Average cart' => '', - 'Previous month sales' => '', - 'Previous year sales' => '', - 'Thelia informations' => '', - 'Current version' => '', - 'Latest version available' => '', - 'News' => '', - 'Click here' => '', - '© Thelia 2013' => '', - 'Édité par OpenStudio' => '', - 'Forum Thelia' => '', - 'Contributions Thelia' => '', - 'Customer' => '', - 'Customers list' => '', - 'Add a new Customer' => '', - 'customer ref' => '', - 'firstname & lastname' => '', - 'last order' => '', - 'order amount' => '', - 'Actions' => '', - 'Edit this customer' => '', - 'Send a mail to this customer' => '', - 'Delete this customer and all his orders' => '', - 'Company Name' => '', - 'Company' => '', - 'Title' => '', - 'First Name' => '', - 'Firstname' => '', - 'Last Name' => '', - 'Lastname' => '', - 'Street Address' => '', - 'Address' => '', - 'Address Line 2' => '', - 'Additional address' => '', - 'Address Line 3' => '', - 'Zip code' => '', - 'City' => '', - 'Country' => '', - 'Email Address' => '', - 'Email address' => '', - 'Create a new customer' => '', - 'Create this customer' => '', - 'Cancel' => '', - 'OK' => '', - 'Delete customer' => '', - 'Do you really want to delete this customer ?' => '', - 'No' => '', - 'Yes' => '', - 'Thelia configuration' => '', - 'Product catalog configuration' => '', - 'Product templates' => '', - 'Product attributes' => '', - 'Product features' => '', - 'Mailing templates' => '', - 'Currencies' => '', - 'Taxes rules' => '', - 'Shipping configuration' => '', - 'Countries' => '', - 'Shipping zones' => '', - 'System parameters' => '', - 'Modules activation' => '', - 'System variables' => '', - 'Administration profiles' => '', - 'Administrators' => '', - 'Languages & URLs' => '', - 'Mailing system' => '', - 'Administration logs' => '', - 'System logs' => '', - 'Thelia System Variables' => '', - 'Thelia system variables' => '', - 'Add a new variable' => '', - 'Save chages' => '', - 'Save changes' => '', - 'Purpose' => '', - 'Name' => '', - 'Value' => '', - 'Action' => '', - 'Change this variable' => '', - 'Cancel changes and revert to original value' => '', - 'Delete this variable' => '', - 'Name *' => '', - 'Variable name' => '', - 'Value *' => '', - 'Variable value' => '', - 'Purpose *' => '', - 'Variable purpose' => '', - 'English' => '', - 'Enter here the category name in the default language (%title)' => '', - 'Create a new variable' => '', - 'Create this variable' => '', - 'Delete a variable' => '', - 'Do you really want to delete this variable ?' => '', - 'Coupon' => '', - 'Browse' => '', - 'Coupons : ' => '', - 'List' => '', - 'Create a new coupon' => '', - 'Enabled coupons' => '', - 'Code' => '', - 'Days before expiration' => '', - 'Usage left' => '', - 'Edit' => '', - 'Unlimited' => '', - 'Disabled coupons' => '', - 'Expiration date' => '', - 'Update coupon' => '', - 'Update' => '', - 'Code :' => '', - 'code' => '', - 'Title :' => '', - 'title' => '', - 'Is enabled' => '', - 'Is available on special offers' => '', - 'Is cumulative' => '', - 'Is removing postage' => '', - 'Expiration date :' => '', - 'yyyy-mm-dd' => '', - 'Is unlimited' => '', - 'Max usage :' => '', - 'max usage' => '', - 'Type :' => '', - 'Please select a coupon type' => '', - 'Amount :' => '', - '14.50' => '', - 'Short description :' => '', - 'short description' => '', - 'Long description :' => '', - 'long description' => '', - 'Save your modifications' => '', - 'Conditions' => '', - 'Delete' => '', - 'And' => '', - 'Save this condition' => '', - 'Condition\'s category :' => '', - 'Please select a condition category' => '', - 'Files manager' => '', - 'Please retry' => '', - 'Please select another condition' => '', - 'Edit a customer' => '', - 'Editing customer "%name"' => '', - 'Edit customer thelia thelia' => '', - 'Save' => '', - 'Save and close' => '', - 'Customer informations' => '', - 'Default address' => '', - 'Other addresses' => '', - 'Add a new address' => '', - 'Phone' => '', - 'cell phone' => '', - 'Edit this address' => '', - 'Use this address by default' => '', - 'orders for this customer' => '', - 'Order n°' => '', - 'Date & Hour' => '', - 'Amount' => '', - 'Status' => '', - 'Sorry, customer ID=1 was not found.' => '', - 'Address label' => '', - 'Label' => '', - 'Create an address' => '', - 'Create this address' => '', - 'Use address by default' => '', - 'Do you really want to use this address by default ?' => '', - 'Delete address' => '', - 'Do you really want to delete this address ?' => '', - 'Edit an address' => '', - 'Edit this order' => '', - 'Cancel this order' => '', - 'Delete an order' => '', - 'Do you really want to cancel this order ?' => '', - 'Edit an order' => '', - 'Ordered products' => '', - 'Invoice and Delivery' => '', - 'Cart' => '', - 'Product' => '', - 'Unit. price' => '', - 'Tax' => '', - 'Unit taxed price' => '', - 'Quantity' => '', - 'Taxed total' => '', - 'Total without discount' => '', - 'Discount' => '', - 'Coupon code' => '', - 'Total including discount' => '', - 'Postage' => '', - 'Total' => '', - 'Payment information' => '', - 'Payment module' => '', - 'Transaction reference' => '', - 'Delivery module' => '', - 'tracking reference' => '', - 'Description' => '', - 'Invoice informations' => '', - 'Download invoice as PDF' => '', - 'PDF | Invoice' => '', - 'Edit invoice address' => '', - 'Invoice reference' => '', - 'Invoice date' => '', - 'Street address' => '', - 'Delivery address' => '', - 'Download purchase order as PDF' => '', - 'PDF | Purchase order' => '', - 'Edit delivery address' => '', - 'Compagny' => '', - 'Edit order address' => '', - 'Confirm changes' => '', - 'Top level categories' => '', - 'Add a new category' => '', - 'ID' => '', - 'Category title' => '', - 'Online' => '', - 'Position' => '', - 'Browse this category' => '', - 'Edit this category' => '', - 'Delete this category and all its contents' => '', - 'This category has no sub-categories. To create a new one, click the + button above.' => '', - 'This category has no sub-categories.' => '', - 'Top level Products' => '', - 'Add a new product' => '', - 'Reference' => '', - 'Product title' => '', - 'This category doesn\'t contains any products. To add a new product, click the + button above.' => '', - 'Create a new category' => '', - 'Create this category' => '', - 'Enter here the product reference' => '', - 'Enter here the product name in the default language (%title)' => '', - 'Product price' => '', - 'Enter here the product price in the default currency (%title)' => '', - 'Select a tax tule' => '', - 'Select here the tax applicable to this product' => '', - 'Product weight' => '', - 'Kg' => '', - 'Enter here the product weight, in Kilogrammes' => '', - 'Create a new product' => '', - 'Create this product' => '', - 'Delete category' => '', - 'Do you really want to delete this category and all its content ?' => '', - 'Delete product' => '', - 'Do you really want to delete this product ?' => '', - 'Enter new category position' => '', - 'Enter new product position' => '', - 'Edit category' => '', - 'Editing %cat' => '', - 'Edit category %title' => '', - 'Preview category page' => '', - 'Edit next category' => '', - 'General description' => '', - 'Associations' => '', - 'Images' => '', - 'Documents' => '', - 'Edit information in %lng' => '', - 'Français' => '', - 'castellano' => '', - 'Italiano' => '', - 'Close' => '', - 'Category title *' => '', - 'Summary' => '', - 'A short description, used when a summary or an introduction is required' => '', - 'Short description' => '', - 'Detailed description' => '', - 'The detailed description.' => '', - 'Conclusion' => '', - 'A short post-description information' => '', - 'Short conclusion' => '', - 'Rewritten URL' => '', - 'Parent category *' => '', - 'Top level' => '', - 'Visibility' => '', - 'Category created on %date_create. Last modification: %date_change' => '', - 'Related content' => '', - 'You can attach here some content to this category' => '', - 'Select a folder...' => '', - 'Select a folder to get its content' => '', - 'Select a folder content...' => '', - 'Select a content and click (+) to add it to this category' => '', - 'No available content in this folder' => '', - 'No folders found' => '', - 'Content title' => '', - 'This category contains no contents' => '', - 'Send files' => '', - 'Drop files to upload' => '', - 'Browse files' => '', - 'Update this image' => '', - 'There is no images attached to this %type.' => '', - 'Can\'t load images, please refresh this page.' => '', - 'There is no documents attached to this %type.' => '', - 'Can\'t load documents, please refresh this page.' => '', - 'Remove related content' => '', - 'Do you really want to remove this related content ?' => '', - '(edit)' => '', - 'Categories in %cat' => '', - 'Products in %cat' => '', - 'Edit this product' => '', - 'Delete this product' => '', - 'Edit product' => '', - 'Editing %title' => '', - 'Edit product %title' => '', - 'Preview product page' => '', - 'General' => '', - 'Details' => '', - 'Attributes & Features' => '', - 'Product reference' => '', - 'Product title *' => '', - 'Default product category *' => '', - 'You can attach this product to more categories in the details tab.' => '', - 'Product created on %date_create. Last modification: %date_change' => '', - 'Edit prices in %curr' => '', - 'Attribute Combinations' => '', - 'Quickly create combinations using the combination builder' => '', - 'Combination builder' => '', - 'Add a new combination' => '', - 'EAN Code' => '', - 'Price
w/o taxes (%currency)' => '', - 'Price
w/ taxes (%currency)' => '', - 'Weight
(Kg)' => '', - 'Default' => '', - 'Sale' => '', - 'New' => '', - 'Sale price
w/o taxes (%currency)' => '', - 'Sale price
w/ taxes (%currency)' => '', - 'Delete this combination' => '', - 'Attribute' => '', - 'Select an attribute...' => '', - 'Select an attribute and click (+) to view available values' => '', - 'Select an attribute value...' => '', - 'Select a value click (+) to add it to the combination' => '', - 'No available value for this attribute' => '', - 'To remove a value from the combination, select it and click "remove"' => '', - 'Remove selected values' => '', - 'Create a new combination' => '', - 'Create this combination' => '', - 'Delete a combination' => '', - 'Do you really want to delete this combination ?' => '', - 'Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.' => '', - 'Price excl. taxes' => '', - 'Combination reference' => '', - 'Combination EAN Code' => '', - 'Current quantity' => '', - '0 combinations' => '', - 'Create combinations' => '', - 'Please wait, loading' => '', - 'Failed to get converted prices. Please try again.' => '', - 'Failed to get prices. Please try again.' => '', - 'Existing combinations will be deleted. Do you want to continue ?' => '', - 'To use features or attributes on this product, please select a product template. You can define product templates in the configuration section of the administration.' => '', - 'Current product template' => '', - 'Do not use a product template' => '', - 'Apply' => '', - 'Product Attributes' => '', - 'You can change template attributes and their positions in the template configuration page.' => '', - 'Attribute Name' => '', - 'This product template does not contains any features' => '', - 'Product Features' => '', - 'You can change templates features and their positions in the template configuration page.' => '', - 'Feature Name' => '', - 'Feature value for this product' => '', - 'Use Ctrl+click to select more than one value. You can also clear selected values.' => '', - 'Enter here the feature value as free text' => '', - 'Feature value' => '', - 'Top level folders' => '', - 'Add a new folder' => '', - 'Folder title' => '', - 'Browse this folder' => '', - 'Edit this folder' => '', - 'Delete this folder and all its contents' => '', - 'This folder has no sub-folders. To create a new one, click the + button above.' => '', - 'This folder has no sub-folders.' => '', - 'Top level Contents' => '', - 'Add a new content' => '', - 'This folder doesn\'t contains any contents. To add a new content, click the + button above.' => '', - 'Enter here the folder name in the default language (%title)' => '', - 'Create a new folder' => '', - 'Create this folder' => '', - 'Enter here the content name in the default language (%title)' => '', - 'Create a new content' => '', - 'Create this content' => '', - 'Delete folder' => '', - 'Do you really want to delete this folder and all its content ?' => '', - 'Delete content' => '', - 'Do you really want to delete this content ?' => '', - 'Enter new folder position' => '', - 'Enter new content position' => '', - 'An error occured' => '', - 'Oops! An Error Occurred' => '', - 'Go to administration home' => '', - 'Folders in %fold' => '', - 'Contents in %fold' => '', - 'Edit this content' => '', - 'Delete this content' => '', - 'Edit content' => '', - 'Edit content %title' => '', - 'Preview folder page' => '', - 'Content title *' => '', - 'Default folder *' => '', - 'Folder created on %date_create. Last modification: %date_change' => '', - 'Additional Folders' => '', - 'A content could be attached to more than one folder. Select here the additional fodlers for this content.' => '', - 'You can change the default folder (%title) in the "General" tab.' => '', - ' (default)' => '', - 'Select a folder and click (+) to add it to the additional folder list' => '', - 'No Folders found' => '', - 'This product doesn\'t belong to any additional folder.' => '', - 'Remove associated folder' => '', - 'Do you really want to remove the content from this folder ?' => '', - 'Remove the product from this category' => '', - 'Coupon : ' => '', - 'days left' => '', - 'May be cumulative' => '', - 'Won\'t remove postage' => '', - 'Will be available on special offers' => '', - 'Application field' => '', - 'Do you really want to enable this element ?' => '', - 'Confirmation' => '', - 'Confirm' => '', - 'Create coupon' => '', - 'Create' => '', - 'Please save your Coupon in oder to affect it some conditions' => '', - 'Do you really want to delete this element ?' => '', - 'Thelia Product Templates' => '', - 'Thelia product templates' => '', - 'Add a new product template' => '', - 'Change this template' => '', - 'Change this product template' => '', - 'Delete this product template' => '', - 'No product template has been created yet. Click the + button to create one.' => '', - 'Template Name *' => '', - 'Template title' => '', - 'Enter here the template name in the default language (English)' => '', - 'Create a new product template' => '', - 'Create this product template' => '', - 'Delete template' => '', - 'Do you really want to delete this template ? It will be removed from all products.' => '', - 'Select an feature...' => '', - 'Select an feature and click (+) to add it to this template' => '', - 'Feature title' => '', - 'Delete this feature' => '', - 'This template contains no features' => '', - 'Remove feature' => '', - 'Do you really want to remove this feature from the template ?' => '', - 'Thelia Product Attributes' => '', - 'Thelia product attributes' => '', - 'Add a new product attribute' => '', - 'Change this attribute' => '', - 'Remove this attribute from all product templates' => '', - 'Add this attribute to all product templates' => '', - 'Change this product attribute' => '', - 'Delete this product attribute' => '', - 'No product attribute has been created yet. Click the + button to create one.' => '', - 'Title *' => '', - 'Attribute title' => '', - 'Enter here the attribute name in the default language (English)' => '', - 'Check this box if you want to add this attributes to all product templates' => '', - 'Create a new attribute' => '', - 'Create this attribute' => '', - 'Delete attribute' => '', - 'Do you really want to delete this attribute ? It will be removed from all product templates.' => '', - 'Add to all product templates' => '', - 'Do you really want to add this attribute to all product templates ?' => '', - 'Remove from all product templates' => '', - 'Do you really want to remove this attribute from all product templates ? You\'ll loose all product related data for this attribute.' => '', - 'Enter new attribute position' => '', - 'Edit an attribute' => '', - 'Attributes' => '', - 'Editing attribute "%name"' => '', - 'Edit attribute en_US : Officiis cumque.' => '', - 'Attribute information' => '', - 'Attribute values' => '', - 'Enter here all possible attribute values.' => '', - 'Delete this value' => '', - 'No value has been created yet. Click the + button to create one.' => '', - 'Sorry, attribute ID=1 was not found.' => '', - 'Enter here the value in the current edit language (English)' => '', - 'Create a new attribute value' => '', - 'Create this value' => '', - 'Delete attribute value' => '', - 'Do you really want to delete this attribute value ?' => '', - 'Enter new value position' => '', - 'Thelia Product Features' => '', - 'Thelia product features' => '', - 'Add a new product feature' => '', - 'Change this feature' => '', - 'Remove this feature from all product templates' => '', - 'Add this feature to all product templates' => '', - 'Change this product feature' => '', - 'Delete this product feature' => '', - 'No product feature has been created yet. Click the + button to create one.' => '', - 'Enter here the feature name in the default language (English)' => '', - 'Check this box if you want to add this features to all product templates' => '', - 'Create a new feature' => '', - 'Create this feature' => '', - 'Delete feature' => '', - 'Do you really want to delete this feature ? It will be removed from all product templates.' => '', - 'Do you really want to add this feature to all product templates ?' => '', - 'Do you really want to remove this feature from all product templates ? You\'ll loose all product related data for this feature.' => '', - 'Enter new feature position' => '', - 'Edit a feature' => '', - 'Features' => '', - 'Editing feature "%name"' => '', - 'Edit feature en_US : Consectetur omnis.' => '', - 'Feature information' => '', - 'Feature values' => '', - 'Enter here all possible feature values. To get a free text feature in product forms, don\'t add any value.' => '', - 'Sorry, feature ID=1 was not found.' => '', - 'Create a new feature value' => '', - 'Delete feature value' => '', - 'Do you really want to delete this feature value ?' => '', - 'Thelia Mailing Templates' => '', - 'Thelia mailing templates' => '', - 'Add a new mailing template' => '', - 'Change this mailing template' => '', - 'Delete this mailing template' => '', - 'No mailing template has been created yet. Click the + button to create one.' => '', - 'Mailing template name' => '', - 'Mailing template purpose' => '', - 'Enter here the mailing template purpose in the default language (English)' => '', - 'Create a new mailing template' => '', - 'Create this mailing template' => '', - 'Delete mailing template' => '', - 'Do you really want to delete this mailing template ?' => '', - 'Edit a mailing template' => '', - 'Editing mailing template "%name"' => '', - 'Edit mailing template order_confirmation' => '', - 'Prevent mailing template modification or deletion, except for super-admin' => '', - 'Message subject *' => '', - 'Subject' => '', - 'HTML Message' => '', - 'The mailing template in HTML format.' => '', - 'Text Message' => '', - 'The mailing template in text-only format.' => '', - 'Message created on %date_create. Last modification: %date_change' => '', - 'Sorry, message ID=1 was not found.' => '', - 'Update rates' => '', - 'Add a new currency' => '', - 'ISO 4217 Code' => '', - 'More information about ISO 4217' => '', - 'Symbol' => '', - 'Rate in €' => '', - 'Change this currency' => '', - 'Delete this currency' => '', - 'No currency has been created yet. Click the + button to create one.' => '', - 'Currency name' => '', - 'Enter here the currency name in the default language (English)' => '', - 'ISO 4217 code *' => '', - 'ISO 4217 code' => '', - 'Symbol *' => '', - 'Currency symbol' => '', - 'Rate from € *' => '', - 'Currency rate' => '', - 'Rate' => '', - 'The rate from Euro (Price in Euro * rate = Price in this currency)' => '', - 'Create a new currency' => '', - 'Create this currency' => '', - 'Delete currency' => '', - 'Do you really want to delete this currency ?' => '', - 'Enter new currency position' => '', - 'Edit a currency' => '', - 'Editing currency "%name"' => '', - 'Edit currency Euro' => '', - 'Currency ISO 4217 Code' => '', - 'The symbol, such as $, £, €...' => '', - 'Rate from Euro' => '', - 'Sorry, currency ID=1 was not found.' => '', - 'In order to manges your shop taxes you can manage' => '', - 'taxes' => '', - 'and' => '', - 'tax rules' => '', - 'Taxes define the amount of money which is add to a bought product.' => '', - 'Example :' => '', - 'French 19.6% VAT is a tax which add a 19.6% tax to the product price.' => '', - 'Ecotax is a tax wich add a defined amount (throug a product feature) to the product price.' => '', - 'Tax rules are combination of different taxes.' => '', - 'French 19.6% VAT with ecotax is the applicance of the ecotax (on the product price) then the applicance of the 19.6% tax (on the product price + the ecotax amount).' => '', - 'you can combine taxes in tax rules and chose if they are applied one after the other or at the same time : it allows to apply taxes on an already taxed price or not.' => '', - 'Taxes' => '', - 'Create a new tax' => '', - 'Change this tax' => '', - 'Delete this tax' => '', - 'Create a new tax rule' => '', - 'Change this tax rule' => '', - 'Set as default tax rule' => '', - 'Delete this tax rule' => '', - 'Type' => '', - 'amount' => '', - 'feature' => '', - 'percent' => '', - 'Delete tax' => '', - 'Do you really want to delete this tax ?' => '', - 'Delete tax rule' => '', - 'Do you really want to delete this tax rule ?' => '', - 'Edit a tax' => '', - 'Editing tax' => '', - 'Tax created on %date_create. Last modification: %date_change' => '', - 'Edit a tax rule' => '', - 'Editing tax rule' => '', - 'Tax rule created on %date_create. Last modification: %date_change' => '', - 'Manage taxes' => '', - 'Choose a country' => '', - 'Countries that have the same tax rule' => '', - 'NONE' => '', - 'Manage the tax rule taxes appliance order' => '', - 'Add tax to this group' => '', - 'Drop tax here to create a tax group' => '', - 'Drop tax here to delete from group' => '', - 'Tax rule taxes will be update for the following countries :' => '', - 'uncheck all' => '', - 'Update tax rule taxes' => '', - 'Edit tax rule taxes' => '', - 'Add a new country' => '', - 'Shop' => '', - 'N° ISO' => '', - 'ISO Code' => '', - 'Change this country' => '', - 'Delete this country' => '', - 'No country has been created yet. Click the + button to create one.' => '', - 'Country title *' => '', - 'Country title' => '', - 'Country area' => '', - 'ISO Code *' => '', - 'Alpha code 2 *' => '', - 'Alpha code 2' => '', - 'Alpha code 3 *' => '', - 'Alpha code 3' => '', - 'Create a new country' => '', - 'Create this country' => '', - 'Delete country' => '', - 'Do you really want to delete this country ?' => '', - 'Error' => '', - 'Impossible to change default country. Please contact your administrator or try later' => '', - 'Edit a country' => '', - 'Editing country "%name"' => '', - 'Edit country ' => '', - '' => '', - 'Country short description' => '', - 'Country description' => '', - 'Sorry, country ID=190 was not found.' => '', - 'Edit country Afghanistan' => '', - 'Sorry, country ID=1 was not found.' => '', - 'Thelia Shipping zones' => '', - 'Change this shipping zone' => '', - 'Edit a shipping zone' => '', - 'Editing shipping zone "%name"' => '', - 'Edit shipping zone %title' => '', - 'Add' => '', - 'Zones' => '', - 'Delete this zone' => '', - 'Remove zone' => '', - 'Do you really want to remove this zone ?' => '', - 'Thelia Shipping configuration' => '', - 'Add a new shipping configuration' => '', - 'Change this shipping configuration' => '', - 'Delete this shipping configuration' => '', - 'Shipping configuration name' => '', - 'Create a new shipping configuration' => '', - 'Create this shipping configuration' => '', - 'Delete shipping configuration' => '', - 'Do you really want to delete this shipping configuration ?' => '', - 'Edit a shipping configuration' => '', - 'Editing shipping configuration "%name"' => '', - 'Edit shipping configuration %title' => '', - 'Add this country' => '', - 'No area defined with this id' => '', - 'Remove country' => '', - 'Do you really want to remove this country ?' => '', - 'Classic modules' => '', - 'classic modules' => '', - 'Enable/Disable' => '', - 'Deactivate %title module' => '', - 'deactivation' => '', - 'Edit this module' => '', - 'Delete this module' => '', - 'Delivery modules' => '', - 'Payment modules' => '', - 'Delete a module' => '', - 'Do you really want to delete this module ?' => '', - 'Edit a system variable' => '', - 'Editing variable "%name"' => '', - 'Edit variable active-template' => '', - 'Prevent variable modification or deletion, except for super-admin' => '', - 'Variable created on %date_create. Last modification: %date_change' => '', - 'Sorry, variable ID=3 was not found.' => '', - 'Profiles' => '', - 'Create a new profile' => '', - 'Profile Code' => '', - 'Profile code' => '', - 'Postscriptum' => '', - 'Delete profile' => '', - 'Do you really want to delete this profile ?' => '', - 'You can\'t delete this profile' => '', - 'They are some administrator which are linked to this profile. Please edit/remove them before deleting this profile.' => '', - 'Create a new administrator' => '', - 'Login' => '', - 'FirstName' => '', - 'LastName' => '', - 'Profile' => '', - 'Superadministrator' => '', - 'Change this administrator' => '', - 'Password' => '', - 'Password confirmation' => '', - 'Leave empty to keep current password' => '', - 'Update a new administrator' => '', - 'Delete administrator' => '', - 'Do you really want to delete this administrator ?' => '', - 'You can\'t delete this administrator' => '', - 'They are some administrator which are linked to this administrator. Please edit/remove them before deleting this administrator.' => '', - 'Thelia Languages' => '', - 'Languages' => '', - 'Languages management' => '', - 'Add a new language' => '', - 'Language name' => '', - 'ISO 639 Code' => '', - 'Locale' => '', - 'date form' => '', - 'time form' => '', - 'Change this language' => '', - 'Delete this language' => '', - 'Parameters' => '', - 'If a translation is missing or incomplete :' => '', - 'Using a domain or subdomain for each language' => '', - 'activate' => '', - 'Language title' => '', - 'language locale' => '', - 'en_US' => '', - 'date format' => '', - 'd-m-Y' => '', - 'time format' => '', - 'H:i:s' => '', - 'Create a new language' => '', - 'Create this language' => '', - 'Delete language' => '', - 'Do you really want to delete this language ?' => '', - 'Impossible to change default languages. Please contact your administrator or try later' => '', - 'Edit a language' => '', - 'Edit this language' => '', - 'deactivate' => '', - 'Thelia Mailing System' => '', - 'Configuration mailing system' => '', - 'Enable remote SMTP use : ' => '', - 'Host :' => '', - 'Host' => '', - 'Port :' => '', - 'Port' => '', - 'Encryption :' => '', - 'Encryption' => '', - 'Username :' => '', - 'Username' => '', - 'Password :' => '', - 'Auth Mode :' => '', - 'Auth Mode' => '', - 'Timeout :' => '', - 'Timeout' => '', - 'Source IP :' => '', - 'Source IP' => '', - 'Show logs' => '', - 'Period' => '', - 'From' => '', - 'To' => '', - 'Resources' => '', - 'company' => '', -) -; \ No newline at end of file +return array( + ' (default)' => ' (predefinito)', + '© Thelia 2013' => '© Thelia 2013', + '(edit)' => '(modifica)', + 'Check the list of ISO 639-1 codes' => 'Controllare l\'elenco dei codici ISO 639-1', + '0 combinations' => '0 combinazioni', + 'Congratulations, all text is now translated !' => 'Complimenti, tutto il testo è ora tradotto !', + 'Did not found any text to translate. It\'s probably normal. If not, please be sure to use Smarty\'s "intl" function in templates, or the Translator::trans() method in PHP files.' => 'Non e stato trovato alcun testo da tradurre. Probabilmente è normale. Se così non fosse, si prega di assicurarsi di utilizzare la funzione "intl" di Smarty sui template, o il metodo Translator::trans() nei file PHP.', + 'A content could be attached to more than one folder. Select here the additional folders for this content.' => 'Un contenuto potrebbe essere associato a più di una cartella. Selezionare qui i cartelli aggiuntivi per questo contenuto.', + 'A product could be attached to more than one category. Select here the additional categories for this product.' => 'Un prodotto potrebbe essere associato a più categorie. Selezionare le categorie aggiuntive per questo prodotto.', + 'A short description, used when a summary or an introduction is required' => 'Una breve descrizione, utilizzata quando è necessario un sommario o un\'introduzione', + 'A short post-description information' => 'Una breve informazione post-descrizione', + 'Aborted orders' => 'Ordini annullati', + 'Accessory title' => 'Titolo dell\'accessorio', + 'Action' => 'Azione', + 'Actions' => 'Azioni', + 'Activate this log destination' => 'Attivare questa destinazione del registro', + 'Add' => 'Aggiungere', + 'Add a new Customer' => 'Aggiungere un nuovo cliente', + 'Add a new address' => 'Aggiungere un nuovo indirizzo', + 'Add a new category' => 'Aggiungere una nuova categoria', + 'Add a new combination' => 'Aggiungere una nuova combinazione', + 'Add a new content' => 'Aggiungere un nuovo contenuto', + 'Add a new country' => 'Aggiungere un nuovo paese', + 'Add a new currency' => 'Aggiungere una nuova valuta', + 'Add a new folder' => 'Aggiungere una nuova cartella', + 'Add a new language' => 'Aggiungere una nuova lingua', + 'Add a new mailing template' => 'Aggiungere un nuovo modello di e-mail', + 'Add a new product' => 'Aggiungere un nuovo prodotto', + 'Add a new product attribute' => 'Aggiungere un nuovo attributo di prodotto', + 'Add a new product feature' => 'Aggiungere una nuova caratteristica di prodotto', + 'Add a new product template' => 'Aggiungere un nuovo template per i prodotti', + 'Add a new shipping configuration' => 'Aggiungere una nuova configurazione di spedizione', + 'Add a new variable' => 'Aggiungere una nuova variabile', + 'Add tax to this group' => 'Aggiungere una tasse a questo gruppo', + 'Add this attribute to all product templates' => 'Aggiungere questa declinazione a tutti i templates di prodotto', + 'Add this country' => 'Aggiungere questo paese', + 'Add this feature to all product templates' => 'Aggiungere questa caratteristica per tutti i templates di prodotto', + 'Add to all product templates' => 'Aggiungere a tutti i template che riguardano i prodotti', + 'Additional Folders' => 'Cartelle addizionale', + 'Additional address' => 'Indirizzo aggiuntivo', + 'Additional categories' => 'Ulteriori categorie', + 'Address' => 'Indirizzo', + 'Administration logs' => 'Registri di amministrazione', + 'Administration profiles' => 'Profili di amministrazione', + 'Administrators' => 'Amministratori', + 'All orders' => 'Tutti gli ordini', + 'Alpha code 2' => 'Alpha code 2', + 'Alpha code 3' => 'Alpha code 3', + 'Amount' => 'Importo', + 'An error occured' => 'Si è verificato un errore', + 'And' => 'E', + 'Application field' => 'Campo di applicazione', + 'Apply' => 'Applicare', + 'Associations' => 'Associazioni', + 'Attribute' => 'Declinazione', + 'Attribute Combinations' => 'Combinazioni di declinazione', + 'Attribute Name' => 'Nome della declinazione', + 'Attribute information' => 'Informazione sulla declinazione', + 'Attribute title' => 'Titolo della declinazione', + 'Attribute values' => 'Valori della declinazione', + 'Attributes' => 'Declinazioni', + 'Attributes & Features' => 'Declinazioni & caratteristiche', + 'Auth Mode' => 'Auth Mode', + 'Auth Mode :' => 'Auth Mode :', + 'Average cart' => 'Carrello medio', + 'Back' => 'Indietro', + 'Back-office home' => 'Home del back office', + 'Back-office templates' => 'Template per il back-office', + 'Back-office users' => 'Utenti del back-office', + 'Browse' => 'Naviga', + 'Browse files' => ' Percorrere i file', + 'Browse this category' => 'Cerca in questa categoria', + 'Browse this folder' => 'Percorrere questa cartella', + 'Can\'t be cumulative' => 'Non può essere cumulativo', + 'Can\'t load documents, please refresh this page.' => 'Non è possibile caricare i documenti, si prega di aggiornare questa pagina.', + 'Can\'t load images, please refresh this page.' => 'Non è possibile caricare le immagini, si prega di aggiornare questa pagina.', + 'Can\'t reorder documents, please refresh this page.' => 'Non è possibile riordinare i documenti, si prega di aggiornare questa pagina.', + 'Can\'t reorder images, please refresh this page.' => 'Non è possibile riordinare le immagini, si prega di aggiornare questa pagina.', + 'Cancel' => 'Cancellare', + 'Cancel changes and revert to original value' => 'Cancellare le modifiche e tornare al valore originale', + 'Cancel this order' => 'Annullare questo ordine', + 'Cart - Prices in %currency' => 'Carrello - prezzi in %currency', + 'Catalog' => 'Catalogo', + 'Categories' => 'Categorie', + 'Categories in %cat' => 'Categorie in %cat', + 'Category created on %date_create. Last modification: %date_change' => 'Categoria creata il %date_create. Ultima modifica: %date_change', + 'Category title' => 'Titolo della categoria', + 'Cellular phone' => 'Telefono cellulare', + 'Cellular phone number' => 'Numero di telefono cellulare', + 'Change this administrator' => 'Cambiare questo amministratore', + 'Change this attribute' => 'Cambiare questo attributo', + 'Change this country' => 'Cambiare questo paese', + 'Change this currency' => 'Modificare questa valuta', + 'Change this feature' => 'Modificare questa caratteristica', + 'Change this language' => 'Cambiare questa lingua', + 'Change this mailing template' => 'Modificare questo template di e-mail', + 'Change this product attribute' => 'Modificare questa declinazione', + 'Change this product feature' => 'Modificare questa caratteristica', + 'Change this product template' => 'Cambiare questo template di prodotto', + 'Change this profile' => 'Modificare il profilo', + 'Change this shipping configuration' => 'Modificare questa configurazione di spedizione', + 'Change this shipping zone' => 'Cambiare questa zona di spedizione', + 'Change this tax' => 'Modificare questa tassa', + 'Change this tax rule' => 'Cambiare questa regola fiscale', + 'Change this template' => 'Modificare questo template', + 'Change this variable' => 'Cambiare questa variabile', + 'Chapo' => 'Chapo', + 'Check this box if you want to add this attributes to all product templates' => 'Attivare questa checkbox se desideri aggiungere questo attributo a tutti i template di prodotto', + 'Check this box if you want to add this features to all product templates' => 'Attivare questa checkbox se desideri aggiungere queste caratteristiche a tutti i template di prodotto', + 'Choose a country' => 'Scegliere un paese', + 'City' => 'Città', + 'Classic modules' => 'Moduli classici', + 'Click here' => 'Clicca qui', + 'Close' => 'Chiudere', + 'Close administation session' => 'Chiudere questa sessione di amministrazione', + 'Code' => 'Codice', + 'Code :' => 'Codice:', + 'Combination EAN Code' => 'Combinazione codice EAN', + 'Combination builder' => 'Generatore di combinazione', + 'Combination reference' => 'Riferimento di combinazione', + 'Company' => 'Azienda', + 'Condition type :' => 'Tipo di condizione:', + 'Condition\'s category :' => 'Categoria di condizione:', + 'Conditions' => 'Condizioni', + 'Configuration' => 'Impostazione', + 'Configuration mailing system' => 'Sistema di configurazione e-mail', + 'Configure' => 'Configurare', + 'Configure this module' => 'Configurare questo modulo', + 'Confirm' => 'Confermare', + 'Confirm changes' => 'Confermare le modifiche', + 'Confirmation' => 'Conferma', + 'Content title' => 'Contenuto del titolo', + 'Contents in %fold' => 'Contenuti in %fold', + 'Copy source text in input field' => 'Copiare il testo in campo di input', + 'Countries' => 'Paesi', + 'Countries that have the same tax rule' => 'Paesi che hanno la stessa regola sulle tasse', + 'Country' => 'Paese', + 'Country description' => 'Descrizione del paese', + 'Country short description' => 'Breve descrizione del paese', + 'Country title' => 'Titolo del paese', + 'Coupon' => 'Promozione', + 'Coupon : ' => 'Promozione : ', + 'Coupon code' => 'Codice promozionale', + 'Coupons' => 'Codici promozionali', + 'Coupons : ' => 'Codici promozionali : ', + 'Create' => 'Creare', + 'Create a customer address' => 'Creare un indirizzo per il cliente', + 'Create a new administrator' => 'Creare un nuovo amministratore', + 'Create a new attribute' => 'Creare una nuova declinazione', + 'Create a new attribute value' => 'Creare un nuovo valore di declinazione', + 'Create a new category' => 'Creare una nuova categoria', + 'Create a new combination' => 'Creare una nuova combinazione', + 'Create a new content' => 'Creare un nuovo contenuto', + 'Create a new country' => 'Creare un nuovo paese', + 'Create a new coupon' => 'Creare un nuovo codice promozionale', + 'Create a new currency' => 'Creare una nuova moneta', + 'Create a new customer' => 'Creare un nuovo cliente', + 'Create a new feature' => 'Creare una nuova caratteristica', + 'Create a new feature value' => 'Creare un nuovo valore di caratteristica', + 'Create a new folder' => 'Creare una nuova cartella', + 'Create a new language' => 'Creare un nuovo linguaggio', + 'Create a new mailing template' => 'Creare un nuovo template di e-mail', + 'Create a new product' => 'Creare un nuovo prodotto', + 'Create a new product template' => 'Creare un nuovo template per i prodotti', + 'Create a new profile' => 'Creare un nuovo profilo', + 'Create a new shipping configuration' => 'Creare una nuova configurazione di spedizione', + 'Create a new tax' => 'Creare una nuova tassa', + 'Create a new tax rule' => 'Creare una nuova regola fiscale', + 'Create a new variable' => 'Creare una nuova variabile', + 'Create combinations' => 'Creare combinazioni', + 'Create coupon' => 'Creare un codice promozionale', + 'Create this address' => 'Creare questo indirizzo', + 'Create this attribute' => 'Creare questa declinazione', + 'Create this category' => 'Creare questa categoria', + 'Create this combination' => 'Creare questa combinazione', + 'Create this content' => 'Creare questo contenuto', + 'Create this country' => 'Creare questo paese', + 'Create this currency' => 'Creare questa valuta', + 'Create this customer' => 'Creare questo cliente', + 'Create this feature' => 'Creare questa caratteristica', + 'Create this folder' => 'Creare questa cartella', + 'Create this language' => 'Creare questa lingua', + 'Create this mailing template' => 'Creare questo template di email', + 'Create this product' => 'Creare questo prodotto', + 'Create this product template' => 'Creare il template del prodotto', + 'Create this shipping configuration' => 'Creare questa configurazione di spedizione', + 'Create this value' => 'Creare questa moneta', + 'Create this variable' => 'Creare questa variabile', + 'Currencies' => 'Monete', + 'Currency ISO 4217 Code' => 'Codice moneta ISO 4217', + 'Currency name' => 'Nome della moneta', + 'Currency rate' => 'Tasso della moneta', + 'Currency symbol' => 'Simbolo della moneta', + 'Current product template' => 'Template corrente del prodotto', + 'Current quantity' => 'Quantità attuale', + 'Current version' => 'Versione attuale', + 'Customer' => 'Cliente', + 'Customer informations' => 'Informazioni del cliente', + 'Customers' => 'Clienti', + 'Customers list' => 'Elenco dei clienti', + 'Cutomer Name' => 'Nome del cliente', + 'Dashboard' => 'Dashboard', + 'Date & Hour' => 'Data e ore', + 'Date of last order' => 'Data dell\'ultimo ordine', + 'Days before expiration' => 'Giorni prima della scadenza', + 'Deactivate %title module' => 'Disattivare il modulo %title', + 'Default' => 'Predefinito', + 'Default address' => 'Indirizzo predefinito', + 'Define here this product\'s accessories' => 'Definire qui gli accessori di questo prodotto', + 'Delete' => 'Cancellare', + 'Delete a combination' => 'Cancellare una combinazione', + 'Delete a module' => 'Cancellare un modulo', + 'Delete a variable' => 'Cancellare una variabile', + 'Delete address' => 'Rimuovere l\'indirizzo', + 'Delete administrator' => 'Rimuovere l\'amministratore', + 'Delete also module data' => 'Rimuovere anche i dati del modulo', + 'Delete an order' => 'Cancellare un ordine', + 'Delete attribute' => 'Cancellare una declinazione', + 'Delete attribute value' => 'Eliminare il valore dell\'attributo', + 'Delete category' => 'Cancellare la categoria', + 'Delete content' => 'Cancellare il contenuto', + 'Delete country' => 'Cancellare il paese', + 'Delete currency' => 'Rimuovere la moneta', + 'Delete customer' => 'Cancellare il cliente', + 'Delete feature' => 'Eliminare la caratteristica', + 'Delete feature value' => 'Eliminare il valore della caratteristica', + 'Delete folder' => 'Cancellare la cartella', + 'Delete language' => 'Cancellare la lingua', + 'Delete mailing template' => 'Cancellare il templare di e-mail', + 'Delete product' => 'Cancellare il prodotto', + 'Delete profile' => 'Cancellare il profilo', + 'Delete shipping configuration' => 'Cancellare la configurazione di spedizione', + 'Delete tax' => 'Cancellare la tassa', + 'Delete tax rule' => 'Cancellare la regola fiscale', + 'Delete template' => 'Cancellare il template', + 'Delete this accessory' => 'Cancellare questo accessorio', + 'Delete this administrator' => 'Cancellare questo amministratore', + 'Delete this attribute' => 'Eliminare questo attributo', + 'Delete this category and all its contents' => 'Cancellare questa categoria e tutti i suoi contenuti', + 'Delete this combination' => 'Cancellare questa combinazione', + 'Delete this content' => 'Cancellare questo contenuto', + 'Delete this country' => 'Cancellare questo paese', + 'Delete this currency' => 'Cancellare questa moneta', + 'Delete this customer and all his orders' => 'Cancellare questo cliente e tutti i suoi ordini', + 'Delete this feature' => 'Eliminare questa caratteristica', + 'Delete this folder and all its contents' => 'Eliminare questa cartella e il relativo contenuto', + 'Delete this language' => 'Cancellare questa lingua', + 'Delete this mailing template' => 'Cancellare questo template di e-mail', + 'Delete this module' => 'Cancellare questo modulo', + 'Delete this product' => 'Cancellare questo prodotto', + 'Delete this product attribute' => 'Cancellare l\'attributo del prodotto', + 'Delete this product feature' => 'Eliminare questa caratteristica di prodotto', + 'Delete this product template' => 'Cancellare questo template di prodotto', + 'Delete this profile' => 'Cancellare questo profilo', + 'Delete this shipping configuration' => 'Cancellare questa configurazione di spedizione', + 'Delete this tax' => 'Cancellare questa tassa', + 'Delete this tax rule' => 'Cancellare questa regola fiscale', + 'Delete this value' => 'Eliminare questo valore', + 'Delete this variable' => 'Cancellare questa variabile', + 'Delete this zone' => 'Cancellare questa zona', + 'Delivery address' => 'Indirizzo di consegna', + 'Delivery module' => 'Modulo di consegna', + 'Delivery modules' => 'Moduli di consegna', + 'Description' => 'Descrizione', + 'Destinations' => 'Destinazione', + 'Details' => 'Dettagli', + 'Disabled coupons' => 'Codici promozionali disattivati', + 'Discount' => 'Sconto', + 'Do not use a product template' => 'Non utilizzare un template di prodotto', + 'Do you really want to add this attribute to all product templates ?' => 'Volete davvero aggiungere questa declinazione a tutti i template di prodotto ?', + 'Do you really want to add this feature to all product templates ?' => 'Volete davvero aggiungere questa caratteristica per tutti i template di prodotto ?', + 'Do you really want to cancel this order ?' => 'Volete cancellare questo ordine?', + 'Do you really want to delete this address ?' => 'Volete cancellare questo indirizzo ?', + 'Do you really want to delete this administrator ?' => 'Volete cancellare questo amministratore ?', + 'Do you really want to delete this attribute ? It will be removed from all product templates.' => 'Volete davvero eliminare questo attributo? Verrà rimosso da tutti i template di prodotti.', + 'Do you really want to delete this attribute value ?' => 'Volete davvero eliminare questo valore di attributo?', + 'Do you really want to delete this category and all its content ?' => 'Volete cancellare questa categoria e tutto il suo contenuto?', + 'Do you really want to delete this combination ?' => 'Volete davvero cancellare questa combinazione ?', + 'Do you really want to delete this content ?' => 'Volete davvero cancellare questo contenuto ?', + 'Do you really want to delete this country ?' => 'Volete davvero cancellare questo paese ?', + 'Do you really want to delete this currency ?' => 'Volete davvero eliminare questa moneta ?', + 'Do you really want to delete this customer ?' => 'Volete davvero cancellare questo cliente?', + 'Do you really want to delete this element ?' => 'Volete davvero cancellare questo elemento ?', + 'Do you really want to delete this feature ? It will be removed from all product templates.' => 'Volete davvero eliminare questo attributo? Verrà rimosso da tutti i template di prodotti.', + 'Do you really want to delete this feature value ?' => 'Volete davvero eliminare questo valore di caratteristica ?', + 'Do you really want to delete this folder and all its content ?' => 'Vuoi davvero eliminare questa cartella e tutto i suoi contenuti ?', + 'Do you really want to delete this language ?' => 'Vuoi davvero eliminare questa lingua?', + 'Do you really want to delete this mailing template ?' => 'Vuoi davvero eliminare questo template ?', + 'Do you really want to delete this module ?' => 'Volete davvero cancellare questo modulo ?', + 'Do you really want to delete this product ?' => 'Volete davvero cancellare questo prodotto ?', + 'Do you really want to delete this profile ?' => 'Volete davvero cancellare questo profilo ?', + 'Do you really want to delete this shipping configuration ?' => 'Volete davvero cancellare questa configurazione di spedizione ?', + 'Do you really want to delete this tax ?' => 'Vuoi davvero eliminare questa tassa?', + 'Do you really want to delete this tax rule ?' => 'Vuoi davvero eliminare questa regola fiscale?', + 'Do you really want to delete this template ? It will be removed from all products.' => 'Vuoi davvero eliminare questo template ? Verrà rimosso da tutti i prodotti.', + 'Do you really want to delete this variable ?' => 'Vuoi davvero eliminare questa variabile?', + 'Do you really want to enable this element ?' => 'Volete davvero attivare questo elemento ?', + 'Do you really want to remove the content from this folder ?' => 'Vuoi davvero rimuovere il contenuto dalla cartella ?', + 'Do you really want to remove the product from this category ?' => 'Vuoi davvero rimuovere il prodotto da questa categoria?', + 'Do you really want to remove this accessory from the product ?' => 'Volete davvero rimuovere questo accessorio dal prodotto ?', + 'Do you really want to remove this attribute from all product templates ? You\'ll loose all product related data for this attribute.' => 'Volete davvero rimuovere questo attributo da tutti i template di prodotto ? Perderete tutti i dati correlati con i prodotti per questo attributo.', + 'Do you really want to remove this attribute from the template ?' => ' Volete davvero rimuovere questo attributo dal template ?', + 'Do you really want to remove this country ?' => 'Volete davvero rimuovere questo paese ?', + 'Do you really want to remove this feature from all product templates ? You\'ll loose all product related data for this feature.' => 'Volete davvero rimuovere questa caratteristica da tutti i template di prodotto? Perderete tutti i dati correlati per questa caratteristica di prodotto.', + 'Do you really want to remove this feature from the template ?' => ' Volete davvero rimuovere questa caratteristica dal template ?', + 'Do you really want to remove this related content ?' => 'Volete davvero rimuovere questo contenuto correlato ?', + 'Do you really want to remove this related content from the product ?' => 'Volete davvero rimuovere questo contenuto correlato con il prodotto ?', + 'Do you really want to remove this zone ?' => 'Vuoi rimuovere questa zona?', + 'Do you really want to set this coupon available to everyone ?' => 'Volete davvero rendere disponibile a tutti questo codice promozionale ?', + 'Do you really want to use this address by default ?' => 'Vuoi davvero utilizzare quest\' indirizzo comme predefinito ?', + 'Document' => 'Documento', + 'Document informations' => 'Informazioni del documento', + 'Documents' => 'Documenti', + 'Don\'t repeat keywords over and over in a row. Rather, put in keyword phrases.' => 'Non ripetere parole chiavi più e più volte di fila. Piuttosto, mettere in frasi chiave.', + 'Download invoice as PDF' => 'Scaricare la fattura in formato PDF', + 'Download purchase order as PDF' => 'Scarica l\'ordine di acquisto in formato PDF', + 'Drop files to upload' => 'Rilasciare i file da caricare', + 'Drop tax here to create a tax group' => 'Mettere la tasse qui per creare un gruppo di tasse', + 'Drop tax here to delete from group' => 'Mettere la tasse qui per rimuoverla dal gruppo', + 'E-mail templates' => 'E-mail templates', + 'EAN Code' => 'Codice EAN', + 'Ecotax is a tax wich add a defined amount (throug a product feature) to the product price.' => 'Ecotassa è una tassa che aggiunge un importo definito al prezzo del prodotto.', + 'Edit' => 'Modificare', + 'Edit a country' => 'Modificare un paese', + 'Edit a currency' => 'Modificare una moneta', + 'Edit a customer' => 'Modificare un cliente', + 'Edit a customer address' => 'Modificare un indirizzo per un cliente', + 'Edit a document' => 'Modificare un documento', + 'Edit a feature' => 'Modificare una caratteristica', + 'Edit a language' => 'Modificare una lingua', + 'Edit a mailing template' => 'Modificare un template di e-mail', + 'Edit a module' => 'Modificare un modulo', + 'Edit a profile' => 'Modificare un profilo', + 'Edit a shipping configuration' => 'Modificare una configurazione di spedizione', + 'Edit a shipping zone' => 'Modificare una zona di spedizione', + 'Edit a system variable' => 'Modificare una variabile del sistema', + 'Edit a tax' => 'Modificare una tassa', + 'Edit a tax rule' => 'Modificare una regola fiscale', + 'Edit a template' => 'Modificare un template', + 'Edit an attribute' => 'Modificare un attributo', + 'Edit an image' => 'Modificare un\'immagine', + 'Edit an order' => 'Modificare un ordine', + 'Edit attribute "%name"' => 'Modificare l\'attributo "%name."', + 'Edit category' => 'Modificare una categoria', + 'Edit category %title' => 'Modificare la categoria %title', + 'Edit content' => 'Modificare il contenuto', + 'Edit content %title' => 'Modificare il contenuto %title', + 'Edit country "%name"' => 'Modificare il paese "%name"', + 'Edit currency "%name"' => 'Modificare la moneta "%name"', + 'Edit customer %firstname %lastname' => 'Modificare il cliente %firstname %lastname', + 'Edit delivery address' => 'Modificare l\'indirizzo di consegna', + 'Edit document "%name"' => 'Modificare il documento "%name"', + 'Edit feature "%name"' => 'Modificare la caratteristica "%name"', + 'Edit folder' => 'Modificare la cartella', + 'Edit folder %title' => 'Modificare la cartella %title', + 'Edit image "%name"' => 'Modificare l\'immagine "%name"', + 'Edit information in %lng' => 'Modificare le informazioni in %lng', + 'Edit invoice address' => 'Modificare l\'indirizzo di fatturazione', + 'Edit mailing template "%name"' => 'Modificare il template di mailing "%name"', + 'Edit next category' => 'Modificare la categoria successiva', + 'Edit next content' => 'Modificare il contenuto successivo', + 'Edit next folder' => 'Modificare la cartella successiva', + 'Edit next product' => 'Modificare il prodotto successivo', + 'Edit order address' => 'Modifica gli altri indirizzi per i ordini', + 'Edit previous category' => 'Modificare la categoria precedente', + 'Edit previous content' => 'Modificare il contenuto precedente', + 'Edit previous folder' => 'Modificare la cartella precedente', + 'Edit previous product' => 'Modificare il prodotto precedente', + 'Edit prices in %curr' => 'Modificare i prezzi in %curr', + 'Edit product' => 'Modificare il prodotto', + 'Edit product %title' => 'Modificare il prodotto %title', + 'Edit shipping configuration %title' => 'Modificare la configurazione di spedizione %title', + 'Edit shipping zone %title' => 'Modificare la zona di spedizione %title', + 'Edit tax rule taxes' => 'Modificare le regole fiscale', + 'Edit template "%name"' => 'Modificare il template "%name"', + 'Edit this address' => 'Modificare quest\' indirizzo', + 'Edit this category' => 'Modificare questa categoria', + 'Edit this content' => 'Modificare questo contenuto', + 'Edit this customer' => 'Modificare questo cliente', + 'Edit this folder' => 'Modificare questa cartella', + 'Edit this module' => 'Modificare questo modulo', + 'Edit this order' => 'Modificare questo ordine', + 'Edit this product' => 'Modificare questo prodotto', + 'Edit variable %name' => 'Modificare la variabile %name', + 'Editing %cat' => 'Modificare %cat', + 'Editing %fold' => 'Modificare %fold', + 'Editing %title' => 'Modificare %title', + 'Editing attribute "%name"' => 'Modificare l\'attributo "%name."', + 'Editing country "%name"' => 'Modificare il paese "%name"', + 'Editing currency "%name"' => 'Modificare la moneta "%name"', + 'Editing customer "%name"' => 'Modificare il cliente"%name"', + 'Editing document "%name"' => 'Modifica il documento "%name"', + 'Editing feature "%name"' => 'Modificare la caratteristica "%name"', + 'Editing image "%name"' => 'Modificare l\'immagine "%name"', + 'Editing mailing template "%name"' => 'Modificare il template di mailing "%name"', + 'Editing module' => 'Modificare il modulo', + 'Editing profile' => 'Modificare il profilo', + 'Editing shipping configuration "%name"' => 'Modificare la configurazione di spedizione "%name"', + 'Editing shipping zone "%name"' => 'Modificare la zona di spedizione "%name"', + 'Editing tax' => 'Modificare la tassa', + 'Editing tax rule' => 'Modificare la regola fiscale', + 'Editing template "%name"' => 'Modificare il template "%name"', + 'Editing variable "%name"' => 'Modificare la variabile "%name"', + 'Email address' => 'Indirizzo email', + 'Email used when you send an email to your customers (Order confirmations, etc).' => 'Email utilizzata quando si invia un\'e-mail ai vostri clienti (conferme d\'ordine, ecc.).', + 'Enable remote SMTP use : ' => 'Attivare l\'utilizzo del SMTP: ', + 'Enable/Disable' => 'Attivare/Disattivare', + 'Enabled coupons' => 'Codici promozionali attivi', + 'Encryption' => 'Crittografia', + 'Encryption :' => 'Crittografia :', + 'Enter here all possible attribute values.' => 'Inserisci qui tutti i valori possibili per l\'attributo.', + 'Enter here all possible feature values. To get a free text feature in product forms, don\'t add any value.' => 'Inserisci qui tutti i valori possibili per la caratteristica. Per ottenere la possibilità di avere un testo libero per la caratteristica, non aggiungere alcun valore.', + 'Enter here the attribute name in the default language (%language_name)' => 'Inserisci qui il nome dell\'attributo nella lingua predefinita (%language_name)', + 'Enter here the category name in the default language (%title)' => 'Inserisci qui il nome della categoria nella lingua predefinita (%title)', + 'Enter here the content name in the default language (%title)' => 'Inserisci qui il nome del contenuto nella lingua predefinita (%title)', + 'Enter here the currency name in the default language (%title)' => 'Inserisci qui il nome della moneta nella lingua predefinita (%title)', + 'Enter here the feature name in the default language (%title)' => 'Inserisci qui il nome della caratteristica nella lingua predefinita (%title)', + 'Enter here the feature value as free text' => 'Inserire qui il valore della caratteristica come testo libero', + 'Enter here the folder name in the default language (%title)' => 'Inserisci qui il nome della cartella nella lingua predefinita (%title)', + 'Enter here the mailing template purpose in the default language (%title)' => 'Inserisci qui il scopo del template per il mailing nella lingua predefinita (%title)', + 'Enter here the product name in the default language (%title)' => 'Inserisci qui il nome del prodotto nella lingua predefinita (%title)', + 'Enter here the product price in the default currency (%title)' => 'Inserisci qui il prezzo del prodotto nella moneta predefinita (%title)', + 'Enter here the product reference' => 'Inserisci qui il riferimento del prodotto', + 'Enter here the product weight, in Kilogrammes' => 'Inserisci qui il peso del prodotto, in chilogrammi', + 'Enter here the template name in the default language (%title)' => 'Inserisci qui il nome del template nella lingua predefinita (%title)', + 'Enter here the value in the current edit language (%language_name)' => 'Inserire qui il valore nella lingua dell\'attuale modificazione (%language_name)', + 'Enter here the value in the current edit language (%title)' => 'Inserire qui il valore nella lingua di modifica corrente (%title)', + 'Enter new accessory position' => 'Inserire la nuova posizione del accessorio', + 'Enter new attribute position' => 'Inserire la nuova posizione dell\'attributo', + 'Enter new category position' => 'Inserire la nuova posizione della categoria', + 'Enter new content position' => 'Inserire la nuova posizione del contenuto', + 'Enter new currency position' => 'Inserire la nuova posizione della moneta', + 'Enter new feature position' => 'Inserire la nuova posizione della caratteristica', + 'Enter new folder position' => 'Inserire la nuova posizione della cartella', + 'Enter new module position' => 'Inserire la nuova posizione del modulo', + 'Enter new product position' => 'Inserire la nuova posizione del prodotto', + 'Enter new value position' => 'Inserire la nuova posizione del valore', + 'Enter one or more IP V4 addresses separated by ";". Leave empty to display logs for all IP addresses' => 'Inserire una o più indirizzi IP V4 separati da ";\'. Lasciare vuoto per visualizzare i registri per tutti gli indirizzi IP', + 'Enter one or more file names without path separated by ";". Use "!" before a file name to exclude it. Use "*" to activate logs for all files.' => 'Inserire uno o più nomi di file senza percorso, separato da ";". Usare il simbolo "!" prima di un nome di file per escluderlo. Usare "*" per attivare i registri per tutti i file.', + 'Error' => 'Errore', + 'Example :' => 'Esempio :', + 'Existing combinations will be deleted. Do you want to continue ?' => 'Combinazioni esistenti verranno eliminati. Volete continuare?', + 'Expiration date' => 'Data di scadenza', + 'Expiration date :' => 'Data di scadenza :', + 'Failed to get converted prices. Please try again.' => 'Non è riuscito a ottenere prezzi convertiti. Riprovare per favore.', + 'Failed to get prices. Please try again.' => 'Impossibile ottenere i prezzi. Riprovare per favore.', + 'Fax number' => 'Numero di fax', + 'Feature Name' => 'Nome della caratteristica', + 'Feature information' => 'Informazione sulla caratteristica', + 'Feature title' => 'Titolo della caratteristica', + 'Feature value' => 'Valore della caratteristica', + 'Feature value for this product' => ' Valore della caratteristica per questo prodotto', + 'Feature values' => 'Valori della caratteristica', + 'Features' => 'Caratteristiche', + 'File' => 'File', + 'File names' => 'Nomi dei file', + 'Files manager' => 'File manager', + 'First Name' => 'Nome', + 'First name' => 'Nome', + 'First orders' => 'Primi ordini', + 'FirstName' => 'Nome', + 'Firstname' => 'Nome', + 'Folder created on %date_create. Last modification: %date_change' => 'Cartella creata il %date_create. Ultima modifica: %date_change', + 'Folder title' => 'Titolo della cartella', + 'Folders' => 'Cartelle', + 'Folders in %fold' => 'Cartelle in %fold', + 'French 19.6% VAT is a tax which add a 19.6% tax to the product price.' => 'L\'IVA francese è una tassa che aggiunge una maggiorazione del 19,6% al prezzo del prodotto.', + 'French 19.6% VAT with ecotax is the applicance of the ecotax (on the product price) then the applicance of the 19.6% tax (on the product price + the ecotax amount).' => 'L\'IVA francese di 19,6% con ecotassa è l\'applicazione dell\'ecotassa (sul prezzo del prodotto) quindi l\'applicazione della tassa 19,6% (sul prezzo del prodotto + la quantità dell\'ecotassa).', + 'From' => 'Da', + 'Front-office templates' => 'Template per il front-office', + 'General' => 'Generale', + 'General configuration' => 'Configurazione generale', + 'General description' => 'Descrizione generale', + 'Go to administration home' => 'Andare nella home dell\'amministrazione', + 'H:i:s' => 'H:i:s', + 'HTML version of this message' => 'Versione HTML di questo messaggio', + 'Home' => 'Home', + 'Host' => 'Host', + 'Host :' => 'Host :', + 'ID' => 'ID', + 'IP Addresses' => 'Indirizzi IP', + 'ISO 4217 Code' => 'Codice ISO 4217', + 'ISO 4217 code' => 'Codice ISO 4217', + 'ISO 639 Code' => 'Codice ISO 639', + 'ISO Code' => 'Codice ISO', + 'If a translation is missing or incomplete :' => 'Se una traduzione è incompleta o mancante:', + 'If yes, redirections through Redirect::exec() will be displayed as links' => 'Se sì, redirezioni tramite Redirect::exec() verranno visualizzati come link', + 'Il seems that this string contains a Smarty variable ($). If \'s the case, it cannot be transleted properly.' => 'Sembra che questa string contiene una variabile di Smarty ($). Se il caso, non può essere tradotta correttamente.', + 'Image' => 'Immagine', + 'Image information' => 'Informazioni sull\'immagine', + 'Images' => 'Immagini', + 'Impossible to change default country. Please contact your administrator or try later' => 'è impossibile cambiare il paese predefinito. La pregiamo di contattare l\'amministratore o di riprovare più tardi', + 'Impossible to change default languages. Please contact your administrator or try later' => 'è impossibile cambiare le lingue predefinite. La pregiamo du contattare l\'amministratore o di riprovare più tardi', + 'In order to manges your shop taxes you can manage' => 'Prima di gestire le tasse del negozio potete gestire', + 'In page' => 'Nella pagina', + 'In pages:' => 'Nelle pagine:', + 'Install a new module' => 'Installare un nuovo modulo', + 'Invoice and Delivery' => 'Fattura e consegna', + 'Invoice date' => 'Data della fattura', + 'Invoice informations' => 'Informazioni di fattura', + 'Invoice reference' => 'Riferimento della fattura', + 'Is available on special offers' => 'È disponibile su offerte speciali', + 'Is cumulative' => 'È cumulativo', + 'Is disabled' => 'È disattivato', + 'Is enabled' => 'È attivo', + 'Is removing postage' => 'È la rimozione dell\'affrancatura', + 'Is unlimited' => 'È illimitato', + 'Keep the most important part of your description in the first 150-160 characters.' => 'Tenere la parte più importante della tua descrizione nei primi 150-160 caratteri.', + 'Kg' => 'Kg', + 'Label' => 'Etichetta', + 'Language name' => 'Nome della lingua', + 'Language title' => 'Titolo della lingua', + 'Languages' => 'Lingue', + 'Languages & URLs' => 'Lingue & URLs', + 'Languages management' => 'Gestione delle lingue', + 'Last Name' => 'Cognome', + 'Last name' => 'Cognome', + 'Last order amount' => 'Ultimo importo dell\'ordine', + 'LastName' => 'Cognome', + 'Lastname' => 'Cognome', + 'Latest version available' => 'Ultima versione disponibile', + 'Leave empty to keep current password' => 'Lasciare vuoto per mantenere la password corrente', + 'Lire la suite' => 'Per saperne di più', + 'List' => 'Lista', + 'Loading Thelia lastest news...' => 'Caricamento delle ultime notizie su Thelia...', + 'Locale' => 'Locale', + 'Log lines format' => 'Log lines format', + 'Log lines header format. You may use the following variables: ' => 'Log lines header format. Si possono utilizzare le seguenti variabili:', + 'Login' => 'Login', + 'Logout' => 'Disconnettersi', + 'Long description :' => 'Descrizione lunga :', + 'Mailing system' => 'Sistema di mailing', + 'Mailing template name' => 'Nome del template di mailing', + 'Mailing template purpose' => 'Scopo del template di mailing', + 'Mailing templates' => 'Modelli di mailing', + 'Make sure it uses keywords found within the page itself.' => 'Assicurarsi che utilizza parole chiavi trovate all\'interno della pagina stessa.', + 'Make sure that your title is clear, and contains many of the keywords within the page itself.' => 'Assicurarsi che il titolo è chiaro e contiene molte delle parole chiave all\'interno della pagina stessa.', + 'Manage module rights' => 'Gestire i diritti del modulo', + 'Manage resource rights' => 'Gestire i diritti delle risorse', + 'Manage taxes' => 'Gestire le tasse', + 'Manage the tax rule taxes appliance order' => 'Gestire l\'ordine delle regole delle tasse', + 'Max usage :' => 'Utilizzo max :', + 'May be cumulative' => 'Può essere cumulativo', + 'Message created on %date_create. Last modification: %date_change' => 'Messaggio creato il %date_create. Ultima modifica: %date_change', + 'Message level' => 'Livello di messaggio', + 'Messages which have a level greater or equal to the selected level will be added to the log destinations. ' => 'I messaggi che hanno un livello maggiore o uguale al livello selezionato verranno aggiunto alle destinazioni del registro. ', + 'Module' => 'Modulo', + 'Module access rights' => 'Diritti di accesso del modulo', + 'Module created on %date_create. Last modification: %date_change' => 'Modulo creato il %date_create. Ultima modifica: %date_change', + 'Modules' => 'Moduli', + 'More information about ISO 4217' => 'Ulteriori informazioni su ISO 4217', + 'NONE' => 'NESSUNO', + 'Name' => 'Nome', + 'New' => 'Nuovo', + 'New customers' => 'Nuovi clienti', + 'News' => 'Notizie', + 'No' => 'No', + 'No Folders found' => 'Nessun cartelle trovate', + 'No area defined with this id' => 'Nessuna zona definita con questo id', + 'No available content in this folder' => 'Nessun contenuto disponibile in questa cartella', + 'No available product in this category' => 'Nessun prodotto disponibile in questa categoria', + 'No available value for this attribute' => 'Nessun valore disponibile per questo attributo', + 'No categories found' => 'Nessuna categoria trovata', + 'No country has been created yet. Click the + button to create one.' => 'Nessun paese è stato ancora creato. Clicca il pulsante + per crearne uno.', + 'No currency has been created yet. Click the + button to create one.' => 'Nessuna moneta è stata ancora creata. Clicca il pulsante + per crearne una.', + 'No folders found' => 'Nessun cartelle trovate', + 'No mailing template has been created yet. Click the + button to create one.' => 'Nessun template di e-mail è stato ancora creato. Clicca il pulsante + per crearne uno.', + 'No product attribute has been created yet. Click the + button to create one.' => 'Nessun attributo di prodotto è stato ancora creato. Clicca il pulsante + per crearne uno.', + 'No product feature has been created yet. Click the + button to create one.' => 'Nessuna caratteristica di prodotto è stata ancora creata. Clicca il pulsante + per crearne una.', + 'No product template has been created yet. Click the + button to create one.' => 'Nessun template di prodotto è stato ancora creato. Clicca il pulsante + per crearne uno.', + 'No value has been created yet. Click the + button to create one.' => 'Non è stato ancora creato alcun valore. Clicca il pulsante + per crearne uno.', + 'N° ISO' => 'N ° ISO', + 'OK' => 'OK', + 'Offline products' => 'Prodotti non in linea', + 'Online' => 'Online', + 'Online products' => 'Prodotti online', + 'Oops! An Error Occurred' => 'Caspita! Si è verificato un errore', + 'Or' => 'O', + 'Order #' => 'Ordine #', + 'Order %ref' => 'Ordine %ref', + 'Order n°' => 'Ordine n°', + 'Order status:' => 'Stati dell\'ordine:', + 'Ordered products' => 'Prodotti ordinati', + 'Orders' => 'Ordini', + 'Originating file line number ' => 'Numero di riga del file di origine ', + 'Originating file name' => 'Nome del file di origine', + 'Originating function name ' => 'Nome della funzione originale ', + 'Other addresses' => 'Altri indirizzi', + 'Overall sales' => 'Vendite complessive', + 'PDF templates' => 'Template di PDF', + 'PDF | Invoice' => 'PDF | Fattura', + 'PDF | Purchase order' => 'PDF | Ordine di acquisto', + 'Page not found' => 'Pagina non trovata', + 'Parameters' => 'Impostazioni', + 'Password' => 'Password', + 'Password :' => 'Password :', + 'Payment information' => 'Informazioni di pagamento', + 'Payment module' => 'Modulo di pagamento', + 'Payment modules' => 'Moduli di pagamento', + 'Period' => 'Periodo', + 'Phone' => 'Telefono', + 'Phone number' => 'Numero di telefono', + 'Please retry' => 'Riprovare per favore', + 'Please save your Coupon in oder to affect it some conditions' => 'Si prega di salvare il codice promozionale prima di aggiungere delle condizione. ', + 'Please select a condition category' => 'Selezionare una categoria di condizione', + 'Please select a coupon type' => 'Si prega di selezionare un tipo di codice promozionale', + 'Please select another condition' => 'Si prega di selezionare un\'altra condizione', + 'Please select items to translate' => 'Si prega di selezionare gli elementi da tradurre', + 'Please select the B.O. template to translate' => 'Si prega di selezionare il template di B.O. per iniziare la sua traduzione. ', + 'Please select the E-mail template to translate' => 'Si prega di selezionare il template di posta elettronica per tradurlo', + 'Please select the F.O. template to translate' => 'Si prega di selezionare il template di F.O. per tradurlo', + 'Please select the PDF template to translate' => 'Si prega di selezionare il template di PDF da tradurlo', + 'Please select the module to translate' => 'Si prega di selezionare il modulo per tradurlo', + 'Please wait, loading' => 'Attendere prego, caricamento', + 'Port' => 'Spedizione', + 'Port :' => 'Spedizione :', + 'Position' => 'Posizione', + 'Post Scriptum' => 'Post Scriptum', + 'Postage' => 'Spese di spedizione', + 'Postscriptum' => 'Postscriptum', + 'Preview' => 'Previsualizzare', + 'Preview category page' => 'Vedere in anteprima la pagina della categoria', + 'Preview folder page' => 'Vedere in anteprima la pagina della cartella', + 'Preview product page' => 'Vedere in anteprima la pagina del prodotto', + 'Previous month sales' => 'Vendite del mese precedente', + 'Previous year sales' => 'Vendite dell\'anno precedente', + 'Price' => 'Prezzo', + 'Price excl. taxes' => 'Prezzo tasse escl.', + 'Price incl. taxes' => 'Prezzo tasse incl.', + 'Price
w/ taxes (%currency)' => 'Prezzo< br />w/ tasse (%currency)', + 'Price
w/o taxes (%currency)' => 'Prezzo
senza tasse (%currency)', + 'Pricing' => 'Prezzi', + 'Product' => 'Prodotto', + 'Product Attributes' => 'Attributi del prodotto', + 'Product EAN Code' => 'Codice EAN del prodotto', + 'Product Features' => 'Caratteristiche del prodotto', + 'Product accessories' => 'Accessori del prodotto', + 'Product attributes' => 'Attributi del prodotto', + 'Product catalog configuration' => 'Configurazione del catalogo prodotto', + 'Product created on %date_create. Last modification: %date_change' => 'Prodotto creato il %date_create. Ultima modifica: %date_change', + 'Product features' => 'Caratteristiche del prodotto', + 'Product price' => 'Prezzo del prodotto', + 'Product price including taxes' => 'Prezzo del prodotto tasse incluse', + 'Product templates' => 'Modelli per i prodotti', + 'Product title' => 'Titolo del prodotto', + 'Product weight' => 'Peso del prodotto', + 'Products' => 'Prodotti', + 'Products in %cat' => 'Prodotti in %cat', + 'Profil' => 'Profilo', + 'Profile' => 'Profilo', + 'Profile code' => 'Codice del profilo', + 'Profile created on %date_create. Last modification: %date_change' => 'Profilo creato il %date_create. Ultima modifica: %date_change', + 'Profiles' => 'Profili', + 'Promotion' => 'Promozione', + 'Published by OpenStudio' => 'Pubblicato da OpenStudio', + 'Purpose' => 'Scopo', + 'Quantity' => 'Quantità', + 'Quickly create combinations using the combination builder' => 'Creare rapidamente delle combinazioni con il generatore integrato', + 'Rate' => 'Tasso', + 'Rate from Euro' => 'Tasso dall\'Euro', + 'Rate in €' => 'Tasso in €', + 'Read the documentation of this module' => 'Leggere la documentazione di questo modulo', + 'Reference' => 'Riferimento', + 'Registration date' => 'Data di registrazione', + 'Related content' => 'Contenuto correlato', + 'Remove an accessory' => 'Rimuovere un accessorio', + 'Remove associated folder' => 'Rimuovere la cartella associata', + 'Remove attribute' => 'Rimuovere l\'attributo', + 'Remove country' => 'Rimuovere il paese', + 'Remove feature' => 'Rimuovere la caratteristica', + 'Remove from all product templates' => 'Rimuovere da tutti i template di prodotto', + 'Remove from category' => 'Rimuovere dalla categoria', + 'Remove related content' => 'Rimuovere il contenuto correlato', + 'Remove selected values' => 'Rimuovere i valori selezionati', + 'Remove the product from this category' => 'Rimuovere il prodotto da questa categoria', + 'Remove this attribute from all product templates' => 'Rimuovere l\'attributo da tutti i template di prodotto', + 'Remove this feature from all product templates' => 'Rimuovere questa caratteristica da tutti i template di prodotto', + 'Remove zone' => 'Rimuovere la zona', + 'Resource' => 'Risorsa', + 'Resource access rights' => 'Diritti di accesso della risorse', + 'Resources' => 'Risorse', + 'Rewritten URL' => 'URL riscritto', + 'Rights' => 'Diritti', + 'SEO' => 'SEO', + 'Sale' => 'Vendita', + 'Sale price incl. taxes' => 'Prezzo vendita IVA compresa', + 'Sale price
w/ taxes (%currency)' => 'Prezzo di vendita
w/ tasse (%currency)', + 'Sale price
w/o taxes (%currency)' => 'Prezzo di vendita
w/o tasse (%currency)', + 'Sales' => 'Vendite', + 'Sales excluding shipping' => 'Vendite escluse spese di spedizione', + 'Sales statistics' => 'Statistiche di vendita', + 'Save' => 'Salvare', + 'Save and close' => 'Salvare e chiudere', + 'Save chages' => 'Salvare le modifiche', + 'Save changes' => 'Salvare le modifiche', + 'Save this address' => 'Salvare questo indirizzo', + 'Save this condition' => 'Salvare questa condizione', + 'Save your modifications' => 'Salvare le vostre modifiche', + 'Search' => 'Ricerca', + 'Select a category and click (+) to add it to the additional category list' => 'Selezionare una categoria e cliccare sul segno (+) per aggiungerla all\'elenco della categoria', + 'Select a category to get its products' => 'Seleziona una categoria per ottenere i suoi prodotti', + 'Select a category...' => 'Selezionare una categoria...', + 'Select a content and click (+) to add it to this category' => 'Selezionare un contenuto e fare clic su (+) per aggiungerlo a questa categoria', + 'Select a content and click (+) to add it to this product' => 'Selezionare un contenuto e fare clic sul segno (+) per aggiungerlo a questo prodotto', + 'Select a folder and click (+) to add it to the additional folder list' => 'Selezionare una cartella e fare clic su (+) per aggiungerla all\'elenco delle cartelle aggiuntive', + 'Select a folder content...' => 'Selezionare una cartella...', + 'Select a folder to get its content' => 'Selezionare una cartella per ottenere il suo contenuto', + 'Select a folder...' => 'Selezionare una cartella...', + 'Select a product and click (+) to add it as an accessory' => 'Selezionare un prodotto e fare clic su (+) per aggiungerlo come accessorio', + 'Select a product...' => 'Selezionare un prodotto...', + 'Select a tax tule' => 'Selezionare una regola fiscale', + 'Select a value click (+) to add it to the combination' => 'Selezionare un valore et fare clic su (+) per aggiungerlo alla combinazione', + 'Select an attribute and click (+) to add it to this template' => 'Selezionare un attributo e fare clic su (+) per aggiungerlo al template', + 'Select an attribute and click (+) to view available values' => 'Selezionare un attributo e fare clic su (+) per visualizzare i valori disponibili', + 'Select an attribute value...' => 'Selezionare un valore di attributo...', + 'Select an attribute...' => 'Selezionare un attributo...', + 'Select an feature and click (+) to add it to this template' => 'Selezionare una caratteristica e cliccare su (+) per aggiungerla al template', + 'Select an feature...' => 'Selezionare una caratteristica...', + 'Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.' => 'Selezionare i valori del attributo per combinare. Si può immettere un valore predefinito per alcuni campi delle combinazioni generate.', + 'Select here the tax applicable to this product' => 'Selezionare qui la tassa applicabile a questo prodotto', + 'Select the E-mail template you want to translate' => 'Selezionare il template di posta elettronica che desiderate tradurre', + 'Select the PDF template you want to translate' => 'Selezionare il template PDF che desiderate tradurre', + 'Select the back-office template you want to translate' => 'Selezionare il tema del back office che desiderate tradurre', + 'Select the front-office template you want to translate' => 'Selezionare il tema del front office che desiderate tradurre', + 'Select the module you want to translate' => 'Selezionare il modulo che desiderate tradurre', + 'Select which items you want to translate' => 'Selezionare gli elementi che desiderate tradurre', + 'Send a mail to this customer' => 'Inviare una mail a questo cliente', + 'Send files' => 'Inviare files', + 'Sequential number of log line' => 'Numero sequenziale della linea del log', + 'Set as default tax rule' => 'Impostare come regola fiscale predefinita', + 'Shipping configuration' => 'Configurazione di spedizione', + 'Shipping configuration name' => 'Nome della configurazione di spedizione', + 'Shipping zones' => 'Zone di spedizione', + 'Shop' => 'Negozio', + 'Shop Informations' => 'Informazioni del negozio', + 'Short conclusion' => 'Breve conclusione', + 'Short description' => 'Breve descrizione', + 'Short description :' => 'Breve descrizione :', + 'Show logs' => 'Visualizzare i log', + 'Some of your translations are not saved. Continue anyway ?' => 'Alcune delle vostre traduzioni non vengono salvati. Continuare comunque ?', + 'Sorry, attribute ID=%id was not found.' => 'Siamo spiacenti, l\'attributo ID = %id non è stato trovato.', + 'Sorry, country ID=%id was not found.' => 'Ci dispiace, paese ID=%id non è stato trovato.', + 'Sorry, currency ID=%id was not found.' => 'Ci dispiace, la moneta ID=%id non è stata trovata.', + 'Sorry, customer ID=%id was not found.' => 'Ci dispiace, il cliente ID=%id non è stato trovato.', + 'Sorry, document ID=%id was not found.' => 'Ci dispiace, il documento ID=%id non è stato trovato.', + 'Sorry, feature ID=%id was not found.' => 'Ci dispiace, la caratteristica ID=%id non è stata trovata.', + 'Sorry, image ID=%id was not found.' => 'Ci dispiace, l\'immagine ID=%id non è stata trovata.', + 'Sorry, message ID=%id was not found.' => 'Ci dispiace, il messaggio ID=%id non è stato trovato.', + 'Sorry, template ID=%id was not found.' => 'Ci dispiace, il template ID=%id non è stato trovato.', + 'Sorry, variable ID=%id was not found.' => 'Ci dispiace, la variabile ID=%id non è stata trovata.', + 'Source IP' => 'IP di origine', + 'Source IP :' => 'IP di origine :', + 'Status' => 'Stato', + 'Stock' => 'Magazzino', + 'Store' => 'Negozio', + 'Store Business Identification Number (SIRET, etc).' => 'Memorizzare il numero di identificazione del Business (SIRET, ecc).', + 'Store address' => 'Indirizzo del negozio', + 'Store configuration' => 'Configurazione del negozio', + 'Street address' => 'Indirizzo', + 'Subject' => 'Oggetto', + 'Superadministrator' => 'Superamministratore', + 'Symbol' => 'Simbolo', + 'System Logs' => 'Log di sistema', + 'System Logs configuration' => 'Configurazione dei log di sistema', + 'System logs' => 'Log di sistema', + 'System parameters' => 'Parametri del sistema', + 'System variables' => 'Variabili del sistema', + 'Tax' => 'Tassa', + 'Tax created on %date_create. Last modification: %date_change' => 'Tassa creata il %date_create. Ultima modifica: %date_create', + 'Tax rule created on %date_create. Last modification: %date_change' => 'Regola fiscale creata il %date_create. Ultima modifica: %date_change', + 'Tax rule taxes will be update for the following countries :' => 'Regola fiscale sarà aggiornata per i seguenti paesi:', + 'Tax rules' => 'Regole fiscale', + 'Tax rules are combination of different taxes.' => 'Regole fiscale sono combinazione di diverse tasse.', + 'Taxed total' => 'Totale tassato', + 'Taxes' => 'Tasse', + 'Taxes define the amount of money which is added to a bought product.' => 'Tasse definiscono la quantità di denaro che viene aggiunto a un prodotto acquistato.', + 'Taxes rules' => 'Regole fiscale', + 'Template name' => 'Nome del template', + 'Template title' => 'Titolo del template', + 'Templates' => 'Template', + 'Text version of this message' => 'Versione del testo di questo messaggio', + 'The HTML TITLE element is the most important element on your web page.' => 'Il HTML TITLE è l\'elemento più importante nella tua pagina web.', + 'The default pricing is used when no combination is defined.' => 'Il prezzo predefinito viene utilizzato quando non è definita nessuna combinazione.', + 'The destinations processes logs to display, store or send them. You can select and configure zero, one or more destinations below.' => 'Le destinazioni dei log da visualizzare, memorizzare o inviare. È possibile selezionare e configurare zero, una o più destinazioni qui sotto.', + 'The detailed description.' => 'La descrizione dettagliata.', + 'The mailing template in HTML format.' => 'Il template del e-mail in formato HTML.', + 'The mailing template in text-only format.' => 'Il template del e-mail in formato testo solo.', + 'The page you\'ve requested was not found. Please check the page address, and try again.' => 'La pagina che avete richiesto non è stata trovata. La pregiamo di controllare l\'indirizzo della pagina e riprovare.', + 'The rate from Euro (Price in Euro * rate = Price in this currency)' => 'Il tasso del Euro (prezzo in Euro * tasso = prezzo in questa moneta)', + 'The server returned a "404 Not Found"' => 'Il server ha restituito un "404 Not Found"', + 'The symbol, such as $, £, €...' => 'Il simbolo, ad esempio $, £, €...', + 'The syntax used is identical to the PHP date() function' => 'La sintassi utilizzata è identica alla funzione PHP date()', + 'Thelia Back Office' => 'Thelia Back Office', + 'Thelia Languages' => 'Lingue di Thelia', + 'Thelia Mailing System' => 'Sistema di Mailing Thelia', + 'Thelia Mailing Templates' => 'Thelia Mailing Templates', + 'Thelia Product Attributes' => 'Attributi di prodotto Thelia', + 'Thelia Product Features' => 'Caratteristiche del prodotto Thelia', + 'Thelia Product Templates' => 'Template dei prodotti Thelia', + 'Thelia Shipping configuration' => 'Configurazione delle spedizione', + 'Thelia Shipping zones' => 'Zone di spedizione di Thelia', + 'Thelia System Variables' => 'Variabili di sistema Thelia', + 'Thelia configuration' => 'Configurazione di Thelia', + 'Thelia contributions' => 'Contributi Thelia', + 'Thelia core' => 'Thelia core', + 'Thelia informations' => 'Thelia informazioni', + 'Thelia mailing templates' => 'Thelia mailing templates', + 'Thelia product attributes' => 'Attributi di prodotto Thelia', + 'Thelia product features' => 'Caratteristiche dei prodotti', + 'Thelia product templates' => 'Template dei prodotti', + 'Thelia support forum' => 'Forum di supporto Thelia ', + 'Thelia system variables' => 'Variabili di sistema Thelia', + 'Thelia, the open source e-commerce solution' => 'Thelia, la soluzione di e-commercio open source', + 'There is no documents attached to this %type.' => 'Non c\'è nessun documento associato a questo %type.', + 'There is no images attached to this %type.' => 'Non c\'è nessuna immagine associata a questo %type.', + 'They are some administrator which are linked to this administrator. Please edit/remove them before deleting this administrator.' => 'Ci sono qualche amministratore che sono collegati a questo amministratore. Per favore modificarli/rimuoverli prima di rimuovere questo amministratore.', + 'They are some administrator which are linked to this profile. Please edit/remove them before deleting this profile.' => 'Ci sono qualche amministratore che sono collegati a questo profilo. Per favore modificarli/rimuoverli prima di rimuovere questo profilo.', + 'This category contains no contents' => 'Questa categoria non contiene nessun contenuto', + 'This category doesn\'t contains any products. To add a new product, click the + button above.' => 'Questa categoria non contiene alcun prodotto. Per aggiungere un nuovo prodotto, cliccare il pulsante + qui sopra.', + 'This category has no sub-categories.' => 'Questa categoria non ha nessun sotto-categorie.', + 'This category has no sub-categories. To create a new one, click the + button above.' => 'Questa categoria non ha nessun sotto-categorie. Per crearne una nuovo, cliccare sul pulsante + qui sopra.', + 'This coupon is disabled, you can enable at the bottom of this form.' => 'Questo codice promozionale è disattivato, è possibile attivarlo alla fine di questo formulario.', + 'This customer has not defined any delivery address' => 'Questo cliente non ha definito alcun indirizzo di consegna', + 'This folder doesn\'t contains any contents. To add a new content, click the + button above.' => 'Questa cartella non contiene alcun contenuto. Per aggiungere un nuovo contenuto, cliccare il pulsante + qui sopra.', + 'This folder has no sub-folders.' => 'Questa cartella non a sottocartelle.', + 'This folder has no sub-folders. To create a new one, click the + button above.' => 'Questa cartella non ha sottocartelle. Per crearne una nuovo, fare clic sul pulsante + qui sopra.', + 'This is the message purpose, such as \'Order confirmation\'.' => 'Questo è lo scopo del messaggio, ad esempio \'Conferma dell\'ordine\'.', + 'This is the subject of the e-mail, such as \'Your order is confirmed\'.' => 'Questo è l\'oggetto dell\'e-mail, come \'l\'ordine è confermato\'.', + 'This mailing template could not be changed.' => 'Questo template di e-mail non potrebbe essere cambiato.', + 'This month' => 'Questo mese', + 'This product contains no accessories' => 'Questo prodotto non contiene accessori', + 'This product contains no contents' => 'Questo prodotto non contiene nessun contenuto', + 'This product doesn\'t belong to any additional category.' => 'Questo prodotto non appartiene ad alcuna categoria supplementare.', + 'This product doesn\'t belong to any additional folder.' => 'Questo prodotto non appartiene ad alcuna cartella aggiuntiva.', + 'This product template does not contains any features' => 'Questo template di prodotto non contiene alcune caratteristiche', + 'This template contains no attributes' => 'Questo template non contiene attributi', + 'This template contains no features' => 'Questo template non contiene caratteristiche', + 'This the unique name of this message. Do not change this value unless you understand what you do.' => 'Questo è il nome unico di questo messaggio. Non modificare questo valore a meno che non si capisce cosa fare.', + 'This variable could not be changed.' => 'Questa variabile non potrebbe essere cambiata.', + 'This year' => 'Quest\'anno', + 'Timeout' => 'Timeout', + 'Timeout :' => 'Timeout :', + 'Title' => 'Titolo', + 'Title :' => 'Titolo :', + 'To' => 'A', + 'To create a new content, select an existing folder, or create a new one.' => 'Per creare un nuovo contenuto, selezionare una cartella esistente o crearne una nuova.', + 'To create a new product, select an existing category, or create a new one.' => 'Per creare un nuovo prodotto, selezionare una categoria esistente o crearne uno nuovo.', + 'To remove a value from the combination, select it and click "remove"' => 'Per rimuovere un valore dalla combinazione, selezionarlo e fare un clic su "Rimuovere"', + 'Today' => 'Oggi', + 'Top level' => 'Livello superiore', + 'Top level Contents' => 'Contenuti di livello superiore', + 'Top level Products' => 'Prodotti di livello superiore', + 'Top level categories' => 'Categorie di livello superiore', + 'Top level folders' => 'Cartelle di livello superiore', + 'Total' => 'Totale', + 'Total including discount' => 'Totale sconto compreso', + 'Total without discount' => 'Totale senza sconto', + 'Transaction reference' => 'Riferimento di transazione', + 'Translation' => 'Traduzione', + 'Translations' => 'Traduzione', + 'Type :' => 'Tipo :', + 'Unit taxed price' => 'Prezzo unitario tassato', + 'Unit. price' => 'Prezzo unitario', + 'Unlimited' => 'Illimitato', + 'Update' => 'Aggiornamento', + 'Update an administrator' => 'Aggiornare un amministratore', + 'Update coupon' => 'Aggiornare un codice promozionale', + 'Update rates' => 'Aggiornare le tariffe', + 'Update tax rule taxes' => 'Aggiornare le regole fiscale', + 'Update this image' => 'Aggiornare questa immagine', + 'Usage left' => 'Uso sinistra', + 'Use Ctrl+click to select more than one value. You can also clear selected values.' => 'Utilizzare Ctrl + clic per selezionare più valori. Potete anche cancellare i valori selezionati.', + 'Use HTML message defined below' => 'Utilizzare il messaggio HTML definito di seguito', + 'Use Text message defined below' => 'Utilizzare il messaggio di testo definito qui sotto', + 'Use address by default' => 'Utilizzare l\'indirizzo come indirizzo predefinito', + 'Use default layout' => 'Utilizzare il layout predefinito', + 'Use the keyword phrase in your URL.' => 'Utilizzare la frase chiave nell\'URL.', + 'Use this address by default' => 'Utilizzare questo indirizzo come indirizzo predefinito', + 'Used in your store front' => 'Utilizzate nel vostro negozio', + 'Username' => 'Nome utente', + 'Username :' => 'Nome utente :', + 'Using a domain or subdomain for each language' => 'Utilizzando un dominio o un sottodominio per ogni lingua', + 'Value' => 'Valore', + 'Variable created on %date_create. Last modification: %date_change' => 'Variabile creata il %date_create. Ultima modifica: %date_change', + 'Variable name' => 'Nome della variabile', + 'Variable purpose' => 'Scopo della variabile', + 'Variable value' => 'Valore della variabile', + 'Version %ver' => 'Versione %ver', + 'View' => 'Vedere', + 'View only missing translations' => 'Vedere solo le traduzione mancante', + 'View shop' => 'Vedere il negozio', + 'View site' => 'Visualizzare il sito', + 'Visibility' => 'Visibilità', + 'Warning' => 'Attenzione', + 'Weight
(Kg)' => 'Peso
(Kg)', + 'Welcome' => 'Benvenuto', + 'Will be available on special offers' => 'Sarà disponibile su offerte speciali', + 'Will remove postage' => 'Rimuoverà le spese di spedizione', + 'Won\'t be available on special offers' => 'Non sarà disponibile su offerte speciali', + 'Won\'t remove postage' => 'Non rimuovere le spese di spedizione', + 'Yes' => 'Sì', + 'Yesterday sales' => 'Vendite di ieri', + 'You can attach here some content to this category' => 'Potete allegare qui alcuni contenuti a questa categoria', + 'You can attach here some content to this product' => 'È possibile allegare qui alcuni contenuti a questo prodotto', + 'You can attach this product to more categories in the details tab.' => 'È possibile collegare questo prodotto a più categorie nella scheda dettagli.', + 'You can change the default category (%title) in the "General" tab.' => 'È possibile modificare la categoria predefinita (%title) nella scheda "Generale".', + 'You can change the default folder (%title) in the "General" tab.' => 'È possibile modificare la cartella predefinita (%title) nella scheda "Generale".', + 'You can\'t delete this administrator' => 'Non è possibile eliminare questo amministratore', + 'You can\'t delete this profile' => 'Non è possibile eliminare questo profilo', + 'You don\'t need to use commas or other punctuations.' => 'Non è necessario utilizzare virgole o altri segni di interpunzione.', + 'Your current IP address is %ip' => 'Il vostro indirizzo IP è %ip', + 'Zip code' => 'Codice postale', + 'Zones' => 'Zone', + 'activate' => 'attivare', + 'activate %title module' => 'attivare il modulo %title', + 'activation' => 'attivazione', + 'and' => 'e', + 'classic modules' => 'moduli classici', + 'code' => 'codice', + 'company' => 'azienda', + 'customer ref' => 'rif cliente', + 'd-m-Y' => 'd-m-Y', + 'date form' => 'date form', + 'date in yyyy-mm-dd format' => 'Data nel formato aaaa-mm-gg', + 'days left' => 'giorni andati', + 'deactivate' => 'disattivare', + 'deactivation' => 'disattivazione', + 'en_US' => 'en_US', + 'firstname & lastname' => 'nome e cognome', + 'hour in hh:mm:ss format' => 'ora nel formato hh:mm:ss', + 'last order' => 'ultimo ordine', + 'long description' => 'descrizione lunga', + 'max usage' => 'utilizzo max', + 'order amount' => 'quantità di ordine', + 'orders for this customer' => 'ordini per questo cliente', + 'short description' => 'breve descrizione', + 'tax rules' => 'regole fiscale', + 'taxes' => 'tasse', + 'time form' => 'forma del tempo', + 'title' => 'titolo', + 'tracking reference' => 'riferimento di rilevamento', + 'uncheck all' => 'Deselezionare tutto', + 'you can combine taxes in tax rules and chose if they are applied one after the other or at the same time : it allows to apply taxes on an already taxed price or not.' => 'è possibile combinare le imposte in regole fiscale e scegliere se sono applicati uno dopo l\'altro o allo stesso tempo: permette di applicare tasse su un prezzo già tassato o no.', + 'yyyy-mm-dd' => 'yyyy-mm-dd', +); diff --git a/templates/backOffice/default/I18n/ru_RU.php b/templates/backOffice/default/I18n/ru_RU.php new file mode 100644 index 000000000..207cc1e71 --- /dev/null +++ b/templates/backOffice/default/I18n/ru_RU.php @@ -0,0 +1,5 @@ + @@ -87,7 +90,7 @@
{loop type="lang" name="ui-lang" id="{lang attr='id'}"} {/loop} @@ -162,9 +165,9 @@ {loop name="order-status-list" type="order-status"} {assign "orderStatusLabel" "order_$CODE"}
  • - + {$TITLE} - {count type="order" customer="*" backend_context="1" status=$ID} + {count type="order" customer="*" backend_context="1" status={$ID}}
  • {/loop} @@ -184,26 +187,28 @@ {/loop} - {loop name="menu-auth-coupon" type="auth" role="ADMIN" resource="admin.coupon" access="VIEW"} -
  • - {intl l="Coupons"} + {loop name="menu-auth-tools" type="auth" role="ADMIN" resource="admin.tools" access="VIEW"} +
  • + {intl l="Tools"}
  • {/loop} - {loop name="menu-auth-config" type="auth" role="ADMIN" resource="admin.config" access="VIEW"} + {loop name="menu-auth-modules" type="auth" role="ADMIN" resource="admin.module" access="VIEW"} +
  • + {intl l="Modules"} +
  • + {/loop} + + {loop name="menu-auth-config" type="auth" role="ADMIN" resource="admin.configuration" access="VIEW"}
  • {intl l="Configuration"}
  • {/loop} - {loop name="menu-auth-modules" type="auth" role="ADMIN" resource="admin.module" access="VIEW"} -
  • - {intl l="Modules"} -
  • {module_include location='in_top_menu_items'} - {/loop} + {loop name="top-bar-search" type="auth" role="ADMIN" resource="admin.search" access="VIEW"} diff --git a/templates/backOffice/default/administrators.html b/templates/backOffice/default/administrators.html index 9bec35ee3..333b38f45 100644 --- a/templates/backOffice/default/administrators.html +++ b/templates/backOffice/default/administrators.html @@ -27,7 +27,7 @@
    - + -
    -
    -
    -
    -
    - {intl l="Taxes"} + {intl l="Administrators"} {loop type="auth" name="can_create" role="ADMIN" resource="admin.administrator" access="CREATE"} @@ -48,15 +48,27 @@ {loop type="admin" name="administrators" backend_context="1"} + {* the current current admin can always update its own profile *} + {$can_update = $ID == {admin attr="id"}} + {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.administrator" access="UPDATE"} + {$can_update = true} + {/loop} +
    {$LOGIN} + {if $can_update} + {$LOGIN} + {else} + {$LOGIN} + {/if} + {$FIRSTNAME} {$LASTNAME} {$LOCALE} - {if $PROFILE} - {loop type="profile" name="admin-profile" id=$PROFILE} - {$TITLE} + {if $PROFILE} + {loop type="profile" name="admin-profile" id={$PROFILE}} + {$TITLE} {/loop} {else} {intl l='Superadministrator'} @@ -68,12 +80,11 @@ - can UPDATE anyway - cannot delete himself *} - {if $ID == {admin attr="id"}} + {if $can_update} - {else} - {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.administrator" access="UPDATE"} - - {/loop} + {/if} + + {if $ID != {admin attr="id"}} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.administrator" access="DELETE"} {/loop} @@ -114,21 +125,21 @@ {form_field form=$form field='login'}
    - +
    {/form_field} {form_field form=$form field='firstname'}
    - +
    {/form_field} {form_field form=$form field='lastname'}
    - +
    {/form_field} @@ -139,21 +150,21 @@ {form_field form=$form field='password'}
    - +
    {/form_field} {form_field form=$form field='password_confirm'}
    - +
    {/form_field} {form_field form=$form field='locale'}
    - + {foreach $choices as $choice} @@ -182,7 +193,7 @@
    {/form_field} - + {module_include location='administrator_create_form'} {/capture} {include @@ -218,21 +229,21 @@ {form_field form=$form field='login'}
    - +
    {/form_field} {form_field form=$form field='firstname'}
    - +
    {/form_field} {form_field form=$form field='lastname'}
    - +
    {/form_field} @@ -243,21 +254,21 @@ {form_field form=$form field='password'}
    - +
    {/form_field} {form_field form=$form field='password_confirm'}
    - +
    {/form_field} {form_field form=$form field='locale'}
    - + {foreach $choices as $choice} @@ -286,7 +297,7 @@
    {/form_field} - + {module_include location='administrator_update_form'} {/capture} {include @@ -374,7 +385,7 @@ jQuery(function($) { var fieldValue = $(v).text(); } - $('.' + $(v).data('field-class')).val(fieldValue); + $('.' + $(v).data('field-class')).val($.trim(fieldValue)); if($('.' + $(v).data('field-class')).is('select')) { $('.' + $(v).data('field-class')).selectpicker('refresh'); } @@ -387,4 +398,4 @@ jQuery(function($) { {block name="javascript-last-call"} {module_include location='administrators-js'} -{/block} \ No newline at end of file +{/block} diff --git a/templates/backOffice/default/advanced-configuration.html b/templates/backOffice/default/advanced-configuration.html new file mode 100644 index 000000000..ef21fad37 --- /dev/null +++ b/templates/backOffice/default/advanced-configuration.html @@ -0,0 +1,72 @@ +{extends file="admin-layout.tpl"} + +{block name="page-title"}{intl l='Advanced configuration'}{/block} + +{block name="check-resource"}admin.cache{/block} +{block name="check-access"}view{/block} + +{block name="main-content"} +
    + +
    + + + +
    + +
    + +
    +
    + {intl l='Thelia caches flushing'} +
    +
    + +
    +
    + {form name="thelia.cache.flush"} + + {form_hidden_fields form=$form} + +
    + +
    + + {/form} +
    + +
    + + {form name="thelia.assets.flush"} +
    + {form_hidden_fields form=$form} + +
    + +
    +
    + {/form} +
    + +
    + + {form name="thelia.images-and-documents-cache.flush"} +
    + {form_hidden_fields form=$form} + +
    + +
    +
    + {/form} +
    +
    +
    +
    +
    +
    +{/block} diff --git a/templates/backOffice/default/ajax/language-update-modal.html b/templates/backOffice/default/ajax/language-update-modal.html index cc40933a9..8727e6911 100644 --- a/templates/backOffice/default/ajax/language-update-modal.html +++ b/templates/backOffice/default/ajax/language-update-modal.html @@ -1,3 +1,6 @@ +{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *} +{default_translation_domain domain='bo.default'} + {* Update an Address *} {form name="thelia.lang.update"} @@ -18,7 +21,7 @@
    - {intl l='Check the list of ISO 639-1 codes'} + {intl l='Check the list of ISO 639-1 codes'}
    {/form_field} @@ -44,6 +47,27 @@ {intl l='The syntax used is identical to the PHP date() function'} {/form_field} + {form_field form=$form field='decimal_separator'} +
    + + + {intl l='Sets the separator for the decimal point'} +
    + {/form_field} + {form_field form=$form field='thousands_separator'} +
    + + + {intl l='Sets the thousands separator.'} +
    + {/form_field} + {form_field form=$form field='decimals'} +
    + + + {intl l='Sets the number of decimal points'} +
    + {/form_field} diff --git a/templates/backOffice/default/ajax/product-attributes-tab.html b/templates/backOffice/default/ajax/product-attributes-tab.html index 25cdc502a..9e1d56feb 100644 --- a/templates/backOffice/default/ajax/product-attributes-tab.html +++ b/templates/backOffice/default/ajax/product-attributes-tab.html @@ -1,3 +1,6 @@ +{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *} +{default_translation_domain domain='bo.default'} + {loop name="product_edit" type="product" visible="*" id=$product_id backend_context="1" lang=$edit_language_id}
    diff --git a/templates/backOffice/default/ajax/product-related-tab.html b/templates/backOffice/default/ajax/product-related-tab.html index edaa101a9..89b7b554d 100644 --- a/templates/backOffice/default/ajax/product-related-tab.html +++ b/templates/backOffice/default/ajax/product-related-tab.html @@ -1,3 +1,6 @@ +{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *} +{default_translation_domain domain='bo.default'} + {loop name="product_edit" type="product" visible="*" id=$product_id backend_context="1" lang=$edit_language_id}
    @@ -266,7 +269,7 @@

    {intl l='Additional categories'}

    {intl l='A product could be attached to more than one category. Select here the additional categories for this product.'} {loop name="default_category" type="category" id=$DEFAULT_CATEGORY} - {intl l='You can change the default category (%title) in the "General" tab.' title=$TITLE} + {intl l='You can change the default category (%title) in the "General" tab.' title={$TITLE}} {/loop} {$exclude_from_tree = "-1"} @@ -557,12 +560,12 @@ $(function() { } }); - // Initialize folder (id={$folder_id}) select value + // Initialize folder select value {if $folder_id != 0} $('#folder_id').val("{$folder_id}").change(); {/if} - // Initialize accessory category id (id={$accessory_category_id}) select value + // Initialize accessory category id select value {if $accessory_category_id != 0} $('#accessory_category_id').val("{$accessory_category_id}").change(); {/if} diff --git a/templates/backOffice/default/ajax/template-attribute-list.html b/templates/backOffice/default/ajax/template-attribute-list.html index 619d13d53..f9ee7737e 100644 --- a/templates/backOffice/default/ajax/template-attribute-list.html +++ b/templates/backOffice/default/ajax/template-attribute-list.html @@ -1,3 +1,6 @@ +{* Set the default translation domain, that will be used by intl when the 'd' parameter is not set *} +{default_translation_domain domain='bo.default'} +

    {ifloop rel="free_attributes"}
    @@ -21,7 +24,7 @@ {/ifloop} {elseloop rel="free_attributes"} -
    There is currently no available attributes.
    +
    {intl l="There is currently no available attributes."}
    {/elseloop}
    diff --git a/templates/backOffice/default/ajax/template-feature-list.html b/templates/backOffice/default/ajax/template-feature-list.html index 24b50918e..8c7cd04f8 100644 --- a/templates/backOffice/default/ajax/template-feature-list.html +++ b/templates/backOffice/default/ajax/template-feature-list.html @@ -1,3 +1,6 @@ +{* Set the default translation domain, that will be used by intl when the 'd' parameter is not set *} +{default_translation_domain domain='bo.default'} +
    {ifloop rel="free_features"} @@ -6,7 +9,7 @@
    - {intl l=$TITLE} + {intl l={$TITLE}}
    -
    {intl l="Enter here the value in the current edit language (%title)" title=$TITLE}
    +
    {intl l="Enter here the value in the current edit language (%title)" title={$TITLE}}
    {form_field form=$form field='locale'} @@ -259,6 +259,8 @@ {capture "delete_dialog"} + + {module_include location='attribute_id_delete_form'} {/capture} {include diff --git a/templates/backOffice/default/attributes.html b/templates/backOffice/default/attributes.html index 1994c2e76..984dad6d5 100644 --- a/templates/backOffice/default/attributes.html +++ b/templates/backOffice/default/attributes.html @@ -166,10 +166,10 @@ {loop type="lang" name="default-lang" default_only="1"}
    - {intl l=$TITLE} + {$TITLE}
    -
    {intl l="Enter here the attribute name in the default language (%language_name)" language_name=$TITLE}
    +
    {intl l="Enter here the attribute name in the default language (%language_name)" language_name={$TITLE}}
    {* Switch edition to the current locale *} diff --git a/templates/backOffice/default/categories.html b/templates/backOffice/default/categories.html index a0b43145c..3cf007adf 100644 --- a/templates/backOffice/default/categories.html +++ b/templates/backOffice/default/categories.html @@ -22,7 +22,7 @@
    {* display parent category name, and get current cat ID *} {loop name="category_title" type="category" visible="*" id=$category_id} - {intl l="Categories in %cat" cat=$TITLE} + {intl l="Categories in %cat" cat={$TITLE}} {$cat_id = $ID} {/loop} {elseloop rel="category_title"} @@ -192,7 +192,7 @@ {* display parent category name *} {loop name="category_title" type="category" visible="*" id=$category_id} - {intl l="Products in %cat" cat=$TITLE} + {intl l="Products in %cat" cat={$TITLE}} {/loop} {elseloop rel="category_title"} @@ -472,29 +472,7 @@ {/form_field} - {form_field form=$form field='price'} -
    - - {loop type="currency" name="default-currency" default_only="1" backend_context="1"} -
    -
    -
    - - {$SYMBOL} -
    -
    -
    - -
    {intl l='Enter here the product price in the default currency (%title)' title=$NAME}
    - - {form_field form=$form field='currency'} - - {/form_field} - - {/loop} -
    - {/form_field} {form_field form=$form field='tax_rule'}
    @@ -513,6 +491,49 @@
    {/form_field} + {form_field form=$form field='price'} +
    + + {loop type="currency" name="default-currency" default_only="1" backend_context="1"} + +
    +
    +
    + + {$SYMBOL} +
    +
    +
    + +
    {intl l='Enter here the product price in %title' title={$NAME}}
    + + {form_field form=$form field='currency'} + + {/form_field} + + {/loop} +
    + {/form_field} + + {form_field form=$form field='tax_price'} +
    + + {loop type="currency" name="default-currency" default_only="1" backend_context="1"} + +
    +
    +
    + + {$SYMBOL} +
    +
    +
    + +
    {intl l='Enter here the product tax price in %title' title={$NAME}}
    + {/loop} +
    + {/form_field} + {form_field form=$form field='weight'}
    @@ -520,7 +541,7 @@
    - + {intl l="Kg"}
    @@ -611,7 +632,9 @@ {javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'} {/javascripts} - + {javascripts file='assets/js/jquery.typewatch.js'} + + {/javascripts} {/block} diff --git a/templates/backOffice/default/category-edit.html b/templates/backOffice/default/category-edit.html index 8f3fc4e40..af50e6c14 100644 --- a/templates/backOffice/default/category-edit.html +++ b/templates/backOffice/default/category-edit.html @@ -26,7 +26,7 @@
    - {intl l='Edit category %title' title=$TITLE} + {intl l='Edit category %title' title={$TITLE}}
    @@ -271,13 +271,8 @@ }
    - {module_include location='category-edit' countvar='module_count'} + {include file="includes/module-tab-content.html" location="category-edit"} - {if $countvar == 0} -
    - {intl l="There is currently no active module here."} -
    - {/if}
    @@ -385,7 +380,7 @@ $(function() { } }); - // Initialize folder (id={$folder_id}) select value + // Initialize folder select value {if $folder_id != 0} $('#folder_id').val("{$folder_id}").change(); {/if} diff --git a/templates/backOffice/default/config-store.html b/templates/backOffice/default/config-store.html index f6f300ddb..2cebd7664 100644 --- a/templates/backOffice/default/config-store.html +++ b/templates/backOffice/default/config-store.html @@ -143,7 +143,7 @@
    diff --git a/templates/backOffice/default/configs/variables.conf b/templates/backOffice/default/configs/variables.conf index d80dba5f7..c2c81c01d 100644 --- a/templates/backOffice/default/configs/variables.conf +++ b/templates/backOffice/default/configs/variables.conf @@ -1,7 +1,11 @@ -#order +# Maximum number of lines in lists +# -------------------------------- max_displayed_orders = 20 +max_displayed_customers = 20 + +# order status - seems ununsed ? +# ------------------------------ -#order status order_not_paid = 'warning' order_paid = 'success' order_processing = 'primary' diff --git a/templates/backOffice/default/configuration.html b/templates/backOffice/default/configuration.html index 1560cd332..2379c6432 100644 --- a/templates/backOffice/default/configuration.html +++ b/templates/backOffice/default/configuration.html @@ -1,195 +1,206 @@ -{extends file="admin-layout.tpl"} - -{block name="page-title"}{intl l='Configuration'}{/block} - -{block name="check-resource"}admin.configuration{/block} -{block name="check-access"}view{/block} - -{block name="main-content"} -
    - -
    - - {module_include location='configuration_top'} - -

    {intl l="Thelia configuration"}

    - -
    - -
    - -
    - -
    - -
    - -
    - -
    - - {module_include location='configuration_bottom'} -
    -
    -
    -{/block} - -{block name="javascript-last-call"} - {module_include location='configuration-js'} +{extends file="admin-layout.tpl"} + +{block name="page-title"}{intl l='Configuration'}{/block} + +{block name="check-resource"}admin.configuration{/block} +{block name="check-access"}view{/block} + +{block name="main-content"} +
    + +
    + + + + {module_include location='configuration_top'} + +
    + +
    + +
    + +
    + +
    + +
    + +
    + + {module_include location='configuration_bottom'} +
    +
    +
    +{/block} + +{block name="javascript-last-call"} + {module_include location='configuration-js'} {/block} \ No newline at end of file diff --git a/templates/backOffice/default/content-edit.html b/templates/backOffice/default/content-edit.html index 49c8f6b66..87570e8a6 100644 --- a/templates/backOffice/default/content-edit.html +++ b/templates/backOffice/default/content-edit.html @@ -7,190 +7,184 @@ {block name="main-content"}
    -
    +
    - {include file="includes/folder-breadcrumb.html" editing_content="true"} - -
    - {loop name="content_edit" type="content" visible="*" id="{$content_id}" backend_context="1" lang="$edit_language_id"} -
    -
    -
    - {intl l='Edit content %title' title=$TITLE} -
    - -
    - - {if $HAS_PREVIOUS != 0} - - {else} - - {/if} - - - - {if $HAS_NEXT != 0} - - {else} - - {/if} -
    -
    - -
    -
    - - - -
    - -
    - -
    - - {form name="thelia.admin.content.modification"} - - - {include file="includes/inner-form-toolbar.html" close_url="{url path='/admin/folders' parent=$DEFAULT_FOLDER}"} - - {* Be sure to get the folder ID, even if the form could not be validated *} - - - - - {form_hidden_fields form=$form} - - {form_field form=$form field='success_url'} - - {/form_field} - - {form_field form=$form field='locale'} - - {/form_field} - - {if $form_error}
    {$form_error_message}
    {/if} + {include file="includes/folder-breadcrumb.html" editing_content="true"} +
    + {loop name="content_edit" type="content" visible="*" id="{$content_id}" backend_context="1" lang="$edit_language_id"} +
    -
    - {include file="includes/standard-description-form-fields.html"} +
    + {intl l='Edit content %title' title={$TITLE}}
    -
    +
    - {form_field form=$form field='default_folder'} -
    + {if $HAS_PREVIOUS != 0} + + {else} + + {/if} - + - -
    - {/form_field} - - {form_field form=$form field='visible'} -
    - -
    - -
    -
    - {/form_field} + {if $HAS_NEXT != 0} + + {else} + + {/if}
    - {include - file="includes/inner-form-toolbar.html" - hide_submit_buttons = false - hide_flags = true +
    +
    - close_url="{url path='/admin/folders' parent=$DEFAULT_FOLDER}" - } + - {intl l='Folder created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"} +
    - - {/form} +
    + +
    + + {form name="thelia.admin.content.modification"} +
    + + {include file="includes/inner-form-toolbar.html" close_url="{url path='/admin/folders' parent=$DEFAULT_FOLDER}"} + + {* Be sure to get the folder ID, even if the form could not be validated *} + + + + + {form_hidden_fields form=$form} + + {form_field form=$form field='success_url'} + + {/form_field} + + {form_field form=$form field='locale'} + + {/form_field} + + {if $form_error} +
    {$form_error_message}
    {/if} + +
    +
    + {include file="includes/standard-description-form-fields.html"} +
    + +
    + + {form_field form=$form field='default_folder'} +
    + + + + +
    + {/form_field} + + {form_field form=$form field='visible'} +
    + + +
    + +
    +
    + {/form_field} +
    +
    + + {include + file="includes/inner-form-toolbar.html" + hide_submit_buttons = false + hide_flags = true + + close_url="{url path='/admin/folders' parent=$DEFAULT_FOLDER}" + } + + {intl l='Folder created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"} + +
    + {/form} +
    +
    + +
    + {form name="thelia.admin.seo"} + {include file="includes/seo-tab.html" + form = $form + formAction = "{url path='/admin/content/seo/save'}" + closeUrl = "{url path='/admin/folders' parent=$DEFAULT_FOLDER}" + current_id = $content_id + } + {/form} +
    + +
    + {include file="includes/content-folder-management.html"} +
    + +
    + {include file='includes/image-upload-form.html' imageType='content' parentId=$content_id} +
    + +
    + {include file='includes/document-upload-form.html' documentType='content' parentId=$content_id} +
    + +
    +
    + {include + file = "includes/inner-form-toolbar.html" + hide_submit_buttons = true + page_url = {$pageUrl} + close_url = {$closeUrl} + current_tab = "modules" + } +
    + + {include file="includes/module-tab-content.html" location="content-edit"} +
    +
    +
    +
    +
    + {/loop}
    - -
    - {form name="thelia.admin.seo"} - {include file="includes/seo-tab.html" - form = $form - formAction = "{url path='/admin/content/seo/save'}" - closeUrl = "{url path='/admin/folders' parent=$DEFAULT_FOLDER}" - current_id = $content_id - } - {/form} -
    - -
    - {include file="includes/content-folder-management.html"} -
    - -
    - {include file='includes/image-upload-form.html' imageType='content' parentId=$content_id} -
    - -
    - {include file='includes/document-upload-form.html' documentType='content' parentId=$content_id} -
    - -
    -
    - {include - file = "includes/inner-form-toolbar.html" - hide_submit_buttons = true - page_url = {$pageUrl} - close_url = {$closeUrl} - current_tab = "modules" - } -
    - - {module_include location='content-edit' countvar='module_count'} - - {if $countvar == 0} -
    - {intl l="There is currently no active module here."} -
    - {/if} -
    -
    -
    -
    -
    - {/loop}
    -
    -
    - - -{* Delete category confirmation dialog *} + {* Delete category confirmation dialog *} {capture "delete_folder_dialog"} - - - - + + + {/capture} {include @@ -220,9 +214,10 @@ form_content = {$smarty.capture.delete_folder_dialog nofilter} {javascripts file='assets/js/jquery-ui-1.10.3.custom.min.js'} {/javascripts} - diff --git a/templates/backOffice/default/coupon-list.html b/templates/backOffice/default/coupon-list.html index 50d4ee5cb..30a3327b7 100644 --- a/templates/backOffice/default/coupon-list.html +++ b/templates/backOffice/default/coupon-list.html @@ -13,22 +13,26 @@ + {module_include location='coupon_top'} +
    + - - - - - - - - - {loop type="coupon" name="list_coupon" is_enabled="1" backend_context="true"} - - - - - - - - {/loop} - -
    - {intl l='Enabled coupons'} + {intl l='Coupons'} {module_include location='coupon_list_caption'} {loop type="auth" name="can_create" role="ADMIN" resource="admin.coupon" access="CREATE"} - + {/loop} @@ -36,98 +40,119 @@
    {block name="coupon-label-code"}{intl l='Code'}{/block}{block name="coupon-label-title"}{intl l='Title'}{/block}{block name="coupon-label-expiration-date"}{intl l='Days before expiration'}{/block}{block name="coupon-label-usage-left"}{intl l='Usage left'}{/block}{block name="coupon-label-action"}{/block}
    {block name="coupon-code"}{$CODE}{/block}{block name="coupon-title"}{$TITLE}{/block}{block name="coupon-expiration-date"}{$DAY_LEFT_BEFORE_EXPIRATION}{/block} - {block name="coupon-usage-left"} - {if $USAGE_LEFT == -1} - - {intl l="Unlimited"} - - {elseif $USAGE_LEFT} - - {$USAGE_LEFT} - - {else} - - 0 - - {/if} - {/block} - - {block name="coupon-action"} - - {intl l='Edit'} - - {/block} -
    -
    -
    -
    -
    +
    {admin_sortable_header + current_order=$coupon_order + order='code' + reverse_order='code-reverse' + path={url path='/admin/coupon'} + request_parameter_name='coupon_order' + label="{intl l='Code'}" + } +
    - - - - - - - - + + + + + + + + + + + {module_include location='coupon_table_header'} + + - {loop type="coupon" name="list_coupon" is_enabled="0" backend_context="true"} + {loop type="coupon" name="list_coupon" order={$coupon_order|default:'code'} backend_context="true"} - - - - + + + + + + + + + + {module_include location='coupon_table_row'} + + {/loop} @@ -135,6 +160,9 @@
    - {intl l='Disabled coupons'} -
    {block name="coupon-label-code"}{intl l='Code'}{/block}{block name="coupon-label-title"}{intl l='Title'}{/block}{block name="coupon-label-expiration-date"}{intl l='Expiration date'}{/block}{block name="coupon-label-usage-left"}{intl l='Usage left'}{/block}{block name="coupon-label-action"}{/block}{admin_sortable_header + current_order=$coupon_order + order='title' + reverse_order='title-reverse' + path={url path='/admin/coupon'} + request_parameter_name='coupon_order' + label="{intl l='Title'}" + } + {admin_sortable_header + current_order=$coupon_order + order='enabled' + reverse_order='enabled-reverse' + path={url path='/admin/coupon'} + request_parameter_name='coupon_order' + label="{intl l='Status'}" + } + {admin_sortable_header + current_order=$coupon_order + order='expiration-date' + reverse_order='expiration-date-reverse' + path={url path='/admin/coupon'} + request_parameter_name='coupon_order' + label="{intl l='Expiration date'}" + } + {admin_sortable_header + current_order=$coupon_order + order='days-left' + reverse_order='days-left-reverse' + path={url path='/admin/coupon'} + request_parameter_name='coupon_order' + label="{intl l='Days before expiration'}" + } + {admin_sortable_header + current_order=$coupon_order + order='usages-left' + reverse_order='usages-left-reverse' + path={url path='/admin/coupon'} + request_parameter_name='coupon_order' + label="{intl l='Usages left'}" + } +  
    {block name="coupon-code"}{$CODE}{/block}{block name="coupon-title"}{$TITLE}{/block}{block name="coupon-expiration-date"}{$EXPIRATION_DATE}{/block} - {block name="coupon-usage-left"} - {if $USAGE_LEFT == -1} - - {intl l="Unlimited"} - - {elseif $USAGE_LEFT} - - {$USAGE_LEFT} - - {else} - - 0 - - {/if} - {/block} + {loop type="auth" name="can_change" role="ADMIN" resource="admin.coupon" access="UPDATE"} + {$CODE} + {/loop} + {elseloop rel="can_change"} + {$CODE} + {/elseloop} - {block name="coupon-action"} - - {intl l='Edit'} - - {/block} + + {$TITLE} + {if $IS_ENABLED} + {intl l="Enabled"} + {else} + {intl l="Disabled"} + {/if} + {format_date date=$EXPIRATION_DATE output="date"} + {if $DAY_LEFT_BEFORE_EXPIRATION <= 0} + {intl l='Expired'} + {else} + {$DAY_LEFT_BEFORE_EXPIRATION} + {/if} + + {if $USAGE_LEFT == -1} + {intl l="Unlimited"} + {elseif $USAGE_LEFT} + {$USAGE_LEFT} + {else} + 0 + {/if} + + {loop type="auth" name="can_change" role="ADMIN" resource="admin.coupon" access="UPDATE"} + + {/loop}
    + + {module_include location='coupon_bottom'} + diff --git a/templates/backOffice/default/coupon-read.html b/templates/backOffice/default/coupon-read.html deleted file mode 100644 index c6dab9462..000000000 --- a/templates/backOffice/default/coupon-read.html +++ /dev/null @@ -1,172 +0,0 @@ -{extends file="admin-layout.tpl"} - -{block name="check-resource"}admin.coupon{/block} -{block name="check-access"}view{/block} - -{block name="page-title"}{intl l='Coupon'}{/block} - -{block name="main-content"} -
    - -
    - - {loop type="coupon" name="read_coupon" id={$couponId} backend_context="true"} - - -
    -
    -
    -
    - - {if !$IS_ENABLED} -
    - - {intl l='This coupon is disabled, you can enable at the bottom of this form.'} -
    - {/if} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {intl l='Title'}{$TITLE}
    - {if $IS_ENABLED} - - {intl l="Is enabled"} - - {else} - - {intl l="Is disabled"} - - {/if} -
    - {$SUMMARY} -
    {intl l='Amount'}{$AMOUNT}
    {intl l='Expiration date'}{$EXPIRATION_DATE} ({$DAY_LEFT_BEFORE_EXPIRATION} {intl l="days left"})
    {intl l='Usage left'} - {if $USAGE_LEFT == -1} - - {intl l="Unlimited"} - - {elseif $USAGE_LEFT} - - {$USAGE_LEFT} - - {else} - - 0 - - {/if} -
    - {if $IS_CUMULATIVE} - - {intl l="May be cumulative"} - - {else} - - {intl l="Can't be cumulative"} - - {/if} -
    - {if $IS_REMOVING_POSTAGE} - - {intl l="Will remove postage"} - - {else} - - {intl l="Won't remove postage"} - - {/if} -
    - {if $IS_AVAILABLE_ON_SPECIAL_OFFERS} - - {intl l="Will be available on special offers"} - - {else} - - {intl l="Won't be available on special offers"} - - {/if} -
    {intl l='Application field'} -
      - {foreach from=$APPLICATION_CONDITIONS item=condition name=conditionsForeach} - {if !$smarty.foreach.conditionsForeach.first} -
    • {intl l='And'}
    • - {/if} -
    • {$condition nofilter}
    • - {/foreach} -
    -
    {$SHORT_DESCRIPTION}
    {$DESCRIPTION}
    - - {intl l='Edit'} - -
    -
    -
    -
    -
    - {/loop} -
    -
    - -{include file='includes/confirmation-modal.html' id="enable" message="{intl l='Do you really want to enable this element ?'}"} - -{/block} - -{block name="javascript-initialization"} - {javascripts file='assets/js/main.js'} - - {/javascripts} - -{/block} - -{block name="javascript-last-call"} - {module_include location='coupon-read-js'} -{/block} diff --git a/templates/backOffice/default/coupon-update.html b/templates/backOffice/default/coupon-update.html index 5a2d89ccc..6a943027c 100644 --- a/templates/backOffice/default/coupon-update.html +++ b/templates/backOffice/default/coupon-update.html @@ -12,13 +12,14 @@ {form name="thelia.admin.coupon.creation"} - {include file='coupon/form.html' formAction={url path={$formAction}} form=$form noConditions=false} + {include file='coupon/form.html' formAction={url path={$formAction}} form=$form noConditions=false title={intl l='Editing coupon "%title"' title=$couponCode}} {/form} @@ -51,6 +52,7 @@ $.couponManager.intlPleaseRetry = '{intl l='Please retry'}'; $.couponManager.intlPleaseSelectAnotherCondition = '{intl l='Please select another condition'}'; $.couponManager.intlDoYouReallyWantToSetCouponAvailableForEveryOne = '{intl l='Do you really want to set this coupon available to everyone ?'}'; + $.couponManager.intlDoYouReallyWantToDeleteThisCondition = '{intl l='Do you really want to delete this condition ?'}'; $('#condition-save-btn').hide(); }); diff --git a/templates/backOffice/default/coupon/condition-fragments/base-input-text.html b/templates/backOffice/default/coupon/condition-fragments/base-input-text.html new file mode 100644 index 000000000..422ae441a --- /dev/null +++ b/templates/backOffice/default/coupon/condition-fragments/base-input-text.html @@ -0,0 +1,11 @@ +
    + +
    +
    + {$operatorSelectHtml nofilter} +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/templates/backOffice/default/coupon/condition-fragments/cart-item-count-condition.html b/templates/backOffice/default/coupon/condition-fragments/cart-item-count-condition.html new file mode 100644 index 000000000..199fd11b8 --- /dev/null +++ b/templates/backOffice/default/coupon/condition-fragments/cart-item-count-condition.html @@ -0,0 +1,11 @@ +
    + +
    +
    + {$operatorSelectHtml nofilter} +
    +
    + {$quantitySelectHtml nofilter} +
    +
    +
    \ No newline at end of file diff --git a/templates/backOffice/default/coupon/condition-fragments/cart-total-amount-condition.html b/templates/backOffice/default/coupon/condition-fragments/cart-total-amount-condition.html new file mode 100644 index 000000000..53530f14e --- /dev/null +++ b/templates/backOffice/default/coupon/condition-fragments/cart-total-amount-condition.html @@ -0,0 +1,20 @@ +
    + + + +
    +
    + {$operatorSelectHtml nofilter} +
    + +
    + +
    + +
    + + {$currencySelectHtml nofilter} +
    +
    + +
    \ No newline at end of file diff --git a/templates/backOffice/default/coupon/condition-fragments/condition-selector.html b/templates/backOffice/default/coupon/condition-fragments/condition-selector.html new file mode 100644 index 000000000..d1df54d97 --- /dev/null +++ b/templates/backOffice/default/coupon/condition-fragments/condition-selector.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/templates/backOffice/default/coupon/condition-fragments/currency-selector.html b/templates/backOffice/default/coupon/condition-fragments/currency-selector.html new file mode 100644 index 000000000..70b39addf --- /dev/null +++ b/templates/backOffice/default/coupon/condition-fragments/currency-selector.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/templates/backOffice/default/coupon/condition-fragments/quantity-selector.html b/templates/backOffice/default/coupon/condition-fragments/quantity-selector.html new file mode 100644 index 000000000..1da60de16 --- /dev/null +++ b/templates/backOffice/default/coupon/condition-fragments/quantity-selector.html @@ -0,0 +1,9 @@ + +{* Use a text field instead + +*} + diff --git a/templates/backOffice/default/coupon/conditions.html b/templates/backOffice/default/coupon/conditions.html index 1ae577e42..5972c0327 100644 --- a/templates/backOffice/default/coupon/conditions.html +++ b/templates/backOffice/default/coupon/conditions.html @@ -1,5 +1,5 @@ {* List all condition with their summary *} -{foreach from=$conditions item=condition key=i name=conditionsForeach} +{foreach from=$conditions item=condition name=conditionsForeach} {if !$smarty.foreach.conditionsForeach.first} @@ -7,13 +7,15 @@ {/if} {$condition.summary nofilter} - - - {intl l='Edit'} + + + + + {if $conditions|count != 1} - - {intl l='Delete'} + + {/if} diff --git a/templates/backOffice/default/coupon/form.html b/templates/backOffice/default/coupon/form.html index 4f1650bca..ed6fa4d2e 100644 --- a/templates/backOffice/default/coupon/form.html +++ b/templates/backOffice/default/coupon/form.html @@ -3,9 +3,10 @@
    +
    -
    - {intl l='Edit %title' title=$couponCode} +
    + {$title}
    @@ -25,27 +26,31 @@ {if !$noConditions} {include - file = "includes/inner-form-toolbar.html" - hide_submit_buttons = false + file = "includes/inner-form-toolbar.html" + hide_submit_buttons = false - page_url = "{url path="{$formAction}"}" + page_url = {url path=$formAction} + close_url = {url path='/admin/coupon'} + } + {else} + {include + file = "includes/inner-form-toolbar.html" + hide_submit_buttons = false + hide_save_and_close_button = true + hide_flags = true + + page_url = {url path=$formAction} + close_url = {url path='/admin/coupon'} } {/if}
    -
    +
    {form_field form=$form field='code'}
    - - - {if $error}{$message}{/if} -
    - {/form_field} - - {form_field form=$form field='title'} -
    - - + + + {intl l='This is the code entered by your customers to use this coupon'} {if $error}{$message}{/if}
    {/form_field} @@ -55,7 +60,7 @@
    {/form_field} @@ -65,7 +70,7 @@
    {/form_field} @@ -75,7 +80,7 @@
    {/form_field} @@ -85,19 +90,16 @@
    {/form_field} {form_field form=$form field='expirationDate'}
    - -
    - - {if $error}{$message}{/if} - -
    + + + {if $error}{$message}{/if}
    {/form_field} @@ -105,126 +107,132 @@
    - - + + + {if $error}{$message}{/if}
    {/form_field}
    -
    -
    -
    - {form_field form=$form field='type'} -
    - - - {if $error}{$message}{/if} - {$availableCoupons.0.toolTip} -
    - {/form_field} -
    +
    +
    + {form_field form=$form field='type'} +
    + + + {if $error}{$message}{/if} + {$availableCoupons.0.toolTip} +
    + {/form_field} -
    +
    {form_field form=$form field='amount'} - {$couponInputsHtml nofilter} + {$couponInputsHtml nofilter} {/form_field}
    - - {form_field form=$form field='shortDescription'} -
    - - - {if $error}{$message}{/if} -
    - {/form_field} -
    - -
    - -
    - {form_field form=$form field='description'} -
    - - - {if $error}{$message}{/if} -
    - {/form_field} - - {if $noConditions} - - {/if} -
    -
    - -
    -
    -
    - -{if $noConditions} - {include file='includes/notifications.html' message={intl l='Please save your Coupon in oder to affect it some conditions'}} -{else} -
    -
    - -
    - - - - - - - - - - {include file='coupon/conditions.html' conditions=$conditions} - -
    - {intl l='Conditions'} -
    {intl l='Conditions'}{intl l='Actions'}
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - {intl l='Save this condition'} - - -
    - - -
    -
    -
    +
    + + {loop type="lang" name="get-flag" id=$edit_language_id} + {form_field form=$form field='title'} +
    + +
    + + {$TITLE} +
    + {if $error}{$message}{/if} +
    + {/form_field} + + {form_field form=$form field='shortDescription'} +
    + + + {if $error}{$message}{/if} +
    + {/form_field} + + {form_field form=$form field='description'} +
    + + + {if $error}{$message}{/if} +
    + {/form_field} + {/loop} +
    +
    -
    - -{/if} +
    + {if $noConditions} +
    +

    {intl l="Coupon conditions"}

    +
    + {include file='includes/notifications.html' type='info' dismissable=false message={intl l='Please save this coupon first to define coupon conditions'}} +
    + {else} +
    +

    {intl l="Coupon conditions"}

    +
    + + + + + + + + + {include file='coupon/conditions.html' conditions=$conditions} + +
    {intl l='Condition description'}{intl l='Actions'}
    +
    +
    + +
    + +

    {intl l="Add a condition"}

    + +
    + +
    + + + +
    + +
    + +
    + + + {intl l='Save this condition'} + + +
    +
    + {/if} +
    + + \ No newline at end of file diff --git a/templates/backOffice/default/coupon/type-fragments/remove-x-amount.html b/templates/backOffice/default/coupon/type-fragments/remove-x-amount.html new file mode 100644 index 000000000..6159af73f --- /dev/null +++ b/templates/backOffice/default/coupon/type-fragments/remove-x-amount.html @@ -0,0 +1,9 @@ +
    + +
    + + {loop type="currency" name="get-symbol" default_only="true"} +
    {$SYMBOL}
    + {/loop} +
    +
    diff --git a/templates/backOffice/default/coupon/type-fragments/remove-x-percent.html b/templates/backOffice/default/coupon/type-fragments/remove-x-percent.html new file mode 100644 index 000000000..7cd461a48 --- /dev/null +++ b/templates/backOffice/default/coupon/type-fragments/remove-x-percent.html @@ -0,0 +1,8 @@ + +
    + +
    + +
    %
    +
    +
    diff --git a/templates/backOffice/default/coupon/type-fragments/remove-x.html b/templates/backOffice/default/coupon/type-fragments/remove-x.html new file mode 100644 index 000000000..3ac1bab7b --- /dev/null +++ b/templates/backOffice/default/coupon/type-fragments/remove-x.html @@ -0,0 +1,4 @@ +
    + + +
    diff --git a/templates/backOffice/default/currencies.html b/templates/backOffice/default/currencies.html index 6e1d29fc5..475aac143 100644 --- a/templates/backOffice/default/currencies.html +++ b/templates/backOffice/default/currencies.html @@ -219,10 +219,10 @@ {loop type="lang" name="default-lang" default_only="1"}
    - {intl l=$TITLE} + {$TITLE}
    -
    {intl l="Enter here the currency name in the default language (%title)" title=$TITLE}
    +
    {intl l="Enter here the currency name in the default language (%title)" title={$TITLE}}
    {* Switch edition to the current locale *} @@ -347,6 +347,9 @@ {* Change default status *} $('.change-default').change(function(ev) { + var $loader = $('
    '); + $('body').append($loader); + $loader.show(); var url = "{url path='/admin/configuration/currencies/set-default' currency_id='__ID__'}"; // Perform ID subtitutions diff --git a/templates/backOffice/default/currency-edit.html b/templates/backOffice/default/currency-edit.html index 92ff36649..4d59e0fee 100644 --- a/templates/backOffice/default/currency-edit.html +++ b/templates/backOffice/default/currency-edit.html @@ -24,7 +24,7 @@
    - {intl l='Edit currency "%name"' name=$NAME} + {intl l='Edit currency "%name"' name={$NAME}}
    @@ -115,7 +115,7 @@
    - {intl l="Sorry, currency ID=%id was not found." id=$currency_id} + {intl l="Sorry, currency ID=%id was not found." id={$currency_id}}
    diff --git a/templates/backOffice/default/customer-edit.html b/templates/backOffice/default/customer-edit.html index 37d007cf4..6c252390f 100644 --- a/templates/backOffice/default/customer-edit.html +++ b/templates/backOffice/default/customer-edit.html @@ -14,7 +14,7 @@
    @@ -22,7 +22,7 @@
    - {intl l="Edit customer %firstname %lastname" firstname=$FIRSTNAME lastname=$LASTNAME} + {intl l="Edit customer %firstname %lastname (Ref : %ref)" firstname={$FIRSTNAME} lastname={$LASTNAME} ref={$REF}}
    @@ -80,7 +80,14 @@ {form_field form=$form field='email'}
    - + +
    + {/form_field} + + {form_field form=$form field='discount'} +
    + +
    {/form_field} @@ -286,6 +293,8 @@
    + {module_include location='customer-edit'} + {/loop} {elseloop rel="customer_edit"} @@ -310,6 +319,8 @@ {include file='includes/customer_address_form_fields.html' customer_id=$customer_id page=$page} + {module_include location='customer_address_create_form'} + {/capture} {include @@ -340,7 +351,7 @@ {include file='includes/customer_address_form_fields.html' customer_id=$customer_id page=$page} - + {module_include location='customer_address_update_form'} {/capture} {include @@ -388,6 +399,8 @@ + + {module_include location='customer_address_delete_form'} {/capture} {include diff --git a/templates/backOffice/default/customers.html b/templates/backOffice/default/customers.html index 3b74cf7bf..f839a24ea 100644 --- a/templates/backOffice/default/customers.html +++ b/templates/backOffice/default/customers.html @@ -120,7 +120,7 @@ - {loop name="customer_list" type="customer" current="false" visible="*" order=$customer_order backend_context="1" page=$page limit=$display_customer} + {loop name="customer_list" type="customer" current="false" visible="*" order=$customer_order backend_context="1" page=$page limit=#max_displayed_customers#} {assign "lastOrderDate" ''} {assign "lastOrderAmount" ''} {assign "lastOrderCurrency" ''} @@ -179,34 +179,13 @@ + {include + file = "includes/pagination.html" -
    -
      - - {if $page != 1} -
    • «
    • - {/if} - {pageloop rel="customer_list" numPage="20"} - {if $PAGE == $CURRENT && $PAGE > 2} -
    • - {/if} - - {if $PAGE != $CURRENT} -
    • {$PAGE}
    • - - {else} -
    • {$PAGE}
    • - {/if} - - {if $PAGE == $END && $PAGE < $LAST} -
    • - {/if} - {/pageloop} - {if $LAST > $CURRENT} -
    • »
    • - {/if} -
    -
    + loop_ref = "customer_list" + max_page_count = 10 + page_url = "{url path="/admin/customers" customer_order=$customer_order}" + } @@ -332,6 +311,8 @@
    {/form_field} + {module_include location='customer_create_form'} + {/capture} {include @@ -355,6 +336,8 @@ {capture "delete_customer_dialog"} + + {module_include location='customer_delete_form'} {/capture} {include diff --git a/templates/backOffice/default/document-edit.html b/templates/backOffice/default/document-edit.html index 68d4bb85d..b39cf1aee 100644 --- a/templates/backOffice/default/document-edit.html +++ b/templates/backOffice/default/document-edit.html @@ -2,7 +2,6 @@ {block name="page-title"}{intl l='Edit a document'}{/block} -{block name="check-resource"}admin.document{/block} {block name="check-access"}update{/block} {block name="main-content"} @@ -65,7 +64,7 @@ {form_field form=$form field='file'}
    - +
    {/form_field} @@ -132,7 +131,7 @@
    - {intl l="Sorry, document ID=%id was not found." id=$documentId} + {intl l="Sorry, document ID=%id was not found." id={$documentId}}
    diff --git a/templates/backOffice/default/export.html b/templates/backOffice/default/export.html new file mode 100644 index 000000000..12ec8565a --- /dev/null +++ b/templates/backOffice/default/export.html @@ -0,0 +1,54 @@ +{extends file="admin-layout.tpl"} + +{block name="page-title"}{intl l='Exports'}{/block} + +{block name="check-resource"}admin.export{/block} +{block name="check-access"}view{/block} + +{block name="main-content"} +
    + +
    + + + + {module_include location='tools_top'} + +
    + +
    + +
    + + {module_include location='configuration_bottom'} +
    +
    +
    +{/block} + +{block name="javascript-last-call"} + {module_include location='configuration-js'} +{/block} \ No newline at end of file diff --git a/templates/backOffice/default/feature-edit.html b/templates/backOffice/default/feature-edit.html index 8c19ed761..31c01edac 100644 --- a/templates/backOffice/default/feature-edit.html +++ b/templates/backOffice/default/feature-edit.html @@ -16,7 +16,7 @@
  • {intl l="Home"}
  • {intl l="Configuration"}
  • {intl l="Features"}
  • -
  • {intl l='Editing feature "%name"' name=$TITLE}
  • +
  • {intl l='Editing feature "%name"' name={$TITLE}}
  • @@ -24,7 +24,7 @@
    - {intl l='Edit feature "%name"' name=$TITLE} + {intl l='Edit feature "%name"' name={$TITLE}}
    @@ -186,7 +186,7 @@
    - {intl l="Sorry, feature ID=%id was not found." id=$feature_id} + {intl l="Sorry, feature ID=%id was not found." id={$feature_id}}
    @@ -223,10 +223,10 @@ {loop type="lang" name="current-edit-lang" id="$edit_language_id"}
    - {intl l=$TITLE} + {$TITLE}
    -
    {intl l="Enter here the value in the current edit language (%language_name)" language_name=$TITLE}
    +
    {intl l="Enter here the value in the current edit language (%language_name)" language_name={$TITLE}}
    {form_field form=$form field='locale'} diff --git a/templates/backOffice/default/features.html b/templates/backOffice/default/features.html index b44679348..6e5c18b91 100644 --- a/templates/backOffice/default/features.html +++ b/templates/backOffice/default/features.html @@ -166,10 +166,10 @@ {loop type="lang" name="default-lang" default_only="1"}
    - {intl l=$TITLE} + {$TITLE}
    -
    {intl l="Enter here the feature name in the default language (%title)" title=$TITLE}
    +
    {intl l="Enter here the feature name in the default language (%title)" title={$TITLE}}
    {* Switch edition to the current locale *} diff --git a/templates/backOffice/default/folder-edit.html b/templates/backOffice/default/folder-edit.html index bff41f094..d5b58625b 100644 --- a/templates/backOffice/default/folder-edit.html +++ b/templates/backOffice/default/folder-edit.html @@ -20,7 +20,7 @@
    - {intl l='Edit folder %title' title=$TITLE} + {intl l='Edit folder %title' title={$TITLE}}
    @@ -152,13 +152,7 @@ }
    - {module_include location='folder-edit' countvar='module_count'} - - {if $countvar == 0} -
    - {intl l="There is currently no active module here."} -
    - {/if} + {include file="includes/module-tab-content.html" location="folder-edit"}
    @@ -232,7 +226,7 @@ }); }); - // Initialize folder (id={$folder_id}) select value + // Initialize folder select value {if $folder_id != 0} $('#folder_id').val("{$folder_id}").change(); {/if} diff --git a/templates/backOffice/default/folders.html b/templates/backOffice/default/folders.html index 0557d79ac..1b96fd9b7 100644 --- a/templates/backOffice/default/folders.html +++ b/templates/backOffice/default/folders.html @@ -22,7 +22,7 @@ {* display parent folder name, and get current folder ID *} {loop name="folder_title" type="folder" visible="*" id=$parent} - {intl l="Folders in %fold" fold=$TITLE} + {intl l="Folders in %fold" fold={$TITLE}} {$fold_id = $ID} {/loop} {elseloop rel="folder_title"} @@ -191,7 +191,7 @@ {* display parent folder name *} {loop name="folder_title" type="folder" visible="*" id=$parent} - {intl l="Contents in %fold" fold=$TITLE} + {intl l="Contents in %fold" fold={$TITLE}} {/loop} {elseloop rel="folder_title"} diff --git a/templates/backOffice/default/general_error.html b/templates/backOffice/default/general_error.html index 503cc4106..cefed6cb5 100644 --- a/templates/backOffice/default/general_error.html +++ b/templates/backOffice/default/general_error.html @@ -1,24 +1,24 @@ -{extends file="admin-layout.tpl"} - -{* -- We do not check admin login on this page *} -{block name="check-auth"}{/block} - -{block name="page-title"}{intl l='An error occured'}{/block} - -{block name="main-content"} -
    - -
    -
    -
    -

    {intl l="Oops! An Error Occurred"}

    - - {block name="error-message"}

    {$error_message}

    {/block} - - {intl l="Go to administration home"} -
    -
    -
    - -
    +{extends file="admin-layout.tpl"} + +{* -- We do not check admin login on this page *} +{block name="check-auth"}{/block} + +{block name="page-title"}{intl l='An error occured'}{/block} + +{block name="main-content"} +
    + +
    +
    +
    +

    {intl l="Oops! An Error Occurred"}

    + + {block name="error-message"}

    {$error_message}

    {/block} + + {intl l="Go to administration home"} +
    +
    +
    + +
    {/block} \ No newline at end of file diff --git a/templates/backOffice/default/home.html b/templates/backOffice/default/home.html index 0204fe4c7..a5eda4b59 100644 --- a/templates/backOffice/default/home.html +++ b/templates/backOffice/default/home.html @@ -8,6 +8,7 @@ {module_include location='home_top'} + {loop type="auth" name="can_view" role="ADMIN" resource="admin.order" access="VIEW"}
    @@ -36,57 +37,78 @@
    - + {/loop}
    -
    -
    -
    {intl l="Shop Informations"}
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {intl l="Customers"} - {count type="customer" current="false" backend_context="1"} -
    {intl l="Categories"} - {count type="category" visible="*" backend_context="1"} -
    {intl l="Products"} - {count type="product" visible="*" backend_context="1"} -
    {intl l="Online products"} - {count type="product" visible="true" backend_context="1"} -
    {intl l="Offline products"} - {count type="product" visible="false" backend_context="1"} -
    {intl l="Orders"} - {count type="order" status="*" backend_context="1"} -
    -
    -
    -
    + {* Do not display shop information block if user none of the required authorizations *} + + {capture name="shop_information_block_content"} + {loop type="auth" name="can_view" role="ADMIN" resource="admin.customer" access="VIEW"} + + {intl l="Customers"} + + {count type="customer" current="false" backend_context="1"} + + + {/loop} + + {loop type="auth" name="can_view" role="ADMIN" resource="admin.category" access="VIEW"} + + {intl l="Categories"} + + {count type="category" visible="*" backend_context="1"} + + + {/loop} + + {loop type="auth" name="can_view" role="ADMIN" resource="admin.product" access="VIEW"} + + {intl l="Products"} + + {count type="product" visible="*" backend_context="1"} + + + + {intl l="Online products"} + + {count type="product" visible="true" backend_context="1"} + + + + {intl l="Offline products"} + + {count type="product" visible="false" backend_context="1"} + + + {/loop} + + {loop type="auth" name="can_view" role="ADMIN" resource="admin.order" access="VIEW"} + + {intl l="Orders"} + + {count type="order" status="*" backend_context="1"} + + + {/loop} + {/capture} + + {if trim($smarty.capture.shop_information_block_content) ne ""} +
    +
    +
    {intl l="Shop Informations"}
    +
    + + + {$smarty.capture.shop_information_block_content nofilter} + +
    +
    +
    +
    + {/if} + + {loop type="auth" name="can_view" role="ADMIN" resource="admin.order" access="VIEW"}
    {intl l="Sales statistics"}
    @@ -221,6 +243,7 @@
    + {/loop}
    @@ -234,11 +257,11 @@ {intl l="Latest version available"} - V1.5.4.2 + {intl l="Loading..."} {intl l="News"} - {intl l="Click here"} + {intl l="Click here"} @@ -396,9 +419,14 @@ jQuery(function($){ }); } - {/literal} + // Get the latest Thelia version + $('#latest-thelia-version').load("{url path='/admin/latest-thelia-version'}", function(response, status, xhr) { + if (status == "error") + $('#latest-thelia-version').text("Unavailable"); + }); + }); diff --git a/templates/backOffice/default/image-edit.html b/templates/backOffice/default/image-edit.html index b65c6707d..88c7cc5a1 100644 --- a/templates/backOffice/default/image-edit.html +++ b/templates/backOffice/default/image-edit.html @@ -2,7 +2,6 @@ {block name="page-title"}{intl l='Edit an image'}{/block} -{block name="check-resource"}admin.image{/block} {block name="check-access"}update{/block} {block name="main-content"} @@ -14,7 +13,7 @@
    @@ -22,7 +21,7 @@
    - {intl l='Edit image "%name"' name=$TITLE} + {intl l='Edit image "%name"' name={$TITLE}}
    @@ -68,7 +67,7 @@ {form_field form=$form field='file'}
    - +
    {/form_field} @@ -137,7 +136,7 @@
    - {intl l="Sorry, image ID=%id was not found." id=$imageId} + {intl l="Sorry, image ID=%id was not found." id={$imageId}}
    diff --git a/templates/backOffice/default/includes/content-folder-management.html b/templates/backOffice/default/includes/content-folder-management.html index 6f1b3566b..4bd8c16b7 100644 --- a/templates/backOffice/default/includes/content-folder-management.html +++ b/templates/backOffice/default/includes/content-folder-management.html @@ -9,7 +9,7 @@

    {intl l='Additional Folders'}

    {intl l='A content could be attached to more than one folder. Select here the additional folders for this content.'} {loop name="default_folder" type="folder" id=$DEFAULT_FOLDER} - {intl l='You can change the default folder (%title) in the "General" tab.' title=$TITLE} + {intl l='You can change the default folder (%title) in the "General" tab.' title={$TITLE}} {/loop} {$exclude_from_tree = "-1"} diff --git a/templates/backOffice/default/includes/document-upload-form.html b/templates/backOffice/default/includes/document-upload-form.html index 6d0574fd2..7296def68 100644 --- a/templates/backOffice/default/includes/document-upload-form.html +++ b/templates/backOffice/default/includes/document-upload-form.html @@ -8,7 +8,7 @@ Parameters: *}

    -
    +
    diff --git a/templates/backOffice/default/includes/document-upload-list-ajax.html b/templates/backOffice/default/includes/document-upload-list-ajax.html index 768129554..c081c64d2 100644 --- a/templates/backOffice/default/includes/document-upload-list-ajax.html +++ b/templates/backOffice/default/includes/document-upload-list-ajax.html @@ -29,5 +29,5 @@ Parameters: {/ifloop} {elseloop rel="document"} -
    {intl l='There is no documents attached to this %type.' type=$documentType}
    +
    {intl l='There is no documents attached to this %type.' type={$documentType}}
    {/elseloop} diff --git a/templates/backOffice/default/includes/image-upload-form.html b/templates/backOffice/default/includes/image-upload-form.html index 7b7d7eb65..fda406580 100644 --- a/templates/backOffice/default/includes/image-upload-form.html +++ b/templates/backOffice/default/includes/image-upload-form.html @@ -8,7 +8,7 @@ Parameters: *}
    - +
    @@ -36,3 +36,21 @@ Parameters: var imageListErrorMessage = "{intl l='Can\'t load images, please refresh this page.'}"; var imageReorderErrorMessage = "{intl l='Can\'t reorder images, please refresh this page.'}"; + + diff --git a/templates/backOffice/default/includes/image-upload-list-ajax.html b/templates/backOffice/default/includes/image-upload-list-ajax.html index 937aca1a5..009cc6174 100644 --- a/templates/backOffice/default/includes/image-upload-list-ajax.html +++ b/templates/backOffice/default/includes/image-upload-list-ajax.html @@ -21,7 +21,7 @@ Parameters: - +
    @@ -30,5 +30,5 @@ Parameters: {/ifloop} {elseloop rel="image"} -
    {intl l='There is no images attached to this %type.' type=$imageType}
    +
    {intl l='There is no images attached to this %type.' type={$imageType}}
    {/elseloop} \ No newline at end of file diff --git a/templates/backOffice/default/includes/inner-form-toolbar.html b/templates/backOffice/default/includes/inner-form-toolbar.html index 92bee1af8..59d8acde7 100644 --- a/templates/backOffice/default/includes/inner-form-toolbar.html +++ b/templates/backOffice/default/includes/inner-form-toolbar.html @@ -4,7 +4,9 @@ A toolbar displayed in forms, to display language change flags, submit and close Parameters: - hide_flags: true / false. If true, the flags will not be visible - - hide_submit_buttons: true / false. If true, only the close button will be deplayed. + - hide_submit_buttons: true / false. If true, only the close button will be displayed. + - hide_save_buttons: true / false. If true, the "Save" button will be hidden + - hide_save_and_close_button: true / false. If true, the "Save and close" button will be hidden - show_currencies: true/false. If true, show the currency selection bar - page_url: the current page URL. Default is $current_url. Used to switchedition anguage. - close_url: no default. URL displayed when close button is clicked. If empty, the close button is not displayed. @@ -21,7 +23,7 @@ Parameters: {else} {$lang_url = {url path={$page_url|default:$current_url nofilter} edit_language_id=$ID}} {/if} - + {$TITLE} @@ -36,7 +38,7 @@ Parameters:
    {loop name="currency_list" type="currency"} - + {$SYMBOL} {/loop} @@ -48,8 +50,12 @@ Parameters:
    {if $hide_submit_buttons != true} - - + {if $hide_save_buttons != true} + + {/if} + {if $hide_save_and_close_button != true} + + {/if} {/if} {if ! empty($close_url)} {intl l='Close'} diff --git a/templates/backOffice/default/includes/module-block.html b/templates/backOffice/default/includes/module-block.html index 6ea8fcda5..46b75ebb3 100644 --- a/templates/backOffice/default/includes/module-block.html +++ b/templates/backOffice/default/includes/module-block.html @@ -79,55 +79,64 @@ {loop type="module" name="module.{$module_type}" module_type={$module_type|default:1} order=$module_order backend_context=1} - + {$ID} {$TITLE} {$CODE} {$CHAPO} - -
    - -
    - - + {if $EXISTS} + +
    + +
    + + - - {admin_position_block - resource="admin.modules" - access="UPDATE" - path={url path="admin/module/update-position"} - url_parameter="module_id" - in_place_edit_class="modulePositionChange" - position=$POSITION - id=$ID - } - + + {admin_position_block + resource="admin.modules" + access="UPDATE" + path={url path="admin/module/update-position"} + url_parameter="module_id" + in_place_edit_class="modulePositionChange" + position=$POSITION + id=$ID + } + + {else} + + Warning + {intl l="This module cannot be started, some files are probably missing."} + + {/if} {module_include location='modules_table_row'}
    - {if $CONFIGURABLE == 1} - {loop type="auth" name="can_change" role="ADMIN" module=$CODE access="VIEW"} - {intl l="Configure"} + {if $EXISTS} + {if $CONFIGURABLE == 1} + {loop type="auth" name="can_change" role="ADMIN" module=$CODE access="VIEW"} + {intl l="Configure"} + {/loop} + {/if} + + {*loop type="auth" name="can_change" role="ADMIN" resource="admin.modules" access="VIEW"} + + {/loop*} + + {loop type="auth" name="can_change" role="ADMIN" resource="admin.module" access="UPDATE"} + {/loop} {/if} - {*loop type="auth" name="can_change" role="ADMIN" resource="admin.modules" access="VIEW"} - - {/loop*} - - {loop type="auth" name="can_change" role="ADMIN" resource="admin.module" access="UPDATE"} - - {/loop} - {loop type="auth" name="can_delete" role="ADMIN" resource="admin.module" access="DELETE"} {/loop} diff --git a/templates/backOffice/default/includes/module-tab-content.html b/templates/backOffice/default/includes/module-tab-content.html new file mode 100644 index 000000000..f5d11d0be --- /dev/null +++ b/templates/backOffice/default/includes/module-tab-content.html @@ -0,0 +1,15 @@ +{capture name="module_include"} + {module_include location=$location countvar='module_count'} +{/capture} + +{if trim($smarty.capture.module_include) == ''} +
    + +
    +

    +

    {intl l="There is currently no active module here."}

    +
    + +{else} + x="{$smarty.capture.module_include nofilter}" +{/if} \ No newline at end of file diff --git a/templates/backOffice/default/includes/pagination.html b/templates/backOffice/default/includes/pagination.html new file mode 100644 index 000000000..fd560ef79 --- /dev/null +++ b/templates/backOffice/default/includes/pagination.html @@ -0,0 +1,69 @@ +{* +A generic pager for thelia back-office + +Parameters : + +$loop_ref: the name of the related loop +$max_page_count : maximum number of pages to display +$page_url : the URL of the page. The parameter page=x is appended to this URL. + +*} + +{* Prepare the URL so that the page=x parameter coumd be safely appended *} + +{if strpos($page_url, '?')} + {$page_url="$page_url&"} +{else} + {$page_url="$page_url?"} +{/if} + +
    +
      + {pageloop rel=$loop_ref limit=$max_page_count} + {$prev_page = $PREV} + {$next_page = $NEXT} + {$last_page = $LAST} + {$has_prev = $CURRENT > 1} + {$has_next = $CURRENT < $LAST} + + {$has_pages_after = $END < $LAST && $LAST > $max_page_count} + {$has_pages_before = $START > 1} + + {if $PAGE == $START} + {if $has_prev} +
    • «
    • +
    • + + {if $has_pages_before} +
    • + {/if} + + {else} +
    • «
    • +
    • + {/if} + {/if} + + {if $PAGE != $CURRENT} +
    • {$PAGE}
    • + {else} +
    • {$PAGE}
    • + {/if} + + {if $PAGE == $END} + {if $has_next} + {if $has_pages_after} +
    • + {/if} + +
    • +
    • »
    • + + {else} +
    • +
    • »
    • + {/if} + {/if} + {/pageloop} +
    +
    diff --git a/templates/backOffice/default/includes/product-prices-tab.html b/templates/backOffice/default/includes/product-prices-tab.html index 32aa42af6..8c55d0fc3 100644 --- a/templates/backOffice/default/includes/product-prices-tab.html +++ b/templates/backOffice/default/includes/product-prices-tab.html @@ -170,7 +170,7 @@
    - + {intl l="Kg"}
    @@ -350,14 +350,14 @@ {intl l='Reference'} {intl l='EAN Code'} {intl l='Stock'} - {intl l='Price
    w/o taxes (%currency)' currency=$currency_symbol} - {intl l='Price
    w/ taxes (%currency)' currency=$currency_symbol} + {intl l='Price
    w/o taxes (%currency)' currency={$currency_symbol}} + {intl l='Price
    w/ taxes (%currency)' currency={$currency_symbol}} {intl l='Weight
    (Kg)'} {intl l='Default'} {intl l='Sale'} {intl l='New'} - {intl l='Sale price
    w/o taxes (%currency)' currency=$currency_symbol} - {intl l='Sale price
    w/ taxes (%currency)' currency=$currency_symbol} + {intl l='Sale price
    w/o taxes (%currency)' currency={$currency_symbol}} + {intl l='Sale price
    w/ taxes (%currency)' currency={$currency_symbol}}   @@ -411,7 +411,7 @@ {/form_field} {form_field form=$form field='weight' value_key=$idx} - + {/form_field} diff --git a/templates/backOffice/default/languages.html b/templates/backOffice/default/languages.html index 3054db1c0..5e5c21bec 100644 --- a/templates/backOffice/default/languages.html +++ b/templates/backOffice/default/languages.html @@ -47,8 +47,6 @@ {intl l="Language name"} {intl l="ISO 639 Code"} {intl l="Locale"} - {intl l="date form"} - {intl l="time form"} {intl l="Default"} {intl l="Actions"} @@ -60,8 +58,6 @@ {$TITLE} {$CODE} {$LOCALE} - {$DATE_FORMAT} - {$TIME_FORMAT}
    @@ -210,6 +206,27 @@ {intl l='The syntax used is identical to the PHP date() function'}
    {/form_field} + {form_field form=$form field='decimal_separator'} +
    + + + {intl l='Sets the separator for the decimal point'} +
    + {/form_field} + {form_field form=$form field='thousands_separator'} +
    + + + {intl l='Sets the thousands separator.'} +
    + {/form_field} + {form_field form=$form field='decimals'} +
    + + + {intl l='Sets the number of decimal points'} +
    + {/form_field} {module_include location='language_create_form'} diff --git a/templates/backOffice/default/message-edit.html b/templates/backOffice/default/message-edit.html index 6de72a897..5eeff56ce 100644 --- a/templates/backOffice/default/message-edit.html +++ b/templates/backOffice/default/message-edit.html @@ -16,7 +16,7 @@
  • {intl l="Home"}
  • {intl l="Configuration"}
  • {intl l="Mailing templates"}
  • -
  • {intl l='Editing mailing template "%name"' name=$NAME}
  • +
  • {intl l='Editing mailing template "%name"' name={$NAME}}
  • @@ -24,7 +24,7 @@
    - {intl l='Edit mailing template "%name"' name=$NAME} + {intl l='Edit mailing template "%name"' name={$NAME}}
    @@ -209,7 +209,7 @@
    - {intl l="Sorry, message ID=%id was not found." id=$message_id} + {intl l="Sorry, message ID=%id was not found." id={$message_id}}
    diff --git a/templates/backOffice/default/messages.html b/templates/backOffice/default/messages.html index 6344aa45b..c299942da 100644 --- a/templates/backOffice/default/messages.html +++ b/templates/backOffice/default/messages.html @@ -143,10 +143,10 @@
    - {intl l=$TITLE} + {$TITLE}
    -
    {intl l="Enter here the mailing template purpose in the default language (%title)" title=$TITLE}
    +
    {intl l="Enter here the mailing template purpose in the default language (%title)" title={$TITLE}}
    {form_field form=$form field='locale'} diff --git a/templates/backOffice/default/modules.html b/templates/backOffice/default/modules.html index 948665ff5..eb735c129 100644 --- a/templates/backOffice/default/modules.html +++ b/templates/backOffice/default/modules.html @@ -13,7 +13,7 @@
    {* {loop type="auth" name="can_create" role="ADMIN" resource="admin.module" access="UPDATE"} @@ -103,7 +103,8 @@ var url_management = "{url path="/admin/module/toggle-activation/"}"; $(".module-activation").on("switch-change", function(e, data){ - var module_id = $(this).data('id'); + var checkbox = $(this); + var module_id = checkbox.data('id'); var is_checked = data.value; $('body').append(''); @@ -120,6 +121,7 @@ }) .fail(function(jqXHR, textStatus, errorThrown){ + checkbox.bootstrapSwitch('toggleState', true); $("#loading-event").remove(); $('#module-failed-body').html(jqXHR.responseJSON.error); $("#module-failed").modal("show"); @@ -154,6 +156,7 @@ }); + {/block} {block name="javascript-last-call"} diff --git a/templates/backOffice/default/order-edit.html b/templates/backOffice/default/order-edit.html index b7a134079..238938e7a 100644 --- a/templates/backOffice/default/order-edit.html +++ b/templates/backOffice/default/order-edit.html @@ -15,7 +15,8 @@
    @@ -35,7 +36,7 @@
    - {intl l='Order %ref' ref=$REF} + {intl l='Order %ref - ID %id' id={$ID} ref={$REF}}
    @@ -68,7 +69,7 @@
    @@ -103,6 +104,7 @@ {/loop} {/ifloop} + {module_include location='order-product-list'} @@ -351,13 +353,7 @@
    - {module_include location='order-edit' countvar='module_count'} - - {if $countvar == 0} -
    - {intl l="There is currently no active module here."} -
    - {/if} + {include file="includes/module-tab-content.html" location="order-edit"}
    {/loop} @@ -392,14 +388,14 @@ {form_field form=$form field='company'}
    - - + +
    {/form_field} {form_field form=$form field='title'}
    - + + +
    {/form_field} {form_field form=$form field='lastname'}
    - - + +
    {/form_field} {form_field form=$form field='address1'}
    - - + +
    {form_field form=$form field='address2'} - + {/form_field}
    {form_field form=$form field='address3'} - + {/form_field}
    {/form_field} {form_field form=$form field='zipcode'}
    - - + +
    {/form_field} {form_field form=$form field='city'}
    - - + +
    {/form_field} {form_field form=$form field='country'}
    - + + +
    {/form_field} diff --git a/templates/backOffice/default/orders.html b/templates/backOffice/default/orders.html index 0cfd9c286..721ee459c 100644 --- a/templates/backOffice/default/orders.html +++ b/templates/backOffice/default/orders.html @@ -32,6 +32,16 @@ + + + @@ -139,32 +150,13 @@ diff --git a/templates/backOffice/default/product-edit.html b/templates/backOffice/default/product-edit.html index 0eb56fed4..11369ed17 100644 --- a/templates/backOffice/default/product-edit.html +++ b/templates/backOffice/default/product-edit.html @@ -22,7 +22,7 @@
    - {intl l='Edit product %title' title=$TITLE} + {intl l='Edit product %title' title={$TITLE}}
    @@ -119,13 +119,7 @@ }
    - {module_include location='product-edit' countvar='module_count'} - - {if $countvar == 0} -
    - {intl l="There is currently no active module here."} -
    - {/if} + {include file="includes/module-tab-content.html" location="product-edit"}
    diff --git a/templates/backOffice/default/profile-edit.html b/templates/backOffice/default/profile-edit.html index 7e4d57a27..fde3ad01a 100644 --- a/templates/backOffice/default/profile-edit.html +++ b/templates/backOffice/default/profile-edit.html @@ -8,7 +8,6 @@ {block name="main-content"} {assign oder_tab {$smarty.get.tab|default:$smarty.post.tab|default:'data'}} - {assign asked_country {$smarty.get.country|default:{country ask="default" attr="id"}}}
    @@ -26,8 +25,8 @@
    -
    - {$CODE} +
    +
    {intl l="Editing profile '%name'" name=$TITLE}
    + - + @@ -45,14 +46,36 @@ {loop type="profile" name="profiles" backend_context="1"} + {$can_change = false} + {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.profile" access="UPDATE"} + {$can_change = true} + {/loop} + - + + - {loop name="customer_list" type="customer" current="false" visible="*" backend_context="1" search_term=$smarty.get.search_term search_in="ref,firstname,lastname,email"} + {loop name="customer_list" type="customer" current="false" visible="*" backend_context="1" search_term=trim($smarty.get.search_term) search_in="ref,firstname,lastname,email"} {assign "lastOrderDate" ''} {assign "lastOrderAmount" ''} {assign "lastOrderCurrency" ''} @@ -131,7 +131,7 @@ - {loop type="order" name="order-search" backend_context=1 customer="*" search_term=$smarty.get.search_term search_in="ref,customer_ref,customer_firstname,customer_lastname,customer_email"} + {loop type="order" name="order-search" backend_context=1 customer="*" search_term=trim($smarty.get.search_term) search_in="ref,customer_ref,customer_firstname,customer_lastname,customer_email"} {loop type="order_address" name="order-invoice-address" id=$INVOICE_ADDRESS} {assign "orderInvoiceFirstName" $FIRSTNAME} {assign "orderInvoiceLastName" $LASTNAME} @@ -187,7 +187,7 @@ - {loop type="product" name="product-search" visible="*" search_mode="sentence" search_term=$smarty.get.search_term search_in="ref,title"} + {loop type="product" name="product-search" visible="*" search_mode="sentence" search_term=trim($smarty.get.search_term) search_in="ref,title"} diff --git a/templates/backOffice/default/shipping-configuration-edit.html b/templates/backOffice/default/shipping-configuration-edit.html index 26fb3d2b2..f4eb75c96 100644 --- a/templates/backOffice/default/shipping-configuration-edit.html +++ b/templates/backOffice/default/shipping-configuration-edit.html @@ -14,21 +14,28 @@
  • {intl l="Home"}
  • {intl l="Configuration"}
  • {intl l="Shipping configuration"}
  • -
  • {intl l='Editing shipping configuration "%name"' name="{$NAME}"}
  • +
  • {intl l='Editing shipping zone "%name"' name="{$NAME}"}
  • - -
    - {intl l='Edit shipping configuration %title' title=$NAME} + +
    +
    +
    + {intl l='Shipping zone "%title"' title={$NAME}} +
    + +
    - + {ifloop rel="country-without-area"} {form name="thelia.admin.area.country"} {form_hidden_fields form=$form} @@ -41,7 +48,7 @@ {/form_field} {form_field form=$form field='country_id'} - +
    - {intl l='Cart - Prices in %currency' currency=$orderCurrency} + {intl l='Cart - Prices in %currency' currency={$orderCurrency}}
    {format_money number=$realPrice symbol=$orderCurrency} {format_money number=$realTax symbol=$orderCurrency}
    + {admin_sortable_header + current_order=$orders_order + order='id' + reverse_order='id-reverse' + path={url path='/admin/orders'} + request_parameter_name='orders_order' + label="{intl l='ID'}" + } {admin_sortable_header current_order=$orders_order @@ -39,7 +49,7 @@ reverse_order='reference-reverse' path={url path='/admin/orders'} request_parameter_name='orders_order' - label="{intl l='Order #'}" + label="{intl l='Reference'}" } @@ -111,6 +121,7 @@
    {$ID} {$REF} {format_date date=$CREATE_DATE} {$orderInvoiceCompany}
    + {include + file = "includes/pagination.html" -
    -
      - {if $order_page != 1} -
    • «
    • - {else} -
    • «
    • - {/if} - - {pageloop rel="order-list"} - {if $PAGE != $CURRENT} -
    • {$PAGE}
    • - - {else} -
    • {$PAGE}
    • - {/if} - - - {/pageloop} - {if $PAGE == $LAST && $LAST != $CURRENT} -
    • »
    • - {else} -
    • »
    • - {/if} -
    -
    + loop_ref = "order-list" + max_page_count = 10 + page_url = "{url path="/admin/orders" orders_order=$orders_order}" + }
    {intl l="Code"} {intl l="Name"}{intl l="Description"}{intl l="Description"} {intl l="Actions"}
    {$TITLE} + {if $can_change} + + {$CODE} + + {else} + {$CODE} + {/if} + + {if $can_change} + + {$TITLE} + + {else} + {$TITLE} + {/if} + {$DESCRIPTION}
    - {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.profile" access="UPDATE"} + {if $can_change} - {/loop} + {/if} {assign linkedAdminCount {count name="linked-admin" type="admin" profile=$ID}} @@ -93,27 +116,34 @@ {form_hidden_fields form=$form} - {form_field form=$form field='locale'} - - {/form_field} + {loop type="lang" name="current-edit-lang" default_only="1"} +
    + {$TITLE} + {intl l="Enter information in the default language (%title)" title={$TITLE}} +
    + + {form_field form=$form field='locale'} + + {/form_field} + {/loop} {form_field form=$form field='code'}
    - +
    {/form_field} {form_field form=$form field='title'}
    - +
    {/form_field} {form_field form=$form field='chapo'}
    - +
    {/form_field} @@ -121,7 +151,7 @@ {form_field form=$form field='description'}
    @@ -131,11 +161,11 @@ {form_field form=$form field='postscriptum'}
    - +
    {/form_field} - + {module_include location='profile_create_form'} {/capture} {include diff --git a/templates/backOffice/default/search.html b/templates/backOffice/default/search.html index e2f1f9211..7e16e08e7 100644 --- a/templates/backOffice/default/search.html +++ b/templates/backOffice/default/search.html @@ -13,7 +13,7 @@ @@ -54,7 +54,7 @@
    {$ID}
    - - + + {loop name="country-area" type="country" area=$area_id backend_context="1"} - {/loop} + {elseloop rel="country-area"} + + {/elseloop} {module_include location='shipping-configuration-edit'}
    {intl l="Country"}{intl l="Actions"}{intl l="Countries assigned to this zone"}{intl l="Actions"}
    {$TITLE} +
    + {intl l="This shipping zone does not contains any country."} +
    @@ -105,6 +123,8 @@ {capture "delete_country_dialog"} + + {module_include location='shipping_configuration_delete_form'} {/capture} {include @@ -112,7 +132,7 @@ dialog_id = "delete_country_dialog" dialog_title = {intl l="Remove country"} - dialog_message = {intl l="Do you really want to remove this country ?"} + dialog_message = {intl l="Do you really want to remove this country from this shipping zone ?"} form_action = {url path='/admin/configuration/shipping_configuration/country/remove'} form_content = {$smarty.capture.delete_country_dialog nofilter} diff --git a/templates/backOffice/default/shipping-configuration.html b/templates/backOffice/default/shipping-configuration.html index 7993b8238..ae662816f 100644 --- a/templates/backOffice/default/shipping-configuration.html +++ b/templates/backOffice/default/shipping-configuration.html @@ -13,7 +13,7 @@ {module_include location='shipping_configuration_top'} @@ -24,37 +24,54 @@
    - + + {module_include location='shipping_configuration_table_header'} - + {loop name="area-list" type="area" backend_context="1"} - + + {module_include location='shipping_configuration_table_row'} - @@ -72,7 +89,7 @@ - {* Adding a new Shipping configuration *} + {* Adding a new Shipping zone *} {* Capture the dialog body, to pass it to the generic dialog *} {capture "creation_dialog"} @@ -86,7 +103,7 @@ {form_field form=$form field="name"}
    - +
    {/form_field} @@ -99,10 +116,10 @@ file = "includes/generic-create-dialog.html" dialog_id = "creation_dialog" - dialog_title = {intl l="Create a new shipping configuration"} + dialog_title = {intl l="Create a new shipping zone"} dialog_body = {$smarty.capture.creation_dialog nofilter} - dialog_ok_label = {intl l="Create this shipping configuration"} + dialog_ok_label = {intl l="Create this shipping zone"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path='/admin/configuration/shipping_configuration/create'} @@ -123,8 +140,8 @@ file = "includes/generic-confirm-dialog.html" dialog_id = "delete_dialog" - dialog_title = {intl l="Delete shipping configuration"} - dialog_message = {intl l="Do you really want to delete this shipping configuration ?"} + dialog_title = {intl l="Delete shipping zone"} + dialog_message = {intl l="Do you really want to delete this shipping zone ?"} form_action = {url path='/admin/configuration/shipping_configuration/delete'} form_content = {$smarty.capture.delete_dialog nofilter} diff --git a/templates/backOffice/default/shipping-zones-edit.html b/templates/backOffice/default/shipping-zones-edit.html index 6d76bc5eb..8a18a1f59 100644 --- a/templates/backOffice/default/shipping-zones-edit.html +++ b/templates/backOffice/default/shipping-zones-edit.html @@ -10,40 +10,51 @@
    + {loop type="module" id="$delivery_module_id" active="*" name="module.name" backend_context="1"} +
    - -
    - {intl l='Edit shipping zone %title' title=$TITLE} + +
    +
    +
    + {intl l='Shipping configuration of delivery module "%title"' title={$TITLE}} +
    + +
    +
    + {ifloop rel="area.module.not_associated"} {form name="thelia.shopping_zone_area"} {form_hidden_fields form=$form} {form_field form=$form field='success_url'} - {* the url the user is redirected to on login success *} + {* the url the user is redirected to on login success *} {/form_field} {form_field form=$form field='shipping_zone_id'} - + {/form_field} {form_field form=$form field='area_id'}
    @@ -54,6 +65,12 @@ {/form_field} {/form} + {/ifloop} + {elseloop rel="area.module.not_associated"} +
    + {intl l="This delivery module handles all shipping zones."} +
    + {/elseloop}
    @@ -61,21 +78,30 @@
    - {intl l='Thelia Shipping configuration'} + {intl l='Shipping zones management'} {loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.shipping-configuration" access="CREATE"} - + {/loop}
    {intl l="Description"}{intl l="Zone name"}{intl l="Associated countries"}{intl l="Actions"}{intl l="Actions"}
    {$NAME}{$NAME} + {loop name="country-area" type="country" area=$ID backend_context="1" limit="6"} + {$TITLE}{if $LOOP_COUNT < $LOOP_TOTAL},{/if} + {/loop} + + {ifloop rel="country-area-more"} + {$countries = ''} + {loop name="country-area-more" type="country" area=$ID backend_context="1" offset="6"} + {$countries = "$countries, $TITLE"} + {$ctry_count=$LOOP_COUNT} + {/loop} + {$countries = ltrim($countries, ', ')} + + {intl l="%count more..." count={$ctry_count}} + {/ifloop} + +
    {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.shipping-configuration" access="UPDATE"} - + {/loop} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.shipping-configuration" access="DELETE"} - + {/loop}
    - - + + - {loop type="area" name="area.module.associated" with_zone=$shipping_zones_id} + {loop type="area" name="area.module.associated" with_zone=$delivery_module_id} - {/loop} + {elseloop rel="area.module.associated"} + + + + {/elseloop}
    {intl l="Zones"}{intl l="Actions"}{intl l="Shipping zone"}{intl l="Actions"}
    {$NAME} +
    +
    + {intl l="There are no shipping zones attached to this module."} +
    +
    @@ -86,6 +112,7 @@
    + {/loop}
    @@ -96,17 +123,17 @@ {form_hidden_fields form=$form} {form_field form=$form field='success_url'} - {* the url the user is redirected to on login success *} + {* the url the user is redirected to on login success *} {/form_field} {form_field form=$form field='shipping_zone_id'} - + {/form_field} {form_field form=$form field='area_id'} {/form_field} - + {module_include location='zone_delete_form'} {/form} {/capture} diff --git a/templates/backOffice/default/shipping-zones.html b/templates/backOffice/default/shipping-zones.html index 26f860770..6382930d2 100644 --- a/templates/backOffice/default/shipping-zones.html +++ b/templates/backOffice/default/shipping-zones.html @@ -21,18 +21,35 @@
    + + {ifloop rel="area-not-attached"} +
    +
    +
    + {intl l='Warning, some of your shipping zones are not attached to any delivery module:'} + {loop name="area-not-attached" type="area" unassigned=true} + {$NAME}{if $LOOP_COUNT < $LOOP_TOTAL},{else}.{/if} + {/loop} +
    +
    +
    + {/ifloop} +
    + + - - + + + {module_include location='shipping_zones_table_header'} - + @@ -40,10 +57,23 @@ {loop type="module" module_type="2" active="*" name="delivery.list" backend_context="1"} + {module_include location='shipping_zones_table_row'} -
    - {intl l='Thelia Shipping zones'} + {intl l='Shipping zones'}
    {intl l="Name"}
    {intl l="Delivery module"}{intl l="Shipping zones for this module"}{intl l="Actions"}{intl l="Actions"}
    {$TITLE} + {loop name="area.module.associated" type="area" with_zone=$ID backend_context="1"} + {$countries = ''} + {loop name="country-area" type="country" area=$ID backend_context="1"} + {$countries = "$countries, $TITLE"} + {/loop} + {$countries = ltrim($countries, ', ')} + {$NAME}{if $LOOP_COUNT < $LOOP_TOTAL},{/if} + {/loop} + {elseloop rel="area.module.associated"} + {intl l="There are no shipping zones attached to this module."} + {/elseloop} + +
    {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.shipping-zone" access="UPDATE"} diff --git a/templates/backOffice/default/system-logs.html b/templates/backOffice/default/system-logs.html index 9cf7f64fe..4bf8a1f60 100644 --- a/templates/backOffice/default/system-logs.html +++ b/templates/backOffice/default/system-logs.html @@ -129,7 +129,7 @@
    {intl l='Enter one or more IP V4 addresses separated by ";". Leave empty to display logs for all IP addresses'} - {intl l='Your current IP address is %ip' ip=$ip_address} + {intl l='Your current IP address is %ip' ip={$ip_address}} {/form_field} diff --git a/templates/backOffice/default/tax-edit.html b/templates/backOffice/default/tax-edit.html index de2d39d1b..31ff9ccd9 100644 --- a/templates/backOffice/default/tax-edit.html +++ b/templates/backOffice/default/tax-edit.html @@ -54,7 +54,7 @@ {form_field form=$form field='title'}
    - +
    {/form_field} @@ -62,7 +62,7 @@ {form_field form=$form field='description'}
    @@ -73,7 +73,7 @@ {form_field form=$form field='type'}
    @@ -91,7 +91,7 @@ {form_tagged_fields form=$form tag='requirements'}
    {if $formType == 'choice'}
    {/form_field} @@ -73,7 +73,7 @@ {form_field form=$form field='description'}
    @@ -249,6 +249,8 @@ {/form_field} + {module_include location='tax_list_update_form'} + {/capture} {include diff --git a/templates/backOffice/default/taxes-rules.html b/templates/backOffice/default/taxes-rules.html index e9d80efed..84cd6f2d6 100644 --- a/templates/backOffice/default/taxes-rules.html +++ b/templates/backOffice/default/taxes-rules.html @@ -167,7 +167,7 @@ {form_field form=$form field='title'}
    - +
    {/form_field} @@ -175,7 +175,7 @@ {form_field form=$form field='description'}
    @@ -186,7 +186,7 @@ {form_field form=$form field='type'}
    @@ -206,7 +206,7 @@ {form_tagged_fields form=$form tag='requirements'}
    {if $formType == 'choice'}
    {/form_field} @@ -290,14 +292,14 @@ form_content = {$smarty.capture.tax_delete_dialog nofilter} {form_field form=$form field='description'}
    {/form_field} - + {module_include location='tax_rule_create_form'} {/capture} {include diff --git a/templates/backOffice/default/template-edit.html b/templates/backOffice/default/template-edit.html index 5c0fc8114..82d66057a 100644 --- a/templates/backOffice/default/template-edit.html +++ b/templates/backOffice/default/template-edit.html @@ -16,7 +16,7 @@
  • {intl l="Home"}
  • {intl l="Configuration"}
  • {intl l="Templates"}
  • -
  • {intl l='Editing template "%name"' name=$NAME}
  • +
  • {intl l='Editing template "%name"' name={$NAME}}
  • @@ -67,7 +67,7 @@

    {intl l='Attributes'}

    -

    Manage attributes included in this product templates

    +

    {intl l="Manage attributes included in this product template"}

    @@ -78,7 +78,7 @@

    {intl l='Features'}

    -

    Manage features included in this product templates

    +

    {intl l="Manage features included in this product template"}

    @@ -97,7 +97,7 @@
    - {intl l="Sorry, template ID=%id was not found." id=$template_id} + {intl l="Sorry, template ID=%id was not found." id={$template_id}}
    diff --git a/templates/backOffice/default/templates.html b/templates/backOffice/default/templates.html index 2fa5d61b9..0e9370b25 100644 --- a/templates/backOffice/default/templates.html +++ b/templates/backOffice/default/templates.html @@ -138,10 +138,10 @@ {loop type="lang" name="default-lang" default_only="1"}
    - {intl l=$TITLE} + {$TITLE}
    -
    {intl l="Enter here the template name in the default language (%title)" title=$TITLE}
    +
    {intl l="Enter here the template name in the default language (%title)" title={$TITLE}}
    {* Switch edition to the current locale *} diff --git a/templates/backOffice/default/tools.html b/templates/backOffice/default/tools.html new file mode 100644 index 000000000..f21d9cbc9 --- /dev/null +++ b/templates/backOffice/default/tools.html @@ -0,0 +1,60 @@ +{extends file="admin-layout.tpl"} + +{block name="page-title"}{intl l='Tools'}{/block} + +{block name="check-resource"}admin.tools{/block} +{block name="check-access"}view{/block} + +{block name="main-content"} +
    + +
    + + + + {module_include location='tools_top'} + +
    + +
    + +
    + + {module_include location='configuration_bottom'} +
    +
    +
    +{/block} + +{block name="javascript-last-call"} + {module_include location='configuration-js'} +{/block} \ No newline at end of file diff --git a/templates/backOffice/default/translations.html b/templates/backOffice/default/translations.html index bbcd7c6c0..fbe0321d4 100644 --- a/templates/backOffice/default/translations.html +++ b/templates/backOffice/default/translations.html @@ -1,323 +1,357 @@ -{extends file="admin-layout.tpl"} - -{block name="page-title"}{intl l='Translations'}{/block} - -{block name="check-resource"}admin.configuration.variable{/block} -{block name="check-access"}update{/block} - -{block name="main-content"} -
    - -
    - - - -
    -
    -
    - -
    - {intl l="Translation"} -
    - -
    -
    -
    -
    - - {include - file = "includes/inner-form-toolbar.html" - close_url = {url path='/admin/configuration'} - } - - - -
    -
    -
    - - - -
    -
    - - {if $item_to_translate == 'mo'} -
    -
    - - - -
    -
    - {else if $item_to_translate == 'fo'} -
    -
    - - - -
    -
    - {else if $item_to_translate == 'bo'} -
    -
    - - - -
    -
    - {else if $item_to_translate == 'ma'} -
    -
    - - - -
    -
    - {else if $item_to_translate == 'pf'} -
    -
    - - - -
    -
    - {/if} - - -
    -
    - - -
    -
    -
    -
    - - {* -- STRINGS TO TRANSLATE --------------------------------------------- *} - - {$currfile = false} - {$close_last_panel = false} - - {$idx = 0} - - {foreach $all_strings as $info} - - - - {$not_translated = empty($info.translation)} - - {if $view_missing_traductions_only != 1 || $not_translated } - - {* Create a liste of files names *} - - {if count($info.files) > 1} - {$label = {intl l='In pages:'}} - {capture name="banner" assign=file_names} -
      - {foreach $info.files as $file} -
    • {$file}
    • - {/foreach} -
    - {/capture} - {else} - {$label = {intl l='In page'}} - {$file_names = $info.files.0} - {/if} - - {* Display current file liste, if required *} - - {if $file_names != $currfile} - - {if $currfile !== false} - {* Close current panel *} -
    - {$close_last_panel = false} - {/if} - - {$currfile = $file_names} - -
    -
    - {loop name="lang_list" type="lang" id=$edit_language_id} - {$TITLE} - {/loop} - - {$label} {$file_names nofilter} - -
    - - - - {$close_last_panel = true} - {/if} - - - - - - - - {else} - - {* Text is not displayed, put it in a hidden field *} - - - {/if} - - {$idx = $idx + 1} - {/foreach} - - {if isset($all_strings) } - - {if empty($all_strings) } -
    - {intl l='Did not found any text to translate. It\'s probably normal. If not, please be sure to use Smarty\'s "intl" function in templates, or the Translator::trans() method in PHP files.'} -
    - {else if $view_missing_traductions_only == 1 && $currfile == false } -
    - {intl l='Congratulations, all text is now translated !'} -
    - {/if} - - {if $close_last_panel} - {* close the last panel *} -
    - {$info.text} - - - {if $info.dollar} -
    - {intl l='Warning'} - {intl l='Il seems that this string contains a Smarty variable ($). If \'s the case, it cannot be transleted properly.'} -
    - {/if} -
    -
    - - -
    -
    - {/if} - {/if} - - {if $max_input_vars_warning} -
    - {intl l='Cannot translate all fields. According to your PHP configuration, forms cannot contains more than - %current_max_input_vars input fields, but at least %required_max_input_vars are required. Please change the value of max_input_vars in your PHP configuration - of change the translation file by hand.' - - current_max_input_vars=$current_max_input_vars - required_max_input_vars=$required_max_input_vars - } -
    - {/if} - - -
    -
    -
    -
    - -
    -
    -
    -{/block} - -{block name="javascript-initialization"} - -{/block} - -{block name="javascript-last-call"} - {module_include location='translations-js'} -{/block} +{extends file="admin-layout.tpl"} + +{block name="page-title"}{intl l='Translations'}{/block} + +{block name="check-resource"}admin.configuration.variable{/block} +{block name="check-access"}update{/block} + +{block name="main-content"} +
    + +
    + + + +
    +
    +
    + +
    + {intl l="Translation"} +
    + +
    +
    +
    +
    + + {include + file = "includes/inner-form-toolbar.html" + close_url = {url path='/admin/configuration'} + } + + + +
    +
    +
    + + + +
    +
    + + {if $item_to_translate == 'mo'} +
    +
    + + + +
    +
    + {else if $item_to_translate == 'fo'} +
    +
    + + + +
    +
    + {else if $item_to_translate == 'bo'} +
    +
    + + + +
    +
    + {else if $item_to_translate == 'ma'} +
    +
    + + + +
    +
    + {else if $item_to_translate == 'pf'} +
    +
    + + + +
    +
    + {/if} + + {if $item_to_translate == 'mo' && $item_name != ''} +
    +
    + + + +
    +
    + {/if} +
    + +
    +
    +
    + +
    +
    +
    +
    + + {* -- STRINGS TO TRANSLATE --------------------------------------------- *} + + {$currfile = false} + {$close_last_panel = false} + + {$idx = 0} + + {foreach $all_strings as $info} + + + + {$not_translated = empty($info.translation)} + + {if $view_missing_traductions_only != 1 || $not_translated } + + {* Create a liste of files names *} + + {if count($info.files) > 1} + {$label = {intl l='In pages:'}} + {capture name="banner" assign=file_names} +
      + {foreach $info.files as $file} +
    • {$file}
    • + {/foreach} +
    + {/capture} + {else} + {$label = {intl l='In page'}} + {$file_names = $info.files.0} + {/if} + + {* Display current file liste, if required *} + + {if $file_names != $currfile} + + {if $currfile !== false} + {* Close current panel *} +
    + {$close_last_panel = false} + {/if} + + {$currfile = $file_names} + +
    +
    + {loop name="lang_list" type="lang" id=$edit_language_id} + {$TITLE} + {/loop} + + {$label} {$file_names nofilter} + +
    + + + + {$close_last_panel = true} + {/if} + + + + + + + + {else} + + {* Text is not displayed, put it in a hidden field *} + + + {/if} + + {$idx = $idx + 1} + {/foreach} + + {if isset($all_strings) } + + {if empty($all_strings) } +
    + {intl l='Did not found any text to translate. It\'s probably normal. If not, please be sure to use Smarty\'s "intl" function in templates, or the Translator::trans() method in PHP files.'} +
    + {else if $view_missing_traductions_only == 1 && $currfile == false } +
    + {intl l='Congratulations, all text is now translated !'} +
    + {/if} + + {if $close_last_panel} + {* close the last panel *} +
    + {$info.text} + + + {if $info.dollar} +
    + {intl l='Warning'} + {intl l='Il seems that this string contains a Smarty variable ($). If \'s the case, it cannot be transleted properly.'} +
    + {/if} +
    +
    + + +
    +
    + {/if} + {/if} + + {if $max_input_vars_warning} +
    + {intl l='Cannot translate all fields. According to your PHP configuration, forms cannot contains more than %current_max_input_vars input fields, but at least %required_max_input_vars are required. Please change the value of max_input_vars in your PHP configuration of change the translation file by hand.' + current_max_input_vars=$current_max_input_vars + required_max_input_vars=$required_max_input_vars + } +
    + {/if} + + +
    +
    +
    +
    + +
    +
    +
    +{/block} + +{block name="javascript-initialization"} + +{/block} + +{block name="javascript-last-call"} + {module_include location='translations-js'} +{/block} diff --git a/templates/backOffice/default/variable-edit.html b/templates/backOffice/default/variable-edit.html index e5c801ee5..05d831e6f 100644 --- a/templates/backOffice/default/variable-edit.html +++ b/templates/backOffice/default/variable-edit.html @@ -16,7 +16,7 @@
  • {intl l="Home"}
  • {intl l="Configuration"}
  • {intl l="System variables"}
  • -
  • {intl l='Editing variable "%name"' name=$NAME}
  • +
  • {intl l='Editing variable "%name"' name={$NAME}}
  • @@ -24,7 +24,7 @@
    - {intl l="Edit variable %name" name=$NAME} + {intl l="Edit variable %name" name={$NAME}}
    @@ -106,7 +106,7 @@
    - {intl l="Sorry, variable ID=%id was not found." id=$variable_id} + {intl l="Sorry, variable ID=%id was not found." id={$variable_id}}
    diff --git a/templates/backOffice/default/variables.html b/templates/backOffice/default/variables.html index a6433a023..a31dababa 100644 --- a/templates/backOffice/default/variables.html +++ b/templates/backOffice/default/variables.html @@ -186,10 +186,10 @@
    - {intl l=$TITLE} + {$TITLE}
    -
    {intl l='Enter here the category name in the default language (%title)' title="$TITLE"}
    +
    {intl l='Enter here the category name in the default language (%title)' title={$TITLE}}
    {form_field form=$form field='locale'} diff --git a/templates/email/default/I18n/cs_CZ.php b/templates/email/default/I18n/cs_CZ.php new file mode 100644 index 000000000..4906fa89d --- /dev/null +++ b/templates/email/default/I18n/cs_CZ.php @@ -0,0 +1,36 @@ + 'Všechna práva vyhrazena.', + 'Billing address:' => 'Fakturační adresa:', + 'Copyright' => 'Autorská práva', + 'Delivery address:' => 'Doručovací adresa:', + 'Delivery method:' => 'Způsob doručení:', + 'Email not displaying correctly?' => 'E-mail se nezobrazuje správně?', + 'For any questions, or concerns, feel free to contact %mail.' => 'V případě jakýchkoliv dotazů nebo připomínek, neváhejte nás kontaktovat na %mail.', + 'Here are the details of your purchase:' => 'Podrobnosti o nákupu:', + 'Hi there' => 'Zdravím', + 'Kind regards' => 'S pozdravem', + 'Order Number:' => 'Číslo objednávky:', + 'Order Total' => 'Objednávka celkem', + 'Order Total:' => 'Objednávka celkem:', + 'Our contact us at:' => 'Kontaktujte nás na:', + 'Our mailing address is:' => 'Naše poštovní adresa je:', + 'Paid With:' => 'Zaplaceno:', + 'Password' => 'Heslo', + 'Price in' => 'Cena v', + 'Purchase Date:' => 'Datum nákupu:', + 'Shipping:' => 'Poštovné:', + 'Support' => 'Podpora', + 'Thank you for your order!' => 'Děkujeme za objednávku!', + 'Thanks' => 'Děkuji', + 'Thelia V2' => 'Thelia V2', + 'Total' => 'Celkem', + 'View it in your browser' => 'Zobrazit v prohlížeči', + 'What You Purchased' => 'Co jste si zakoupili', + 'You can change your password in your user account by opening the "Change my password" link under your personal information' => 'Můžete změnit své heslo ve vašem uživatelském účtu tak, že otevře odkaz "Změnit heslo" v záložce vaše osobní údaje', + 'You have requested a new password for your account' => 'Požádali jste o nové heslo pro váš účet', + 'Your new password is' => 'Vaše nové heslo je', + 'Your order confirmation Nº %ref' => 'Potvrzení objednávky č. %ref', + 'Your password for %store' => 'Vaše heslo pro %store', +); diff --git a/templates/email/default/I18n/en_US.php b/templates/email/default/I18n/en_US.php index 6d8ef0f1b..8e5c207ac 100644 --- a/templates/email/default/I18n/en_US.php +++ b/templates/email/default/I18n/en_US.php @@ -1,4 +1,36 @@ 'All rights reserved.', + 'Billing address:' => 'Billing address:', + 'Copyright' => 'Copyright', + 'Delivery address:' => 'Delivery address:', + 'Delivery method:' => 'Delivery method:', + 'Email not displaying correctly?' => 'Email not displaying correctly?', + 'For any questions, or concerns, feel free to contact %mail.' => 'For any questions, or concerns, feel free to contact %mail.', + 'Here are the details of your purchase:' => 'Here are the details of your purchase:', + 'Hi there' => 'Hi there', + 'Kind regards' => 'Kind regards', + 'Order Number:' => 'Order Number:', + 'Order Total' => 'Order Total', + 'Order Total:' => 'Order Total:', + 'Our contact us at:' => 'Our contact us at:', + 'Our mailing address is:' => 'Our mailing address is:', + 'Paid With:' => 'Paid With:', + 'Password' => 'Password', + 'Price in' => 'Price in', + 'Purchase Date:' => 'Purchase Date:', + 'Shipping:' => 'Shipping:', + 'Support' => 'Support', + 'Thank you for your order!' => 'Thank you for your order!', + 'Thanks' => 'Thanks', + 'Thelia V2' => 'Thelia V2', + 'Total' => 'Total', + 'View it in your browser' => 'View it in your browser', + 'What You Purchased' => 'What You Purchased', + 'You can change your password in your user account by opening the "Change my password" link under your personal information' => 'You can change your password in your user account by opening the "Change my password" link under your personal information', + 'You have requested a new password for your account' => 'You have requested a new password for your account', + 'Your new password is' => 'Your new password is', + 'Your order confirmation Nº %ref' => 'Your order confirmation Nº %ref', + 'Your password for %store' => 'Your password for %store', +); diff --git a/templates/email/default/I18n/es_ES.php b/templates/email/default/I18n/es_ES.php index 6d8ef0f1b..df9b7a9bf 100644 --- a/templates/email/default/I18n/es_ES.php +++ b/templates/email/default/I18n/es_ES.php @@ -1,4 +1,30 @@ 'All rights reserved.', + 'Billing address:' => 'dirección de factura', + 'Copyright' => 'Copyright', + 'Delivery address:' => 'dirección de entraga', + 'Delivery method:' => 'entraga con : ', + 'Email not displaying correctly?' => 'No puedes ver correctamente el mail ?', + 'Here are the details of your purchase:' => 'Detalles del encarga', + 'Hi there' => 'Holà', + 'Kind regards' => 'Gracias', + 'Order Number:' => 'Entraga numero', + 'Order Total' => 'Total de la entraga', + 'Order Total:' => 'Total de la entraga', + 'Our mailing address is:' => 'Nuestra dirección', + 'Paid With:' => 'pagado con : ', + 'Password' => 'contraseña', + 'Shipping:' => 'envio', + 'Support' => 'Support', + 'Thank you for your order!' => 'Graciàs por su encarga', + 'Thanks' => 'Gracias ', + 'Thelia V2' => 'Thelia V2', + 'Total' => 'Total', + 'View it in your browser' => 'Ver en el navegador ', + 'You can change your password in your user account by opening the "Change my password" link under your personal information' => 'Puedes cambiar tu contraseña en tu cuenta', + 'Your new password is' => 'la nueva contraseña es', + 'Your order confirmation Nº %ref' => 'Numero de encarga : %ref', + 'Your password for %store' => 'contraseña por %store', +); diff --git a/templates/email/default/I18n/fr_FR.php b/templates/email/default/I18n/fr_FR.php index 6d8ef0f1b..9e24f4495 100644 --- a/templates/email/default/I18n/fr_FR.php +++ b/templates/email/default/I18n/fr_FR.php @@ -1,4 +1,36 @@ 'Tous droits réservés', + 'Billing address:' => 'Adresse de facturation : ', + 'Copyright' => 'Copyright', + 'Delivery address:' => 'Adresse de livraison : ', + 'Delivery method:' => 'Livré par : ', + 'Email not displaying correctly?' => 'Le mail ne s\'affiche pas correctement ?', + 'For any questions, or concerns, feel free to contact %mail.' => 'Pour toutes questions contactez nous par mail : %mail.', + 'Here are the details of your purchase:' => 'Voici les détails de votre commande', + 'Hi there' => 'Bonjour', + 'Kind regards' => 'Cordialement', + 'Order Number:' => 'Commande N° : ', + 'Order Total' => 'Total de la commande', + 'Order Total:' => 'Total de la commande : ', + 'Our contact us at:' => 'Contactez nous au', + 'Our mailing address is:' => 'Adresse postale', + 'Paid With:' => 'Payé par : ', + 'Password' => 'Mot de passe', + 'Price in' => 'Prix en', + 'Purchase Date:' => 'Date d\'achat : ', + 'Shipping:' => 'Frais de livraison', + 'Support' => 'SAV', + 'Thank you for your order!' => 'Merci pour votre commande', + 'Thanks' => 'Merci', + 'Thelia V2' => 'Thelia V2', + 'Total' => 'Total', + 'View it in your browser' => 'Voir dans le navigateur', + 'What You Purchased' => 'Ce que vous avez acheté', + 'You can change your password in your user account by opening the "Change my password" link under your personal information' => 'Vous pouvez changer votre mot de passe dans votre espace client', + 'You have requested a new password for your account' => 'Vous avez demandé un nouveau mot de passe', + 'Your new password is' => 'Votre nouveau mot de passe est', + 'Your order confirmation Nº %ref' => 'Confirmation de commande N° %ref', + 'Your password for %store' => 'Votre mot de passe pour %store', +); diff --git a/templates/email/default/I18n/ru_RU.php b/templates/email/default/I18n/ru_RU.php new file mode 100644 index 000000000..73a6f76ff --- /dev/null +++ b/templates/email/default/I18n/ru_RU.php @@ -0,0 +1,36 @@ + 'Все права защищены.', + 'Billing address:' => 'Адрес плательщика:', + 'Copyright' => 'Авторское право', + 'Delivery address:' => 'Адрес доставки:', + 'Delivery method:' => 'Способ доставки:', + 'Email not displaying correctly?' => 'Письмо отображается неправильно?', + 'For any questions, or concerns, feel free to contact %mail.' => 'С любыми вопросами или предложениями Вы можете обратиться к нам на %mail.', + 'Here are the details of your purchase:' => 'Подробности Вашего заказа:', + 'Hi there' => 'Привет', + 'Kind regards' => 'С наилучшими пожеланиями', + 'Order Number:' => 'Номер заказа:', + 'Order Total' => 'Сумма заказа', + 'Order Total:' => 'Сумма заказа:', + 'Our contact us at:' => 'Наша контактная информация:', + 'Our mailing address is:' => 'Наш почтовый адрес:', + 'Paid With:' => 'Заплачено:', + 'Password' => 'Пароль', + 'Price in' => 'Цена в', + 'Purchase Date:' => 'Дата покупки:', + 'Shipping:' => 'Доставка:', + 'Support' => 'Поддержка', + 'Thank you for your order!' => 'Спасибо за заказ!', + 'Thanks' => 'Спасибо', + 'Thelia V2' => 'Thelia V2', + 'Total' => 'Итого', + 'View it in your browser' => 'Просмотреть в браузере', + 'What You Purchased' => 'То, что вы приобрели', + 'You can change your password in your user account by opening the "Change my password" link under your personal information' => 'Вы можете изменить свой пароль в учетной записи пользователя, открыв ссылку «Изменить пароль» в разделе личная информация', + 'You have requested a new password for your account' => 'Вы запросили новый пароль для Вашей учетной записи', + 'Your new password is' => 'Ваш новый пароль', + 'Your order confirmation Nº %ref' => 'Подтверждение заказа № %ref', + 'Your password for %store' => 'Ваш пароль на %store', +); diff --git a/templates/email/default/assets/img/header.jpg b/templates/email/default/assets/img/header.jpg new file mode 100644 index 000000000..c80e16529 Binary files /dev/null and b/templates/email/default/assets/img/header.jpg differ diff --git a/templates/email/default/assets/img/logo.gif b/templates/email/default/assets/img/logo.gif new file mode 100644 index 000000000..cfa396641 Binary files /dev/null and b/templates/email/default/assets/img/logo.gif differ diff --git a/templates/email/default/default-html-layout.tpl b/templates/email/default/default-html-layout.tpl index 2e96d2f35..a40c9f013 100644 --- a/templates/email/default/default-html-layout.tpl +++ b/templates/email/default/default-html-layout.tpl @@ -1,3 +1,14 @@ +{*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************} + {* This is the default HTML mail layout. Use {$message_body} as a placeholder for the HTML message defined in the 'HTML Message' field in the back-office, or the @@ -7,4 +18,8 @@ Be sure to use the nofilter modifier, to prevent HTML escaping. DO NOT DELETE THIS FILE, some plugins may use it. *} + +{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *} +{default_translation_domain domain='email.default'} + {block name='message-body'}{$message_body nofilter}{/block} \ No newline at end of file diff --git a/templates/email/default/default-text-layout.tpl b/templates/email/default/default-text-layout.tpl index aeb07e655..cd3d38a18 100644 --- a/templates/email/default/default-text-layout.tpl +++ b/templates/email/default/default-text-layout.tpl @@ -1,3 +1,14 @@ +{*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************} + {* This is the default TEXT mail layout. Use {$message_body} as a placeholder for the text message defined in the 'TEXT Message' field in the back-office, or the @@ -7,4 +18,8 @@ Be sure to use the nofilter modifier, to prevent HTML escaping. DO NOT DELETE THIS FILE, some plugins may use it. *} + +{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *} +{default_translation_domain domain='email.default'} + {block name='message-body'}{$message_body nofilter}{/block} \ No newline at end of file diff --git a/templates/frontOffice/default/email/template.tpl b/templates/email/default/email-layout.tpl similarity index 84% rename from templates/frontOffice/default/email/template.tpl rename to templates/email/default/email-layout.tpl index 53eea9b00..72f8875a4 100644 --- a/templates/frontOffice/default/email/template.tpl +++ b/templates/email/default/email-layout.tpl @@ -1,5 +1,7 @@ +{default_translation_domain domain='email.default'} +{declare_assets directory='assets'} {assign var="url_site" value="{config key="url_site"}"} -{assign var="company_name" value="{config key="company_name"}"} +{assign var="company_name" value="{config key="store_name"}"} {if not $company_name} {assign var="company_name" value="{intl l='Thelia V2'}"} {/if} @@ -330,8 +332,8 @@ body,#bodyTable{ } .preheaderContent a:link,.preheaderContent a:visited,.preheaderContent a .yshortcuts{ - color:#f49a17; - } + color:#f49a17; +} .footerContent a:link,.footerContent a:visited,.footerContent a .yshortcuts{ color:#ffffff; } @@ -359,7 +361,7 @@ body,#bodyTable{ @@ -461,15 +451,6 @@ body,#bodyTable{ {intl l="Copyright"} © {'Y'|date} {$company_name}, {intl l="All rights reserved."} - {* Unsubscribe - - - *}
    - {block name="email-intro"}{intl l="Welcome to Thelia. This is a demo site built with Thelia V2 an E-Commerce solution based on Symfony 2."}{/block} + {block name="email-intro"}{/block} @@ -380,7 +382,7 @@ body,#bodyTable{
    - {images file='../assets/img/email/logo.gif'}{$company_name}{/images} + {images file='assets/img/logo.gif'}{$company_name}{/images}
    @@ -411,7 +413,7 @@ body,#bodyTable{ @@ -419,18 +421,6 @@ body,#bodyTable{ {block name="email-content"}{/block} - {* button - - - *}
    - {images file='../assets/img/email/header.jpg'}{/images} + {images file='assets/img/header.jpg'}{/images}
    - - - - -
    - Link Button -
    -
    - unsubscribe from this list   update subscription preferences  -
    -
    - *|IF:REWARDS|* *|HTML:REWARDS|* *|END:IF|* -
    diff --git a/templates/email/default/order_confirmation.html b/templates/email/default/order_confirmation.html index 4441e52cd..4901870fb 100644 --- a/templates/email/default/order_confirmation.html +++ b/templates/email/default/order_confirmation.html @@ -1,107 +1,123 @@ -{loop name="order.invoice" type="order" id=$order_id customer="*"} - {loop name="currency.order" type="currency" id=$CURRENCY} - {assign "orderCurrency" $SYMBOL} - {/loop} -{loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"} - {assign var="customer_ref" value=$REF} -{/loop} - - - - - courriel de confirmation de commande de {config key="url_site"} - {literal} - - {/literal} - - -
    -

    {config key="company_name"}

    -

    Confirmation de commande

    -

    N° {$REF} du {format_date date=$INVOICE_DATE output="date"}

    -
    - - - - - - - - - {loop type="order_product" name="order-products" order=$ID} - {if $WAS_IN_PROMO == 1} - {assign "realPrice" $PROMO_PRICE} - {assign "realTax" $PROMO_PRICE_TAX} - {assign "realTaxedPrice" $TAXED_PROMO_PRICE} - {else} - {assign "realPrice" $PRICE} - {assign "realTax" $PRICE_TAX} - {assign "realTaxedPrice" $TAXED_PRICE} - {/if} - - - - - - +{extends file="email-layout.tpl"} + +{* Open in browser *} +{block name="browser"}{/block} + +{* Subject *} +{block name="email-subject"}{intl l="Your order confirmation Nº %ref" ref={$order_ref}}{/block} + +{* Title *} +{block name="email-title"}{intl l="Thank you for your order!"}{/block} + +{* Content *} +{block name="email-content"} + + {loop name="order.invoice" type="order" id=$order_id customer="*"} + {loop name="currency.order" type="currency" id=$CURRENCY} + {assign "orderCurrencySymbol" $SYMBOL} + {assign var="orderCurrencyIsoCode" value=$ISOCODE} + {/loop} + {loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"} + {assign var="customerRef" value=$REF} {/loop} - - - - - - - - - - - - - - - - - -
    RéférenceDésignationP.U. €Qté
    {$REF}{$TITLE} - {ifloop rel="combinations"} - {loop type="order_product_attribute_combination" name="combinations" order_product=$ID} - {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}
    - {/loop} - {/ifloop} -
    {$orderCurrency} {$realTaxedPrice}{$QUANTITY}
     
    Montant total avant remise €{$orderCurrency} {$TOTAL_TAXED_AMOUNT - $POSTAGE}
    Port €{$orderCurrency} {$POSTAGE}
    Montant total de la commande €{$orderCurrency} {$TOTAL_TAXED_AMOUNT}
    -
    -

    LIVRAISON : {loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}

    - {loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS} -

    N° de client : {$customer_ref}

    -

    Nom : - {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}

    -

    N° et rue : - {$ADDRESS1}

    -

    Complément : {$ADDRESS2} - {$ADDRESS3}

    -

    Code postal : {$ZIPCODE}

    -

    Ville : {$CITY}

    -

    Pays : {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}

    -
    + + {intl l="Here are the details of your purchase:"}

    + + + + + + +
    + {intl l="Delivery address:"}
    + {loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS} + {$FIRSTNAME} {$LASTNAME}
    + {$ADDRESS1}
    + {if $ADDRESS2 != ""}{$ADDRESS2}
    {/if} + {if $ADDRESS3 != ""}{$ADDRESS3}
    {/if} + {$CITY}
    + {$ZIPCODE}, {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}
    + {/loop} +
    + {intl l="Billing address:"}
    + {loop type="order_address" name="invoice_address" id=$INVOICE_ADDRESS} + {$FIRSTNAME} {$LASTNAME}
    + {$ADDRESS1}
    + {if $ADDRESS2 != ""}{$ADDRESS2}
    {/if} + {if $ADDRESS3 != ""}{$ADDRESS3}
    {/if} + {$CITY}
    + {$ZIPCODE}, {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}
    + {/loop} +
    + +
    + +

    + {intl l="Order Total:"} {$TOTAL_TAXED_AMOUNT} {$orderCurrencySymbol} {$orderCurrencyIsoCode}
    + {intl l="Order Number:"} {$REF}
    + {intl l="Paid With:"} {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}
    + {intl l="Purchase Date:"} {format_date date=$CREATE_DATE output="date"}
    + {intl l="Delivery method:"} {loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}
    +

    + + + + + + + {loop type="order_product" name="order-products" order=$ID} + {if $WAS_IN_PROMO == 1} + {assign "realPrice" $PROMO_PRICE} + {assign "realTax" $PROMO_PRICE_TAX} + {assign "realTaxedPrice" $TAXED_PROMO_PRICE} + {else} + {assign "realPrice" $PRICE} + {assign "realTax" $PRICE_TAX} + {assign "realTaxedPrice" $TAXED_PRICE} + {/if} + + + + + {/loop} + + + + + + + + + + + + +
    {intl l="What You Purchased"}{intl l="Price in"} {$orderCurrencyIsoCode}
    + {$TITLE} ({$REF}) + {ifloop rel="combinations"}
    + {loop type="order_product_attribute_combination" name="combinations" order_product=$ID} + * {$ATTRIBUTE_TITLE}: {$ATTRIBUTE_AVAILABILITY_TITLE} + {/loop} + {/ifloop} +
    + {$QUANTITY} x {$realTaxedPrice} {$orderCurrencySymbol} +
    {intl l="Total"}{$TOTAL_TAXED_AMOUNT - $POSTAGE} {$orderCurrencySymbol}
    {intl l="Shipping:"}{$POSTAGE} {$orderCurrencySymbol}
    {intl l="Order Total"}{$TOTAL_TAXED_AMOUNT} {$orderCurrencySymbol}
    {/loop} -
    -

    FACTURATION : paiement par {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}

    - {loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS} -

    N° de client : {$customer_ref}

    -

    Nom : - {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}

    -

    N° et rue : - {$ADDRESS1}

    -

    Complément : {$ADDRESS2} - {$ADDRESS3}

    -

    Code postal : {$ZIPCODE}

    -

    Ville : {$CITY}

    -

    Pays : {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}

    -
    - {/loop} -

    Le suivi de votre commande est disponible dans la rubrique mon compte sur {config key="url_site"}

    -
    - - -{/loop} \ No newline at end of file + +
    + +

    {intl l="Support"}

    + {intl l='For any questions, or concerns, feel free to contact %mail.' mail={config key="store_email"}}

    + {intl l="Our contact us at:"}
    + {config key="store_name"}
    + {config key="store_address1"}
    + {config key="store_zipcode"}, {config key="store_city"}
    + {if {config key="store_country"}} + {loop type="country" name="store_country" id={config key="store_country"}} + {$TITLE} + {/loop} + {/if} +
    +
    + {intl l="Thanks"}
    +{/block} diff --git a/templates/email/default/order_confirmation.txt b/templates/email/default/order_confirmation.txt index ce2b40dac..8139a0557 100644 --- a/templates/email/default/order_confirmation.txt +++ b/templates/email/default/order_confirmation.txt @@ -1,16 +1,19 @@ -{assign var="order_id" value=1} {loop name="order.invoice" type="order" id=$order_id customer="*"} - {loop name="currency.order" type="currency" id=$CURRENCY} - {assign "orderCurrency" $CODE} - {/loop} +{loop name="currency.order" type="currency" id=$CURRENCY} + {assign "orderCurrency" $CODE} +{/loop} +{intl l="Confirmation de la commande %ref du %date" ref={$REF} date={format_date date=$INVOICE_DATE}}\r\n\r\n + +{intl l="Votre adresse de livraison"}\r\n {loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS} {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}\r\n {$ADDRESS1} {$ADDRESS2} {$ADDRESS3}\r\n {$ZIPCODE} {$CITY}\r\n {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}\r\n {/loop} -Confirmation de commande {$REF} du {format_date date=$INVOICE_DATE}\r\n\r\n -Les articles commandés:\r\n + +{intl l="Articles commandés:"}\r\n + {loop type="order_product" name="order-products" order=$ID} {if $WAS_IN_PROMO == 1} {assign "realPrice" $PROMO_PRICE} @@ -22,19 +25,19 @@ Les articles commandés:\r\n {assign "realTaxedPrice" $TAXED_PRICE} {/if} \r\n - Article : {$TITLE} + {intl l="Article : %item" item=$TITLE} {ifloop rel="combinations"} {loop type="order_product_attribute_combination" name="combinations" order_product=$ID} {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}\r\n {/loop} {/ifloop}\r\n - Quantité : {$QUANTITY}\r\n - Prix unitaire TTC : {$realTaxedPrice} {$orderCurrency}\r\n + {intl l="Quantité : %qy" qty=$QUANTITY}\r\n + {intl l="Prix unitaire TTC : %amout %currency" amount=$realTaxedPrice currency=$orderCurrency}\r\n {/loop} \r\n-----------------------------------------\r\n -Montant total TTC : {$TOTAL_TAXED_AMOUNT - $POSTAGE} {$orderCurrency} \r\n -Frais de port TTC : {$POSTAGE} {$orderCurrency} \r\n -Somme totale: {$TOTAL_TAXED_AMOUNT} {$orderCurrency} \r\n +{intl l="Montant total TTC : %amout %currency" amount={$TOTAL_TAXED_AMOUNT - $POSTAGE} currency=$orderCurrency}\r\n +{intl l="Frais de port TTC : %amout %currency" amount={$POSTAGE} currency=$orderCurrency} \r\n +{intl l="Somme totale : %amout %currency" amount={$TOTAL_TAXED_AMOUNT} currency=$orderCurrency} \r\n ==================================\r\n\r\n -Votre facture est disponible dans la rubrique mon compte sur {config key="url_site"} +{intl l="Votre facture est disponible dans la rubrique mon compte sur %url" url={config key="url_site"}} {/loop} \ No newline at end of file diff --git a/templates/email/default/password.html b/templates/email/default/password.html new file mode 100644 index 000000000..88e4c2247 --- /dev/null +++ b/templates/email/default/password.html @@ -0,0 +1,20 @@ +{extends file="email-layout.tpl"} + +{* Open in browser *} +{block name="browser"}{/block} + +{* Subject *} +{block name="email-subject"}{intl l="Your password for %store" store={config key="store_name"}}{/block} + +{* Title *} +{block name="email-title"}{intl l="Password"}{/block} + +{* Content *} +{block name="email-content"} + {intl l="Hi there"},

    + {intl l="You have requested a new password for your account"}.

    + {intl l="Your new password is"} : {$password}

    + {intl l='You can change your password in your user account by opening the "Change my password" link under your personal information'}.

    + {intl l='Kind regards'},
    + - {config key="store_name"} +{/block} diff --git a/templates/frontOffice/default/I18n/cs_CZ.php b/templates/frontOffice/default/I18n/cs_CZ.php new file mode 100644 index 000000000..e7b6b81fc --- /dev/null +++ b/templates/frontOffice/default/I18n/cs_CZ.php @@ -0,0 +1,234 @@ + '%nb položka', + '%nb Items' => '%nb položky', + '+' => '+', + '+ View All' => '+ Zobrazit vše', + '404' => '404', + 'Sorry! We are not able to give you a delivery method for your order.' => 'Promiňеу! Nemáme žádný způsob doručení vaší objednávku.', + 'A problem occured' => 'Nastal problém', + 'A summary of your order email has been sent to the following address' => 'E-mail se souhrnem objednávky byl odeslán na následující adresu', + 'Account' => 'Účet', + 'Add a new address' => 'Přidat novou adresu', + 'Add to cart' => 'Přidat do košíku', + 'Additional Info' => 'Další informace', + 'Address' => 'Adresa', + 'Address %nb' => 'Adresa %nb', + 'Address Update' => 'Aktualizace adresy', + 'All contents' => 'Celý obsah', + 'All contents in' => 'Celý obsah v', + 'All products' => 'Všechna zboží', + 'All products in' => 'Všechna zboží v', + 'Amount' => 'Množství', + 'Availability' => 'Dostupnost', + 'Available' => 'K dispozici', + 'Back' => 'Zpět', + 'Billing address' => 'Fakturační adresa', + 'Billing and delivery' => 'Dodání a platba', + 'Cancel' => 'Zrušit', + 'Cart' => 'Košík', + 'Categories' => 'Kategorie', + 'Change Password' => 'Změnit heslo', + 'Change address' => 'Změnit adresu', + 'Change my account information' => 'Změnit informace o účtu', + 'Change my password' => 'Změnit heslo', + 'Check my order' => 'Zkontrolovat objednávku', + 'Checkout' => 'Objednat', + 'Choose your delivery address' => 'Zvolte vaši dodací adresu', + 'Choose your delivery method' => 'Zvolte způsob doručení', + 'Choose your payment method' => 'Zvolte způsob platby', + 'Code :' => 'Kód:', + 'Connecting to the secure payment server, please wait a few seconds...' => 'Připojení k serveru bezpečného placení, děkuji za vaši trpělivost.', + 'Contact Us' => 'Kontaktujte nás', + 'Continue Shopping' => 'Pokračovat v nákupu', + 'Copyright' => 'Autorská práva', + 'Coupon code' => 'Kód kupónu', + 'Create' => 'Vytvořit', + 'Create New Account' => 'Vytvořit nový účet', + 'Create New Address' => 'Vytvořit novou adresu', + 'Currency' => 'Měna', + 'Currency:' => 'Měna:', + 'Date' => 'Datum', + 'Delivery Information' => 'Informace o dodání', + 'Delivery address' => 'Doručovací adresa', + 'Demo product description' => 'Popis demo výrobku', + 'Demo product title' => 'Název demo výrobku', + 'Description' => 'Popis', + 'Discount' => 'Sleva', + 'Do you have an account?' => 'Máte účet?', + 'Do you really want to delete this address ?' => 'Opravdu chcete odstranit tuto adresu?', + 'Edit' => 'Úpravy', + 'Edit this address' => 'Upravit tuto adresu', + 'Email address' => 'E-mailová adresa', + 'Estimated shipping ' => 'Předpokládaná doba dodání ', + 'Facebook' => 'Facebook', + 'Follow us' => 'Sledujte nás', + 'Follow us introduction' => 'Sledujte nás na', + 'Forgot your Password?' => 'Zapomněli jste heslo?', + 'Free shipping' => 'Doprava zdarma', + 'Go home' => 'Na hlavní', + 'Google+' => 'Google+', + 'Grid' => 'Mřížka', + 'Home' => 'Domů', + 'I\'ve read and agreed on Terms & Conditions' => 'Přečetl jsem a souhlasím z obchodními podmínkami', + 'If nothing happens within 10 seconds, please click here.' => 'Pokud se nic nestane během 10 vteřin, kliknete sem. ', + 'In Stock' => 'Skladem', + 'Instagram' => 'Instagram', + 'Language' => 'Jazyk', + 'Language:' => 'Jazyk:', + 'Latest' => 'Nejnovější', + 'Latest articles' => 'Nejnovější články', + 'Latest products' => 'Nejnovější produkty', + 'List' => 'Seznam', + 'List of orders' => 'Seznam objednávek', + 'Log In!' => 'Přihlásit se!', + 'Log out!' => 'Odhlásit se!', + 'Login' => 'Přihlášení', + 'Login Information' => 'Přihlašovací informace', + 'Main Navigation' => 'Hlavní navigace', + 'Minimum 2 characters.' => 'Minimálně 2 znaky.', + 'Multi-payment platform' => 'Multi-platební platforma', + 'My Account' => 'Můj účet', + 'My Address Books' => 'Moje adresáře', + 'My Address book' => 'Můj adresář', + 'My Orders' => 'Moje objednávky', + 'My order' => 'Moje objednávka', + 'Name' => 'Název', + 'Name ascending' => 'Název vzestupně', + 'Name descending' => 'Název sestupně', + 'Need help ?' => 'Potřebujete pomoc?', + 'Newsletter' => 'Odběr novinek', + 'Newsletter Subscription' => 'Přihlášení k odběru novinek', + 'Next' => 'Další', + 'Next Step' => 'Další krok', + 'Next product' => 'Další produkt', + 'No Content in this folder.' => 'Žádný obsah v této složce.', + 'No articles currently' => 'Nejsou žádné články', + 'No deliveries available for this cart and this country' => 'Žádný způsob dodání pro tuto zemi', + 'No products available in this category' => 'Žádné produkty v této kategorii', + 'No results found' => 'Nebylo nic nalezeno', + 'No.' => 'č.', + 'Offers' => 'Nabídky', + 'Ok' => 'Ok', + 'Order details' => 'Detail objednávky', + 'Order number' => 'Číslo objednávky', + 'Orders over $50' => 'Objednávky nad 50 dolarů', + 'Out of Stock' => 'Není skladem', + 'Pagination' => 'Stránkování', + 'Password' => 'Heslo', + 'Password Forgotten' => 'Zapomenuté heslo', + 'Pay with %module_title' => 'Zaplatit přes %module_title', + 'Personal Information' => 'Osobní údaje', + 'Placeholder address label' => 'Domácí, pracovní, jiná', + 'Placeholder address1' => '76 Ninth Avenue', + 'Placeholder address2' => 'Adresa', + 'Placeholder cellphone' => 'Mobilní telefonní číslo', + 'Placeholder city' => 'New York', + 'Placeholder company' => 'Google', + 'Placeholder contact email' => 'So I can get back to you.', + 'Placeholder contact message' => 'A Vaše zpráva...', + 'Placeholder contact name' => 'Jak se jmenujete?', + 'Placeholder contact subject' => 'Předmět Vaší zprávy.', + 'Placeholder email' => 'johndoe@domain.com', + 'Placeholder firstname' => 'John', + 'Placeholder lastname' => 'Doe', + 'Placeholder phone' => 'Telefonní číslo', + 'Placeholder zipcode' => 'NY 10011', + 'Please enter your email address below.' => 'Zadejte prosím níže vaši e-mailovou adresu.', + 'Please try again to order' => 'Zkuste prosím objednat znovu', + 'Position' => 'Pozice', + 'Previous' => 'Předchozí', + 'Previous product' => 'Předchozí produkt', + 'Price' => 'Cena', + 'Price ascending' => 'Cena vzestupně', + 'Price descending' => 'Cena sestupně', + 'Proceed checkout' => 'Pokračovat', + 'Product Empty Button' => 'Přidejte svůj první produkt', + 'Product Empty Message' => 'Přidání produktu je to opravdu rychlé. +
      +
    1. Zvolte NEW v záložce podrobnosti, pokud chcete vidět váš produkt v sekci nejnovější.
    2. +
    3. Zvolte SALE v záložce podrobnosti, pokud chcete vidět váš produkt v sekci akčních nabídek.
    4. +
    ', + 'Product Empty Title' => 'Vítejte', + 'Product Name' => 'Název produktu', + 'Product Offers' => 'Akční nabídka', + 'Qty' => 'Množství', + 'Quantity' => 'Množství', + 'Questions ? See our F.A.Q.' => 'Potřebujete pomoc? Podívejte se na F.A.Q.', + 'RSS' => 'RSS', + 'Rating' => 'Hodnocení', + 'Redirect to bank service' => 'Přesměrovat na bankovní služby', + 'Ref.' => 'č.', + 'Register' => 'Registrace', + 'Register!' => 'Registrace!', + 'Regular Price:' => 'Běžná cena:', + 'Related' => 'Související', + 'Remove' => 'Odstranit', + 'Remove this address' => 'Odstranit tuto adresu', + 'SELECT YOUR CURRENCY' => 'VYBERTE SVOU MĚNU', + 'SELECT YOUR LANGUAGE' => 'VYBERTE SVŮJ JAZYK', + 'Search' => 'Vyhledávání', + 'Search Result for' => 'Výsledek hledání pro', + 'Search a product' => 'Vyhledat produkt', + 'Search...' => 'Vyhledávání...', + 'Secure Payment' => 'Bezpečné platby', + 'Secure payment' => 'Bezpečné platby', + 'Select Country' => 'Vyberte zemi', + 'Select Title' => 'Vyberte název', + 'Select your country:' => 'Vyberte svou zemi:', + 'Send' => 'Odeslat', + 'Send us a message' => 'Pošlete nám zprávu', + 'Shipping Tax' => 'Cena dopravy', + 'Show' => 'Zobrazit', + 'Sign In' => 'Přihlásit se', + 'Sign up to receive our latest news.' => 'Přihlaste se k odběru novinek.', + 'Skip to content' => 'Přeskočit na obsah', + 'Sorry, your cart is empty. There\'s nothing to pay.' => 'Je nám líto, ale Váš nákupní košík je prázdný. Nemáte za co platit.', + 'Sort By' => 'Seřadit podle', + 'Special Price:' => 'Speciální cena:', + 'Status' => 'Stav', + 'Subscribe' => 'Odebírat', + 'Thank you for the trust you place in us.' => 'Děkujeme Vám za důvěru.', + 'Thanks !' => 'Děkuji!', + 'Thanks for signing up! We\'ll keep you posted whenever we have any new updates.' => 'Díky za přihlášení! Budeme vás informovat o všech novinkách.', + 'Thanks for your message, we will contact as soon as possible.' => 'Díky za zprávu, budeme Vás co nejdříve kontaktovat.', + 'The page cannot be found' => 'Stránka nebyla nalezena', + 'Thelia V2' => 'Thelia V2', + 'Toggle navigation' => 'Přepnout navigace', + 'Total' => 'Celkem', + 'Try again' => 'Zkuste to znovu.', + 'Twitter' => 'Twitter', + 'Unit Price' => 'Jednotková cena', + 'Update' => 'Aktualizovat', + 'Update Profile' => 'Aktualizovat profil', + 'Update Quantity' => 'Aktualizovat množství', + 'Upsell Products' => 'Zboží se slevou', + 'Useful links' => 'Užitečné odkazy', + 'View' => 'Prohlížet', + 'View Cart' => 'Zobrazit košík', + 'View all' => 'Zobrazit vše', + 'View as' => 'Zobrazit jako', + 'View order %ref as pdf document' => 'Zobrazit objednávku %ref jako pdf dokument', + 'View product' => 'Zobrazit produkt', + 'Warning' => 'Upozornění', + 'We\'re sorry, a problem occured and your payment was not successful.' => 'Omlouváme se, došlo k problému a platba nebyla provedená.', + 'You are here:' => 'Nacházíte se tady:', + 'You choose to pay by' => 'Zvolil jste platbu', + 'You don\'t have orders yet.' => 'Ještě nemáte objednávky.', + 'You have no items in your shopping cart.' => 'Nákupní košík je prázdný.', + 'You may have a coupon ?' => 'Máte kupón?', + 'You want to subscribe to the newsletter? Please enter your email address below.' => 'Chcete se přihlásit k odběru novinek? Zadejte prosím níže Vaši e-mailovou adresu.', + 'You will receive a link to reset your password.' => 'Obdržíte odkaz pro obnovení hesla.', + 'Your Cart' => 'Váš košík', + 'Your email address' => 'Vaše e-mailová adresa', + 'Your order will be confirmed by us upon receipt of your payment.' => 'Vaše objednávka bude potvrzena po obdržení platby.', + 'Youtube' => 'Youtube', + 'deliveries' => 'doručení', + 'for' => 'pro', + 'instead of' => 'namísto', + 'missing or invalid data' => 'chybějící nebo neplatné údaje', + 'per page' => 'na stránce', + 'update' => 'aktualizovat', + 'with:' => 's:', +); diff --git a/templates/frontOffice/default/I18n/en_US.php b/templates/frontOffice/default/I18n/en_US.php index c4ad5753a..2fb0bce19 100755 --- a/templates/frontOffice/default/I18n/en_US.php +++ b/templates/frontOffice/default/I18n/en_US.php @@ -7,6 +7,7 @@ return array( '+ View All' => '+ View All', '404' => '404', 'Sorry! We are not able to give you a delivery method for your order.' => 'Sorry! We are not able to give you a delivery method for your order.', + 'A problem occured' => 'A problem occured', 'A summary of your order email has been sent to the following address' => 'A summary of your order email has been sent to the following address', 'Account' => 'Account', 'Add a new address' => 'Add a new address', @@ -15,7 +16,10 @@ return array( 'Address' => 'Address', 'Address %nb' => 'Address %nb', 'Address Update' => 'Address update', - 'All rights reserved.' => 'All rights reserved.', + 'All contents' => 'All contents', + 'All contents in' => 'All contents in', + 'All products' => 'All products', + 'All products in' => 'All products in', 'Amount' => 'Amount', 'Availability' => 'Availability', 'Available' => 'Available', @@ -35,6 +39,7 @@ return array( 'Choose your delivery method' => 'Choose your delivery method', 'Choose your payment method' => 'Choose your payment method', 'Code :' => 'Code :', + 'Connecting to the secure payment server, please wait a few seconds...' => 'Connection au serveur depaiement sécurisé, merci de patienter.', 'Contact Us' => 'Contact Us', 'Continue Shopping' => 'Continue Shopping', 'Copyright' => 'Copyright', @@ -56,7 +61,7 @@ return array( 'Edit' => 'Edit', 'Edit this address' => 'Edit this address', 'Email address' => 'Email address', - 'Email not displaying correctly?' => 'Email not displaying correctly?', + 'Estimated shipping ' => 'Estimated shipping ', 'Facebook' => 'Facebook', 'Follow us' => 'Follow us', 'Follow us introduction' => 'Follow us introduction', @@ -67,6 +72,7 @@ return array( 'Grid' => 'Grid', 'Home' => 'Home', 'I\'ve read and agreed on Terms & Conditions' => 'I\'ve read and agreed on Terms & Conditions', + 'If nothing happens within 10 seconds, please click here.' => 'Si rien ne se passe dans les 10 prochaines secondes, merci de cliquer ici. ', 'In Stock' => 'In Stock', 'Instagram' => 'Instagram', 'Language' => 'Language', @@ -99,6 +105,7 @@ return array( 'Next product' => 'Next product', 'No Content in this folder.' => 'No Content in this folder.', 'No articles currently' => 'No articles currently', + 'No deliveries available for this cart and this country' => 'No deliveries available for this cart and this country', 'No products available in this category' => 'No products available in this category', 'No results found' => 'No results found', 'No.' => 'No.', @@ -107,11 +114,11 @@ return array( 'Order details' => 'Order details', 'Order number' => 'Order number', 'Orders over $50' => 'Orders over $50', - 'Our mailing address is:' => 'Our mailing address is:', 'Out of Stock' => 'Out of stock', 'Pagination' => 'Pagination', 'Password' => 'Password', 'Password Forgotten' => 'Password Forgotten', + 'Pay with %module_title' => 'Payer avec %module_title', 'Personal Information' => 'Personal Information', 'Placeholder address label' => 'Home, Work office, other', 'Placeholder address1' => '76 Ninth Avenue', @@ -129,6 +136,7 @@ return array( 'Placeholder phone' => 'Phone number', 'Placeholder zipcode' => 'NY 10011', 'Please enter your email address below.' => 'Please enter your email address below.', + 'Please try again to order' => 'Please try again to order', 'Position' => 'Position', 'Previous' => 'Previous', 'Previous product' => 'Previous product', @@ -150,6 +158,7 @@ return array( 'Questions ? See our F.A.Q.' => 'Questions ? See our F.A.Q.', 'RSS' => 'RSS', 'Rating' => 'Rating', + 'Redirect to bank service' => 'Redirect to bank service', 'Ref.' => 'Ref.', 'Register' => 'Register', 'Register!' => 'Register!', @@ -167,6 +176,7 @@ return array( 'Secure payment' => 'Secure payment', 'Select Country' => 'Select Country', 'Select Title' => 'Select Title', + 'Select your country:' => 'Select your country:', 'Send' => 'Send', 'Send us a message' => 'Send us a message', 'Shipping Tax' => 'Shipping Tax', @@ -174,6 +184,7 @@ return array( 'Sign In' => 'Sign In', 'Sign up to receive our latest news.' => 'Sign up to receive our latest news.', 'Skip to content' => 'Skip to content', + 'Sorry, your cart is empty. There\'s nothing to pay.' => 'Désolé, mais votre panier est vide. Il n\'y a rien à payer.', 'Sort By' => 'Sort By', 'Special Price:' => 'Special Price:', 'Status' => 'Status', @@ -186,6 +197,7 @@ return array( 'Thelia V2' => 'Thelia V2', 'Toggle navigation' => 'Toggle navigation', 'Total' => 'Total', + 'Try again' => 'Merci de ré-essayer.', 'Twitter' => 'Twitter', 'Unit Price' => 'Unit Price', 'Update' => 'Update', @@ -197,11 +209,10 @@ return array( 'View Cart' => 'View Cart', 'View all' => 'View all', 'View as' => 'View as', - 'View it in your browser' => 'View it in your browser', 'View order %ref as pdf document' => 'View order %ref as pdf document', 'View product' => 'View product', 'Warning' => 'Warning', - 'Welcome to Thelia. This is a demo site built with Thelia V2 an E-Commerce solution based on Symfony 2.' => 'Welcome to Thelia. This is a demo site built with Thelia V2 an E-Commerce solution based on Symfony 2.', + 'We\'re sorry, a problem occured and your payment was not successful.' => 'We\'re sorry, a problem occured and your payment was not successful.', 'You are here:' => 'You are here:', 'You choose to pay by' => 'You choose to pay by', 'You don\'t have orders yet.' => 'You don\'t have orders yet.', @@ -213,7 +224,11 @@ return array( 'Your email address' => 'Your email address', 'Your order will be confirmed by us upon receipt of your payment.' => 'Your order will be confirmed by us upon receipt of your payment.', 'Youtube' => 'Youtube', + 'deliveries' => 'deliveries', + 'for' => 'for', 'instead of' => 'instead of', 'missing or invalid data' => 'missing or invalid data', 'per page' => 'per page', + 'update' => 'update', + 'with:' => 'with:', ); diff --git a/templates/frontOffice/default/I18n/fr_FR.php b/templates/frontOffice/default/I18n/fr_FR.php index d5f65a7f0..2a8a52dda 100755 --- a/templates/frontOffice/default/I18n/fr_FR.php +++ b/templates/frontOffice/default/I18n/fr_FR.php @@ -7,7 +7,8 @@ return array( '+ View All' => '+ Voir tout', '404' => '404', 'Sorry! We are not able to give you a delivery method for your order.' => 'Désolé !Nous ne pouvons pas trouver de mode de livraison pour votre commande.', - 'A summary of your order email has been sent to the following address' => 'Un récapitulatif de commande vows a été envoyé par e-mail à l\'adresse suivante : ', + 'A problem occured' => 'Un problème est survenu', + 'A summary of your order email has been sent to the following address' => 'Un récapitulatif de commande vous a été envoyé par e-mail à l\'adresse suivante : ', 'Account' => 'Mon compte', 'Add a new address' => 'Ajouter une nouvelle adresse', 'Add to cart' => 'Ajouter au panier', @@ -15,7 +16,10 @@ return array( 'Address' => 'Adresse', 'Address %nb' => 'Adresse n°', 'Address Update' => 'Mise à jour de l\'adresse', - 'All rights reserved.' => 'Tout droit réservé.', + 'All contents' => 'Tous les contenus', + 'All contents in' => 'tous les contenus de', + 'All products' => 'Tous les produits', + 'All products in' => 'Tous les produits de', 'Amount' => 'Montant', 'Availability' => 'Disponibilité', 'Available' => 'Disponible', @@ -29,12 +33,13 @@ return array( 'Change address' => 'Changer d\'adresse', 'Change my account information' => 'Modifier mes informations personnelles', 'Change my password' => 'Changer mon mot de passe', - 'Check my order' => 'Vérifier ma commmande', + 'Check my order' => 'Vérifier ma commande', 'Checkout' => 'Commande', 'Choose your delivery address' => 'Choisissez une adresse de livraison', 'Choose your delivery method' => 'Choisissez votre moyen de livraison', 'Choose your payment method' => 'Choisissez voter moyen de paiement', 'Code :' => 'Code : ', + 'Connecting to the secure payment server, please wait a few seconds...' => 'Connexion au serveur sécurisé, merci de patienter quelques secondes.', 'Contact Us' => 'Contactez-nous', 'Continue Shopping' => 'Continuer mes achats', 'Copyright' => 'Copyright', @@ -56,7 +61,7 @@ return array( 'Edit' => 'Editer', 'Edit this address' => 'Editer cette adresse', 'Email address' => 'Adresse e-mail', - 'Email not displaying correctly?' => 'Cet e-mail ne s\'affiche pas correctement ?', + 'Estimated shipping ' => 'Estimation des frais de port', 'Facebook' => 'Facebook', 'Follow us' => 'Suivez-nous', 'Follow us introduction' => 'Abonnez vous à nos pages', @@ -67,6 +72,7 @@ return array( 'Grid' => 'Grille', 'Home' => 'Accueil', 'I\'ve read and agreed on Terms & Conditions' => 'J\'ai lu et j\'accepte les CGV', + 'If nothing happens within 10 seconds, please click here.' => 'Si rien ne se passe dans les 10 secondes, meri de cliquer ici. ', 'In Stock' => 'Disponible', 'Instagram' => 'Instagram', 'Language' => 'Langue', @@ -99,6 +105,7 @@ return array( 'Next product' => 'Produit suivant.', 'No Content in this folder.' => 'Aucun contenu dans ce dossier.', 'No articles currently' => 'Aucun article en ce moment', + 'No deliveries available for this cart and this country' => 'Aucun mode de livraison disponible pour ce panier et ce pays', 'No products available in this category' => 'Aucun produit dans cette catégorie.', 'No results found' => 'Aucun résultat', 'No.' => 'N°', @@ -107,11 +114,11 @@ return array( 'Order details' => 'Détail de commande', 'Order number' => 'Commande numéro', 'Orders over $50' => 'Commande supérieure à 50€', - 'Our mailing address is:' => 'Notre adresse mail est :', 'Out of Stock' => 'Hors stock', 'Pagination' => 'Pagination', 'Password' => 'Mot de passe', 'Password Forgotten' => 'Mot de passe oublié', + 'Pay with %module_title' => 'Payer avec %module_title ', 'Personal Information' => 'Informations personnelles', 'Placeholder address label' => 'Maison, Domicile, Travail...', 'Placeholder address1' => 'Adresse', @@ -129,6 +136,7 @@ return array( 'Placeholder phone' => 'Téléphone', 'Placeholder zipcode' => 'Code postal', 'Please enter your email address below.' => 'Veuillez saisir votre adresse e-mail ci-dessous.', + 'Please try again to order' => 'Merci de réessayer', 'Position' => 'Position', 'Previous' => 'Précédent', 'Previous product' => 'Produit précédent.', @@ -142,9 +150,11 @@ return array( 'Product Name' => 'Nom du produit', 'Product Offers' => 'Offre spéciale', 'Qty' => 'Qté', + 'Quantity' => 'Quantité', 'Questions ? See our F.A.Q.' => 'Questions ? Voir notre FAQ', 'RSS' => 'RSS', 'Rating' => 'Avis', + 'Redirect to bank service' => 'Redirection vers le service bancaire', 'Ref.' => 'Ref.', 'Register' => 'S\'inscrire', 'Register!' => 'Enregistrez-vous !', @@ -162,6 +172,7 @@ return array( 'Secure payment' => 'Paiement sécurisé', 'Select Country' => 'Choisissez un pays', 'Select Title' => 'Civilité', + 'Select your country:' => 'Sélectionnez votre pays :', 'Send' => 'Envoyer', 'Send us a message' => 'Envoyez nous un message.', 'Shipping Tax' => 'Frais de livraison', @@ -169,6 +180,7 @@ return array( 'Sign In' => 'Se connecter', 'Sign up to receive our latest news.' => 'Inscrivez-vous pour recevoir les dernières nouveautés.', 'Skip to content' => 'Aller au contenu', + 'Sorry, your cart is empty. There\'s nothing to pay.' => 'Désolé, votre panier est vide. Il n\'y a rien à payer.', 'Sort By' => 'Trier par', 'Special Price:' => 'Prix promo', 'Status' => 'Etat', @@ -181,6 +193,7 @@ return array( 'Thelia V2' => 'Thelia v2', 'Toggle navigation' => 'Basculer la navigation', 'Total' => 'Total', + 'Try again' => 'Ré-essayer le paiement', 'Twitter' => 'Twitter', 'Unit Price' => 'Prix unitaire', 'Update' => 'Mettre à jour', @@ -192,11 +205,10 @@ return array( 'View Cart' => 'Voir le panier', 'View all' => ' Voir tout', 'View as' => 'Voir en tant que', - 'View it in your browser' => 'Visualiser-le dans votre navigateur.', 'View order %ref as pdf document' => 'Ouvrir la commande %ref dans un pdf', 'View product' => 'Voir le produit', 'Warning' => 'Attention', - 'Welcome to Thelia. This is a demo site built with Thelia V2 an E-Commerce solution based on Symfony 2.' => 'Bienvenue sur ce site Thelia. ce site est un site de démonstration motorisé par la solution e-commerce libre Thelia v2 basée sur Symfony 2.', + 'We\'re sorry, a problem occured and your payment was not successful.' => 'Nous sommes désolés, un problème est survenu lors du paiement.', 'You are here:' => 'Vous êtes ici :', 'You choose to pay by' => 'Vous avez choisi de payer par', 'You don\'t have orders yet.' => 'Vous n\'avez pas encore de commande.', @@ -208,7 +220,11 @@ return array( 'Your email address' => 'Votre adresse e-mail', 'Your order will be confirmed by us upon receipt of your payment.' => 'Votre commande sera confirmée à réception de votre paiement.', 'Youtube' => 'Youtube', + 'deliveries' => 'Livraisons', + 'for' => 'pour', 'instead of' => 'au lieu de', 'missing or invalid data' => 'Information érronée ou incomplète', 'per page' => 'par page', + 'update' => 'mettre à jour', + 'with:' => 'avec :', ); diff --git a/templates/frontOffice/default/I18n/it_IT.php b/templates/frontOffice/default/I18n/it_IT.php index 410d328b4..2e44be683 100755 --- a/templates/frontOffice/default/I18n/it_IT.php +++ b/templates/frontOffice/default/I18n/it_IT.php @@ -1,201 +1,217 @@ '', - '%nb Items' => '', - '+ View All' => '', - '404' => '', - 'A summary of your order email has been sent to the following address' => '', - 'Account' => '', - 'Add a new address' => '', - 'Add to cart' => '', - 'Additional Info' => '', - 'Address %nb' => '', - 'Address Update' => '', - 'Address' => '', - 'Amount' => '', - 'Availability' => '', - 'Available' => '', - 'Back' => '', - 'Billing address' => '', - 'Billing and delivery' => '', - 'Cancel' => '', - 'Cart' => '', - 'Categories' => '', - 'Change address' => '', - 'Change my account information' => '', - 'Change my password' => '', - 'Change Password' => '', - 'Check my order' => '', - 'Checkout' => '', - 'Choose your delivery address' => '', - 'Choose your delivery method' => '', - 'Choose your payment method' => '', - 'Code :' => '', - 'Complementary address' => '', - 'Contact Us' => '', - 'Continue Shopping' => '', - 'Copyright' => '', - 'Coupon code' => '', - 'Create New Account' => '', - 'Create New Address' => '', - 'Create' => '', - 'Currency:' => '', - 'Date' => '', - 'Delete address' => '', - 'Delivery address' => '', - 'Delivery Information' => '', - 'Demo product description' => '', - 'Demo product title' => '', - 'Description' => '', - 'Do you have an account?' => '', - 'Do you really want to delete this address ?' => '', - 'Edit this address' => '', - 'Edit' => '', - 'Email address' => '', - 'Follow us' => '', - 'Forgot your Password?' => '', - 'Free shipping' => '', - 'Go home' => '', - 'Grid' => '', - 'Home address' => '', - 'Home' => '', - 'In Stock' => '', - 'instead of' => '', - 'Item(s)' => '', - 'Language:' => '', - 'Latest articles' => '', - 'Latest products' => '', - 'Latest' => '', - 'List of orders' => '', - 'List' => '', - 'Log In!' => '', - 'Log out!' => '', - 'Login Information' => '', - 'Login' => '', - 'Main Navigation' => '', - 'Minimum 2 characters.' => '', - 'missing or invalid data' => '', - 'Multi-payment platform' => '', - 'My Account' => '', - 'My Address book' => '', - 'My Address Books' => '', - 'My order' => '', - 'My Orders' => '', - 'Name ascending' => '', - 'Name descending' => '', - 'Name' => '', - 'Need help ?' => '', - 'Newsletter Subscription' => '', - 'Newsletter' => '', - 'Next product' => '', - 'Next Step' => '', - 'Next' => '', - 'No articles currently' => '', - 'No products available in this category' => '', - 'No results found' => '', - 'No.' => '', - 'Offers' => '', - 'Ok' => '', - 'Order details' => '', - 'Order number' => '', - 'Orders over $50' => '', - 'Out of Stock' => '', - 'Pagination' => '', - 'Password Forgotten' => '', - 'Password' => '', - 'per page' => '', - 'Personal Information' => '', - 'Placeholder address label' => '', - 'Placeholder address1' => '', - 'Placeholder address2' => '', - 'Placeholder cellphone' => '', - 'Placeholder city' => '', - 'Placeholder company' => '', - 'Placeholder contact email' => '', - 'Placeholder contact message' => '', - 'Placeholder contact name' => '', - 'Placeholder contact subject' => '', - 'Placeholder email' => '', - 'Placeholder firstname' => '', - 'Placeholder lastname' => '', - 'Placeholder phone' => '', - 'Placeholder zipcode' => '', - 'Please enter your email address below.' => '', - 'Position' => '', - 'Previous product' => '', - 'Previous' => '', - 'Price ascending' => '', - 'Price descending' => '', - 'Price' => '', - 'Proceed checkout' => '', - 'Product Empty Button' => '', - 'Product Empty Message' => '', - 'Product Empty Title' => '', - 'Product Name' => '', - 'Product Offers' => '', - 'products' => '', - 'Qty' => '', - 'Quantity' => '', - 'Questions ? See or F.A.Q.' => '', - 'Rating' => '', - 'Ref.' => '', - 'Register!' => '', - 'Register' => '', - 'Regular Price:' => '', - 'Related' => '', - 'Remove this address' => '', - 'Remove' => '', - 'Search a product' => '', - 'Search Result for' => '', - 'Search' => '', - 'Search...' => '', - 'Secure payment' => '', - 'Secure Payment' => '', - 'Select Country' => '', - 'Select Title' => '', - 'Send us a message' => '', - 'Send' => '', - 'Shipping Tax' => '', - 'Show' => '', - 'Sign In' => '', - 'Sign up to receive our latest news.' => '', - 'Skip to content' => '', - 'Sort By' => '', - 'Special Price:' => '', - 'Status' => '', - 'Subscribe' => '', - 'Tax Inclusive' => '', - 'Thank you for the trust you place in us.' => '', - 'Thanks !' => '', - 'Thanks for signing up! We\'ll keep you posted whenever we have any new updates.' => '', - 'Thanks for your message, we will contact as soon as possible.' => '', - 'The page cannot be found' => '', - 'Thelia V2' => '', - 'Toggle navigation' => '', - 'Total' => '', - 'TTC' => '', - 'Unit Price' => '', - 'Update Profile' => '', - 'Update' => '', - 'Upsell Products' => '', - 'Useful links' => '', - 'View all' => '', - 'View as' => '', - 'View Cart' => '', - 'View order %ref as pdf document' => '', - 'View product' => '', - 'View' => '', - 'Warning' => '', - 'Yes' => '', - 'You are here:' => '', - 'You choose to pay by' => '', - 'You don\'t have orders yet.' => '', - 'You have no items in your shopping cart.' => '', - 'You may have a coupon ?' => '', - 'You want to subscribe to the newsletter? Please enter your email address below.' => '', - 'You will receive a link to reset your password.' => '', - 'Your Cart' => '', - 'Your email address' => '', - 'Your order will be confirmed by us upon receipt of your payment.' => '', -); \ No newline at end of file + '%nb Item' => '%nb elemento', + '%nb Items' => '%nb elementi', + '+' => '+', + '+ View All' => '+ Visualizza tutti', + '404' => '404', + 'Sorry! We are not able to give you a delivery method for your order.' => 'Siamo dispiacenti! Non siamo in grado di darvi un metodo di consegna per il vostro ordine.', + 'A summary of your order email has been sent to the following address' => 'Un riassunto del tuo ordine è stato inviato a quest\'indirizzo', + 'Account' => 'Conto', + 'Add a new address' => 'Aggiungere un nuovo indirizzo', + 'Add to cart' => 'Aggiungi al carrello', + 'Additional Info' => 'Ulteriori Informazione', + 'Address' => 'Indirizzo', + 'Address %nb' => 'Indirizzo %nb', + 'Address Update' => 'Aggiornamento dell\' indirizzo', + 'All rights reserved.' => 'Tutti i diritti riservati.', + 'Amount' => 'Importo', + 'Availability' => 'Disponibilità', + 'Available' => 'Disponibile', + 'Back' => 'Indietro', + 'Billing address' => 'Indirizzo di fatturazione', + 'Billing and delivery' => 'Fatturazione e consegna', + 'Cancel' => 'Annulla', + 'Cart' => 'Carrello', + 'Categories' => 'Categorie', + 'Change Password' => 'Cambia Password', + 'Change address' => 'Cambia indirizzo', + 'Change my account information' => 'Modificare le mie informazioni', + 'Change my password' => 'Cambiare la mia password', + 'Check my order' => 'Controllare il mio ordine', + 'Checkout' => 'Procedi all\'acquisto', + 'Choose your delivery address' => 'Scegli il tuo indirizzo di consegna', + 'Choose your delivery method' => 'Scegli il tuo metodo di consegna', + 'Choose your payment method' => 'Scegli il tuo metodo di pagamento', + 'Code :' => 'Codice :', + 'Contact Us' => 'Contattaci', + 'Continue Shopping' => 'Continua lo shopping', + 'Copyright' => 'Copyright', + 'Coupon code' => 'Codice promozionale', + 'Create' => 'Creare', + 'Create New Account' => 'Creare un nuovo account', + 'Create New Address' => 'Creare un nuovo indirizzo', + 'Currency' => 'Valuta', + 'Currency:' => 'Valuta:', + 'Date' => 'Data', + 'Delivery Information' => 'Informazioni sulla consegna', + 'Delivery address' => 'Indirizzo di consegna', + 'Demo product description' => 'Descrizione del prodotto di dimostrazione', + 'Demo product title' => 'Titolo del prodotto di dimostrazione', + 'Description' => 'Descrizione', + 'Discount' => 'Sconto', + 'Do you have an account?' => 'Hai un account?', + 'Do you really want to delete this address ?' => 'Vuoi davvero cancellare questo indirizzo?', + 'Edit' => 'Modifica', + 'Edit this address' => 'Modificare questo indirizzo', + 'Email address' => 'Indirizzo email', + 'Email not displaying correctly?' => 'Email non visualizzato correttamente?', + 'Facebook' => 'Facebook', + 'Follow us' => 'Seguici', + 'Follow us introduction' => 'Seguici introduzione', + 'Forgot your Password?' => 'Hai dimenticato la password?', + 'Free shipping' => 'Spedizione gratuita', + 'Go home' => 'Go home', + 'Google+' => 'Google +', + 'Grid' => 'Griglia', + 'Home' => 'Home', + 'I\'ve read and agreed on Terms & Conditions' => 'Ho letto e accettato su termini e condizioni', + 'In Stock' => 'Disponibile', + 'Instagram' => 'Instagram', + 'Language' => 'Lingua', + 'Language:' => 'Lingua:', + 'Latest' => 'Ultime', + 'Latest articles' => 'Ultimi prodotti', + 'Latest products' => 'Prodotti più recenti', + 'List' => 'Lista', + 'List of orders' => 'Lista degli ordini', + 'Log In!' => 'Accedi!', + 'Log out!' => 'Sconnessione!', + 'Login' => 'Login', + 'Login Information' => 'Informazioni di login', + 'Main Navigation' => 'Navigazione principale', + 'Minimum 2 characters.' => 'Minimo 2 caratteri.', + 'Multi-payment platform' => 'Piattaforma multi-pagamento', + 'My Account' => 'Mio account', + 'My Address Books' => 'Miei indirizzi', + 'My Address book' => 'Mia rubrica', + 'My Orders' => 'Miei ordini', + 'My order' => 'Il mio ordine', + 'Name' => 'Nome', + 'Name ascending' => 'Nome ascendente', + 'Name descending' => 'Nome decrescente', + 'Need help ?' => 'Hai bisogno di aiuto ?', + 'Newsletter' => 'Newsletter', + 'Newsletter Subscription' => 'Iscrizione alla newsletter', + 'Next' => 'Prossimo', + 'Next Step' => 'Passo successivo', + 'Next product' => 'Prodotto successivo', + 'No Content in this folder.' => 'Nessun contenuto in questa cartella.', + 'No articles currently' => 'Non ci sono articoli attualmente', + 'No products available in this category' => 'Nessun prodotti disponibili in questa categoria', + 'No results found' => 'Nessun risultato trovato', + 'No.' => 'No.', + 'Offers' => 'Offerte', + 'Ok' => 'Ok', + 'Order details' => 'Dettagli dell\'ordine', + 'Order number' => 'Numero d\'ordine', + 'Orders over $50' => 'Ordini superiori a $50', + 'Our mailing address is:' => 'Il nostro indirizzo postale è:', + 'Out of Stock' => 'Esaurito', + 'Pagination' => 'Paginazione', + 'Password' => 'Password', + 'Password Forgotten' => 'Password dimenticata', + 'Personal Information' => 'Dati personali', + 'Placeholder address label' => 'Casa, ufficio, altro', + 'Placeholder address1' => '76 viale Italia', + 'Placeholder address2' => 'Indirizzo', + 'Placeholder cellphone' => 'Numero di telefono cellulare', + 'Placeholder city' => 'Roma', + 'Placeholder company' => 'Google', + 'Placeholder contact email' => 'Così posso tornare da voi.', + 'Placeholder contact message' => 'E il tuo messaggio...', + 'Placeholder contact name' => 'Come ti chiami?', + 'Placeholder contact subject' => 'Il soggetto del tuo messaggio.', + 'Placeholder email' => 'johndoe@domain.it', + 'Placeholder firstname' => 'Mario', + 'Placeholder lastname' => 'Doe', + 'Placeholder phone' => 'Numero di telefono', + 'Placeholder zipcode' => 'PG 10011', + 'Please enter your email address below.' => 'Inserisci il tuo indirizzo email qui sotto.', + 'Position' => 'Posizione', + 'Previous' => 'Indietro', + 'Previous product' => 'Prodotto precedente', + 'Price' => 'Prezzo', + 'Price ascending' => 'Prezzo crescente', + 'Price descending' => 'Prezzo decrescente', + 'Proceed checkout' => 'Procedere all\'acquisto', + 'Product Empty Button' => 'Aggiungere il mio primo prodotto', + 'Product Empty Message' => 'È davvero veloce per aggiungere un prodotto. +
      +
    1. Check NEW sotto la scheda dei dettagli, se vuoi vedere il tuo prodotto nella sezione prodotti più recente.
    2. Check in vendita sotto la scheda dei dettagli, se vuoi vedere il tuo prodotto nella sezione prodotti in offerta.
    ', + 'Product Empty Title' => 'Benvenuto', + 'Product Name' => 'Nome del prodotto', + 'Product Offers' => 'Offerte', + 'Qty' => 'Qtà', + 'Quantity' => 'Quantità', + 'Questions ? See our F.A.Q.' => 'Domande ? Vedere le nostre F.A.Q.', + 'RSS' => 'RSS', + 'Rating' => 'Valutazione', + 'Ref.' => 'Rif.', + 'Register' => 'Registrati', + 'Register!' => 'Registrati!', + 'Regular Price:' => 'Prezzo:', + 'Related' => 'Correlato', + 'Remove' => 'Rimuovi', + 'Remove this address' => 'Rimuovere questo indirizzo', + 'SELECT YOUR CURRENCY' => 'SELEZIONA LA TUA VALUTA', + 'SELECT YOUR LANGUAGE' => 'SELEZIONA LA LINGUA', + 'Search' => 'Ricerca', + 'Search Result for' => 'Risultati della ricerca per', + 'Search a product' => 'Ricerca un prodotto', + 'Search...' => 'Ricerca...', + 'Secure Payment' => 'Pagamento sicuro', + 'Secure payment' => 'Pagamento sicuro', + 'Select Country' => 'Selezionare il paese', + 'Select Title' => 'Selezionare il titolo', + 'Send' => 'Invia', + 'Send us a message' => 'Inviaci un messaggio', + 'Shipping Tax' => 'Tassa di spedizione', + 'Show' => 'Visualizza', + 'Sign In' => 'Accedi', + 'Sign up to receive our latest news.' => 'Iscriviti per ricevere le nostre ultime novità.', + 'Skip to content' => 'Vai al contenuto', + 'Sort By' => 'Ordina per', + 'Special Price:' => 'Prezzo speciale:', + 'Status' => 'Stato', + 'Subscribe' => 'Abbonati', + 'Thank you for the trust you place in us.' => 'Grazie per la tua fiducia.', + 'Thanks !' => 'Grazie !', + 'Thanks for signing up! We\'ll keep you posted whenever we have any new updates.' => 'Grazie per l\'inscrizione! Ti terremo aggiornato ogni volta che abbiamo eventuali nuovi aggiornamenti.', + 'Thanks for your message, we will contact as soon as possible.' => 'Grazie per il tuo messaggio, ti contatteremo appena possibile.', + 'The page cannot be found' => 'Impossibile trovare la pagina', + 'Thelia V2' => 'Thelia V2', + 'Toggle navigation' => 'Toggle navigation', + 'Total' => 'Totale', + 'Twitter' => 'Twitter', + 'Unit Price' => 'Prezzo unitario', + 'Update' => 'Aggiornamento', + 'Update Profile' => 'Aggiorna il profilo', + 'Update Quantity' => 'Aggiorna la quantità', + 'Upsell Products' => 'Prodotti di upsell', + 'Useful links' => 'Link utili', + 'View' => 'Vedere', + 'View Cart' => 'Visualizza il carrello', + 'View all' => 'Mostra tutto', + 'View as' => 'Mostra come', + 'View it in your browser' => 'Visualizzalo nel tuo browser', + 'View order %ref as pdf document' => 'Visualizza l\'ordine %ref come un documento pdf', + 'View product' => 'Visualizza il prodotto', + 'Warning' => 'Attenzione', + 'Welcome to Thelia. This is a demo site built with Thelia V2 an E-Commerce solution based on Symfony 2.' => 'Benvenuti su Thelia. Questo è un sito dimostrativo costruito con Thelia V2 una soluzione di commercio eletronico basata su Symfony 2.', + 'You are here:' => 'Tu sei qui:', + 'You choose to pay by' => 'Hai scelto di pagare tramite', + 'You don\'t have orders yet.' => 'Non hai ancora ordini.', + 'You have no items in your shopping cart.' => 'Non hai nessun prodotto nel tuo carrello.', + 'You may have a coupon ?' => 'Hai un codice promozionale ?', + 'You want to subscribe to the newsletter? Please enter your email address below.' => 'Vuoi iscriverti alla newsletter? Inserisci il tuo indirizzo email qui sotto.', + 'You will receive a link to reset your password.' => 'Riceverai un link per reimpostare la password.', + 'Your Cart' => 'Tuo carrello', + 'Your email address' => 'Tuo indirizzo email', + 'Your order will be confirmed by us upon receipt of your payment.' => 'Il tuo ordine sarà confermato da noi al ricevimento del tuo pagamento.', + 'Youtube' => 'Youtube', + 'instead of' => 'Invece di', + 'missing or invalid data' => 'dati mancanti o non validi', + 'per page' => 'per ogni pagina', +); diff --git a/templates/frontOffice/default/I18n/ru_RU.php b/templates/frontOffice/default/I18n/ru_RU.php new file mode 100644 index 000000000..f839d9fa3 --- /dev/null +++ b/templates/frontOffice/default/I18n/ru_RU.php @@ -0,0 +1,234 @@ + '%nb', + '%nb Items' => '%nb', + '+' => '+', + '+ View All' => '+ Просмотреть все', + '404' => '404', + 'Sorry! We are not able to give you a delivery method for your order.' => 'Сожалеем! Мы не можем Вам предложить способы доставки для вашего заказа.', + 'A problem occured' => 'Возникла проблема', + 'A summary of your order email has been sent to the following address' => 'Информация о заказе была отправлен на следующий адрес', + 'Account' => 'Учетная запись', + 'Add a new address' => 'Добавить новый адрес', + 'Add to cart' => 'Добавить в корзину', + 'Additional Info' => 'Дополнительная информация', + 'Address' => 'Адрес', + 'Address %nb' => 'Адрес %nb', + 'Address Update' => 'Обновить адрес', + 'All contents' => 'Все содержимое', + 'All contents in' => 'Все содержимое в', + 'All products' => 'Все товары', + 'All products in' => 'Все товары в', + 'Amount' => 'Количество', + 'Availability' => 'Наличие', + 'Available' => 'Доступно', + 'Back' => 'Назад', + 'Billing address' => 'Адрес плательщика', + 'Billing and delivery' => 'Оплата и доставка', + 'Cancel' => 'Отмена', + 'Cart' => 'Корзина', + 'Categories' => 'Категории', + 'Change Password' => 'Сменить пароль', + 'Change address' => 'Изменить адрес', + 'Change my account information' => 'Изменить персональные данные', + 'Change my password' => 'Сменить пароль', + 'Check my order' => 'Проверить мой заказ', + 'Checkout' => 'Оформление заказа', + 'Choose your delivery address' => 'Выберите адрес доставки', + 'Choose your delivery method' => 'Выберите способ доставки', + 'Choose your payment method' => 'Выберите способ оплаты', + 'Code :' => 'Код:', + 'Connecting to the secure payment server, please wait a few seconds...' => 'Подключение к безопасному платежному серверу, благодарим за ваше терпение.', + 'Contact Us' => 'Связаться с нами', + 'Continue Shopping' => 'Продолжить покупки', + 'Copyright' => 'Авторское право', + 'Coupon code' => 'Код купона', + 'Create' => 'Создать', + 'Create New Account' => 'Создать новую учетную запись', + 'Create New Address' => 'Создать новый адрес', + 'Currency' => 'Валюта', + 'Currency:' => 'Валюта:', + 'Date' => 'Дата', + 'Delivery Information' => 'Информация о доставке', + 'Delivery address' => 'Адрес доставки', + 'Demo product description' => 'Описание демо продукта', + 'Demo product title' => 'Название демо продукта', + 'Description' => 'Описание', + 'Discount' => 'Скидка', + 'Do you have an account?' => 'Есть ли у вас учетная запись?', + 'Do you really want to delete this address ?' => 'Вы действительно хотите удалить этот адрес?', + 'Edit' => 'Редактировать', + 'Edit this address' => 'Изменить этот адрес', + 'Email address' => 'Адрес электронной почты', + 'Estimated shipping ' => 'Расчетное время доставки ', + 'Facebook' => 'Facebook', + 'Follow us' => 'Следите за нами', + 'Follow us introduction' => 'Следите за нами на', + 'Forgot your Password?' => 'Забыли пароль?', + 'Free shipping' => 'Бесплатная доставка', + 'Go home' => 'На главную', + 'Google+' => 'Google+', + 'Grid' => 'Сетка', + 'Home' => 'Главная', + 'I\'ve read and agreed on Terms & Conditions' => 'Я прочитал и согласен с правилами и условиями', + 'If nothing happens within 10 seconds, please click here.' => 'Если ничего не произойдет в течение следующих 10 секунд, нажмите сюда. ', + 'In Stock' => 'В наличии', + 'Instagram' => 'Instagram', + 'Language' => 'Язык', + 'Language:' => 'Язык:', + 'Latest' => 'Последние', + 'Latest articles' => 'Последние статьи', + 'Latest products' => 'Новые продукты', + 'List' => 'Список', + 'List of orders' => 'Список заказов', + 'Log In!' => 'Войти!', + 'Log out!' => 'Выход!', + 'Login' => 'Вход', + 'Login Information' => 'Данные для входа', + 'Main Navigation' => 'Навигация', + 'Minimum 2 characters.' => 'Не менее 2 символов.', + 'Multi-payment platform' => 'Мульти платежная платформа', + 'My Account' => 'Моя учетная запись', + 'My Address Books' => 'Мои адресные книги', + 'My Address book' => 'Моя адресная книга', + 'My Orders' => 'Мои заказы', + 'My order' => 'Мой заказ', + 'Name' => 'Имя', + 'Name ascending' => 'Название по возрастанию', + 'Name descending' => 'Название по убыванию', + 'Need help ?' => 'Нужна помощь?', + 'Newsletter' => 'Рассылка', + 'Newsletter Subscription' => 'Подписка на рассылку', + 'Next' => 'Следующая', + 'Next Step' => 'Следующий шаг', + 'Next product' => 'Следующий продукт', + 'No Content in this folder.' => 'Содержимое в папке отсутствует.', + 'No articles currently' => 'В настоящее время нет статей', + 'No deliveries available for this cart and this country' => 'К сожалению мы не можем предложить способ доставки для этой страны', + 'No products available in this category' => 'Нет продуктов в этой категории', + 'No results found' => 'Ничего не найдено', + 'No.' => '№', + 'Offers' => 'Предложения', + 'Ok' => 'Хорошо', + 'Order details' => 'Информация о заказе', + 'Order number' => 'Номер заказа', + 'Orders over $50' => 'Заказы свыше $50', + 'Out of Stock' => 'Нет в наличии', + 'Pagination' => 'Нумерация страниц', + 'Password' => 'Пароль', + 'Password Forgotten' => 'Забыли пароль', + 'Pay with %module_title' => 'Оплатить с помощью %module_title', + 'Personal Information' => 'Персональные данные', + 'Placeholder address label' => 'Домашний, рабочий, другой', + 'Placeholder address1' => '76 Ninth Avenue', + 'Placeholder address2' => 'Адрес', + 'Placeholder cellphone' => 'Мобильный телефон', + 'Placeholder city' => 'New York', + 'Placeholder company' => 'Google', + 'Placeholder contact email' => 'So I can get back to you.', + 'Placeholder contact message' => 'И ваше сообщение...', + 'Placeholder contact name' => 'Как вас зовут?', + 'Placeholder contact subject' => 'Тема вашего сообщения.', + 'Placeholder email' => 'johndoe@domain.com', + 'Placeholder firstname' => 'John', + 'Placeholder lastname' => 'Doe', + 'Placeholder phone' => 'Номер телефона', + 'Placeholder zipcode' => 'NY 10011', + 'Please enter your email address below.' => 'Пожалуйста, задайте ниже Ваш адрес электронной почты.', + 'Please try again to order' => 'Пожалуйста, попробуйте заказать еще раз', + 'Position' => 'Позиция', + 'Previous' => 'Предыдущий', + 'Previous product' => 'Предыдущий продукт', + 'Price' => 'Цена', + 'Price ascending' => 'Цена по возрастанию', + 'Price descending' => 'Цена по убыванию', + 'Proceed checkout' => 'Продолжить', + 'Product Empty Button' => 'Добавить свой первый товар', + 'Product Empty Message' => 'Это действительно быстро добавить товар. +
      +
    1. Выберите NEW во вкладке подробнее, если вы хотите видеть товар в разделе новых товаров.
    2. +
    3. Выберите SALE во вкладке подробнее, если вы хотите видеть товар в разделе специальное предложение.
    4. +
    ', + 'Product Empty Title' => 'Добро пожаловать', + 'Product Name' => 'Название продукта', + 'Product Offers' => 'Специальное предложение', + 'Qty' => 'Кол-во', + 'Quantity' => 'Количество', + 'Questions ? See our F.A.Q.' => 'Остались вопросы? Посмотрите F.A.Q.', + 'RSS' => 'RSS', + 'Rating' => 'Оценка', + 'Redirect to bank service' => 'Перенаправление к банковскому сервису', + 'Ref.' => 'Номер.', + 'Register' => 'Регистрация', + 'Register!' => 'Регистрация!', + 'Regular Price:' => 'Обычная цена:', + 'Related' => 'Связанные', + 'Remove' => 'Удалить', + 'Remove this address' => 'Удалить этот адрес', + 'SELECT YOUR CURRENCY' => 'ВЫБЕРИТЕ ВАШУ ВАЛЮТУ', + 'SELECT YOUR LANGUAGE' => 'ВЫБЕРИТЕ ВАШ ЯЗЫК', + 'Search' => 'Поиск', + 'Search Result for' => 'Результат поиска для', + 'Search a product' => 'Найти товар', + 'Search...' => 'Поиск...', + 'Secure Payment' => 'Безопасная оплата', + 'Secure payment' => 'Безопасная оплата', + 'Select Country' => 'Выберите страну', + 'Select Title' => 'Выберите название', + 'Select your country:' => 'Выберите Вашу страну:', + 'Send' => 'Отправить', + 'Send us a message' => 'Отправить нам сообщение', + 'Shipping Tax' => 'Стоимость доставки', + 'Show' => 'Показать', + 'Sign In' => 'Войти', + 'Sign up to receive our latest news.' => 'Зарегистрируйтесь, чтобы получать последние новости.', + 'Skip to content' => 'Перейти к содержанию', + 'Sorry, your cart is empty. There\'s nothing to pay.' => 'К сожалению, Ваша корзина пуста. Нет ничего, за что бы было можно заплатить.', + 'Sort By' => 'Сортировать по', + 'Special Price:' => 'Специальная цена:', + 'Status' => 'Статус', + 'Subscribe' => 'Подписаться', + 'Thank you for the trust you place in us.' => 'Благодарим вас за доверие.', + 'Thanks !' => 'Спасибо!', + 'Thanks for signing up! We\'ll keep you posted whenever we have any new updates.' => 'Спасибо за регистрацию! Мы будем держать вас в курсе новинок.', + 'Thanks for your message, we will contact as soon as possible.' => 'Спасибо за ваше сообщение, мы свяжемся с как можно скорее.', + 'The page cannot be found' => 'Страница не найдена', + 'Thelia V2' => 'Thelia V2', + 'Toggle navigation' => 'Переключить навигацию', + 'Total' => 'Итого', + 'Try again' => 'Попробуйте пожалуйста еще раз.', + 'Twitter' => 'Twitter', + 'Unit Price' => 'Цена за единицу', + 'Update' => 'Обновить', + 'Update Profile' => 'Обновить профиль', + 'Update Quantity' => 'Обновить количество', + 'Upsell Products' => 'Товары со скидкой', + 'Useful links' => 'Полезные ссылки', + 'View' => 'Посмотреть', + 'View Cart' => 'Просмотреть корзину', + 'View all' => 'Просмотреть все', + 'View as' => 'Посмотреть как', + 'View order %ref as pdf document' => 'Просмотреть заказ %ref как pdf документ', + 'View product' => 'Просмотр продукта', + 'Warning' => 'Внимание', + 'We\'re sorry, a problem occured and your payment was not successful.' => 'Извините, возникла проблема, и не удалось завершить платеж.', + 'You are here:' => 'Вы находитесь здесь:', + 'You choose to pay by' => 'Вы выбрали оплату', + 'You don\'t have orders yet.' => 'У вас пока еще нет заказов.', + 'You have no items in your shopping cart.' => 'У вас нет товаров в корзине.', + 'You may have a coupon ?' => 'Возможно у вас есть купон?', + 'You want to subscribe to the newsletter? Please enter your email address below.' => 'Вы хотите подписаться на рассылку новостей? Пожалуйста, введите ниже ваш адрес электронной почты.', + 'You will receive a link to reset your password.' => 'Вы получите ссылку для сброса пароля.', + 'Your Cart' => 'Ваша корзина', + 'Your email address' => 'Ваш адрес электронной почты', + 'Your order will be confirmed by us upon receipt of your payment.' => 'Ваш заказ будет подтвержден после получения платежа.', + 'Youtube' => 'Youtube', + 'deliveries' => 'доставки', + 'for' => 'для', + 'instead of' => 'вместо', + 'missing or invalid data' => 'отсутствуют или неневерные данные', + 'per page' => 'на странице', + 'update' => 'обновить', + 'with:' => 'с:', +); diff --git a/templates/frontOffice/default/account-password.html b/templates/frontOffice/default/account-password.html index 653ed9eef..9d0b592b7 100644 --- a/templates/frontOffice/default/account-password.html +++ b/templates/frontOffice/default/account-password.html @@ -2,7 +2,7 @@ {* Security *} {block name="no-return-functions" prepend} - {check_auth context="front" role="CUSTOMER" login_tpl="login"} + {check_auth role="CUSTOMER" login_tpl="login"} {/block} {* Body Class *} diff --git a/templates/frontOffice/default/account-update.html b/templates/frontOffice/default/account-update.html index 467d586f6..01c692094 100644 --- a/templates/frontOffice/default/account-update.html +++ b/templates/frontOffice/default/account-update.html @@ -2,7 +2,7 @@ {* Security *} {block name="no-return-functions" prepend} - {check_auth context="front" role="CUSTOMER" login_tpl="login"} + {check_auth role="CUSTOMER" login_tpl="login"} {/block} {* Body Class *} diff --git a/templates/frontOffice/default/account.html b/templates/frontOffice/default/account.html index a6fe50d84..bce767bde 100644 --- a/templates/frontOffice/default/account.html +++ b/templates/frontOffice/default/account.html @@ -2,7 +2,7 @@ {* Security *} {block name="no-return-functions" prepend} - {check_auth context="front" role="CUSTOMER" login_tpl="login"} + {check_auth role="CUSTOMER" login_tpl="login"} {/block} {* Breadcrumb *} @@ -38,15 +38,18 @@
    • - {$ADDRESS1 nofilter}
      + {if $COMPANY} + {$COMPANY}
      + {/if} + {$ADDRESS1}
      {if $ADDRESS2 != ""} - {$ADDRESS2 nofilter}
      + {$ADDRESS2}
      {/if} {if $ADDRESS3 != ""} - {$ADDRESS3 nofilter}
      + {$ADDRESS3}
      {/if} {$ZIPCODE} - {$CITY nofilter}
      {loop type="country" name="customer.country.info" id=$COUNTRY}{$TITLE}{/loop}
      + {$CITY}
      {loop type="country" name="customer.country.info" id=$COUNTRY}{$TITLE}{/loop}
    • @@ -94,15 +97,15 @@
    • - {$ADDRESS1 nofilter}
      + {$ADDRESS1}
      {if $ADDRESS2 != ""} - {$ADDRESS2 nofilter}
      + {$ADDRESS2}
      {/if} {if $ADDRESS3 != ""} - {$ADDRESS3 nofilter}
      + {$ADDRESS3}
      {/if} {$ZIPCODE} - {$CITY nofilter}, {loop type="country" name="customer.country.info" id=$COUNTRY}{$TITLE}{/loop} + {$CITY}, {loop type="country" name="customer.country.info" id=$COUNTRY}{$TITLE}{/loop}
    • @@ -157,8 +160,12 @@ {$REF} {format_date date=$CREATE_DATE} {format_number number=$TOTAL_TAXED_AMOUNT} {loop type="currency" name="order.currency" id={$CURRENCY}}{$SYMBOL}{/loop} - {loop type="order-status" name="order.status" id={$STATUS}}{$TITLE}{/loop} - {intl l="Order details"} + {loop type="order-status" name="order.status" id={$STATUS}}{assign "orderStatusLabel" "order_$CODE"}{$TITLE}{/loop} + + {if $STATUS >=2} + {intl l="Order details"} + {/if} + {/loop} @@ -179,4 +186,4 @@
    {/block} -{block name="after-javascript-include"}{/block} \ No newline at end of file +{block name="after-javascript-include"}{/block} diff --git a/templates/frontOffice/default/address-update.html b/templates/frontOffice/default/address-update.html index 6add1d884..65e9c0177 100644 --- a/templates/frontOffice/default/address-update.html +++ b/templates/frontOffice/default/address-update.html @@ -2,7 +2,7 @@ {* Security *} {block name="no-return-functions" prepend} - {check_auth context="front" role="CUSTOMER" login_tpl="login"} + {check_auth role="CUSTOMER" login_tpl="login"} {/block} {* Body Class *} @@ -60,7 +60,7 @@ {form_field form=$form field="title"} {assign var="customer_title_id" value="{$value|default:$TITLE}"}
    - +
    + {if $error } + {$message} + {assign var="error_focus" value="true"} + {/if} +
    +
    + {/form_field} + {form_field form=$form field="address1"}
    @@ -170,7 +183,7 @@ {form_field form=$form field="country"} {assign var="customer_country_id" value="{$value|default:$COUNTRY}"}
    - +
    @@ -105,6 +105,19 @@ {/form_field} + {form_field form=$form field="company"} +
    + +
    + + {if $error } + {$message} + {assign var="error_focus" value="true"} + {/if} +
    +
    + {/form_field} + {form_field form=$form field="address1"}
    @@ -167,7 +180,7 @@ {form_field form=$form field="country"}
    - +
    + {loop type="country" name="countryLoop" with_area="true"} + + {/loop} + + {intl l="update"} +
    + {/if} + {if $delivery_id != 0 } +
    + {intl l="with:"} {loop type="delivery" name="deliveryLoop" id=$delivery_id}{$TITLE} {/loop} +
    + {else} +
    + {intl l="No deliveries available for this cart and this country"} +
    + {/if} + + + {$postage} {currency attr="symbol"} + - + {$postage} {currency attr="symbol"} + + {/postage} - +   {intl l="Total"}
    - {cart attr="total_taxed_price_without_discount"} {currency attr="symbol"} + {assign var="totalAmount" value={cart attr='total_taxed_price_without_discount'} + $postageAmount } + {$totalAmount} {currency attr="symbol"}
    @@ -169,6 +209,11 @@ $("select[name=quantity]").change(function(){ $(this).parents('form').submit(); }); + $(".btn-change-country").click(function(e){ + e.preventDefault(); + var $form = $(this).parents('form'); + $form.submit(); + }) }); {/block} diff --git a/templates/frontOffice/default/category.html b/templates/frontOffice/default/category.html index e7fa3116a..719f91395 100644 --- a/templates/frontOffice/default/category.html +++ b/templates/frontOffice/default/category.html @@ -18,6 +18,11 @@ {/loop} {/block} +{* Feeds *} +{block name="feeds"} + +{/block} + {* Breadcrumb *} {block name='no-return-functions' append} {$breadcrumbs = []} diff --git a/templates/frontOffice/default/configs/variables.conf b/templates/frontOffice/default/configs/variables.conf new file mode 100644 index 000000000..c2c81c01d --- /dev/null +++ b/templates/frontOffice/default/configs/variables.conf @@ -0,0 +1,13 @@ +# Maximum number of lines in lists +# -------------------------------- +max_displayed_orders = 20 +max_displayed_customers = 20 + +# order status - seems ununsed ? +# ------------------------------ + +order_not_paid = 'warning' +order_paid = 'success' +order_processing = 'primary' +order_sent = 'info' +order_canceled = 'danger' \ No newline at end of file diff --git a/templates/frontOffice/default/content.html b/templates/frontOffice/default/content.html index 59775fa78..398072a39 100644 --- a/templates/frontOffice/default/content.html +++ b/templates/frontOffice/default/content.html @@ -18,6 +18,11 @@ {/loop} {/block} +{* Feeds *} +{block name="feeds"} + +{/block} + {* Breadcrumb *} {block name='no-return-functions' append} {$breadcrumbs = []} diff --git a/templates/frontOffice/default/email/order.html b/templates/frontOffice/default/email/order.html deleted file mode 100644 index 420186513..000000000 --- a/templates/frontOffice/default/email/order.html +++ /dev/null @@ -1,123 +0,0 @@ -{extends file="email/template.tpl"} - -{* Open in browser *} -{block name="email-browsers"}{/block} - -{* Subject *} -{block name="email-subject"}Your order confirmation Nº __ORDER_REF__{/block} - -{* Title *} -{block name="email-title"}Thank you for your order!{/block} - -{* Content *} -{block name="email-content"} - - {assign var="orderId" value="1"} - - {loop name="order.invoice" type="order" id=$orderId customer="*"} - {loop name="currency.order" type="currency" id=$CURRENCY} - {assign "orderCurrencySymbol" $SYMBOL} - {assign var="orderCurrencyIsoCode" value=$ISOCODE} - {/loop} - {loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"} - {assign var="customerRef" value=$REF} - {/loop} - - Here are the details of your purchase:

    - - - - - - -
    - Delivery address:
    - {loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS} - {$FIRSTNAME} {$LASTNAME}
    - {$ADDRESS1}
    - {if $ADDRESS2 != ""}{$ADDRESS2}
    {/if} - {if $ADDRESS3 != ""}{$ADDRESS3}
    {/if} - {$CITY}
    - {$ZIPCODE}, {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}
    - {/loop} -
    - Billing address:
    - {loop type="order_address" name="invoice_address" id=$INVOICE_ADDRESS} - {$FIRSTNAME} {$LASTNAME}
    - {$ADDRESS1}
    - {if $ADDRESS2 != ""}{$ADDRESS2}
    {/if} - {if $ADDRESS3 != ""}{$ADDRESS3}
    {/if} - {$CITY}
    - {$ZIPCODE}, {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}
    - {/loop} -
    - -
    - -

    - Order Total: {$TOTAL_TAXED_AMOUNT} {$orderCurrencySymbol} {$orderCurrencyIsoCode}
    - Order Number: {$REF}
    - Paid With: {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}
    - Purchase Date: {format_date date=$CREATE_DATE output="date"}
    - Delivery method: {loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}
    -

    - - - - - - - {loop type="order_product" name="order-products" order=$ID} - {if $WAS_IN_PROMO == 1} - {assign "realPrice" $PROMO_PRICE} - {assign "realTax" $PROMO_PRICE_TAX} - {assign "realTaxedPrice" $TAXED_PROMO_PRICE} - {else} - {assign "realPrice" $PRICE} - {assign "realTax" $PRICE_TAX} - {assign "realTaxedPrice" $TAXED_PRICE} - {/if} - - - - - {/loop} - - - - - - - - - - - - -
    What You PurchasedPrice in {$orderCurrencyIsoCode}
    - {$TITLE} ({$REF}) - {ifloop rel="combinations"}
    - {loop type="order_product_attribute_combination" name="combinations" order_product=$ID} - * {$ATTRIBUTE_TITLE}: {$ATTRIBUTE_AVAILABILITY_TITLE} - {/loop} - {/ifloop} -
    - {$QUANTITY} x {$realTaxedPrice} {$orderCurrencySymbol} -
    Total{$TOTAL_TAXED_AMOUNT - $POSTAGE} {$orderCurrencySymbol}
    Shipping:{$POSTAGE} {$orderCurrencySymbol}
    Order Total{$TOTAL_TAXED_AMOUNT} {$orderCurrencySymbol}
    - {/loop} - -
    - -

    Support

    - For any questions, or concerns, feel free to contact support@yourdomain.com.

    - Our contact us at:
    - Thelia V2
    - Street name of my business
    - City
    - 75000, France - -
    -
    - Thanks,
    - The Thelia V2 team -{/block} diff --git a/templates/frontOffice/default/email/password-reset.html b/templates/frontOffice/default/email/password-reset.html deleted file mode 100644 index 0ff8c1553..000000000 --- a/templates/frontOffice/default/email/password-reset.html +++ /dev/null @@ -1,21 +0,0 @@ -{extends file="email/template.tpl"} - -{* Open in browser *} -{block name="email-browsers"}{/block} - -{* Subject *} -{block name="email-subject"}Thelia V2 password reset confirmation{/block} - -{* Title *} -{block name="email-title"}Password Reset{/block} - -{* Content *} -{block name="email-content"} - Hi there,

    - There was recently a request to change the password on your account.

    - If you requested this password change, please set a new password by following the link below:

    - __SITE__/forgot?forgot_key=5e20f225cedd08a3

    - If you don't want to change your password, just ignore this message.

    - Thanks,
    - - The Thelia V2 Team -{/block} diff --git a/templates/frontOffice/default/email/password.html b/templates/frontOffice/default/email/password.html deleted file mode 100644 index ef58e0873..000000000 --- a/templates/frontOffice/default/email/password.html +++ /dev/null @@ -1,21 +0,0 @@ -{extends file="email/template.tpl"} - -{* Open in browser *} -{block name="email-browsers"}{/block} - -{* Subject *} -{block name="email-subject"}Your password for Thelia V2{/block} - -{* Title *} -{block name="email-title"}Password{/block} - -{* Content *} -{block name="email-content"} - Hi there,

    - You have requested a new password for your Thelia V2 account.

    - Your new password is:
    - __PASSWORD__

    - You can change your password in your user account by opening the "Change my password" link under your personal information.

    - Kind regards,
    - - The Thelia V2 Team -{/block} diff --git a/templates/frontOffice/default/email/register.html b/templates/frontOffice/default/email/register.html deleted file mode 100644 index 41b03418c..000000000 --- a/templates/frontOffice/default/email/register.html +++ /dev/null @@ -1,42 +0,0 @@ -{extends file="email/template.tpl"} - -{* Open in browser *} -{block name="email-browsers"}{/block} - -{* Subject *} -{block name="email-subject"}Welcome to Thelia V2{/block} - -{* Title *} -{block name="email-title"}Welcome to Thelia V2{/block} - -{* Content *} -{block name="email-content"} - {assign var="customerId" value="1"} - - -

    Congratulations! You have successfully created an account on Thelia v2 demo site. Keep this email as a reference of your account details, and helpful links.

    - -
    - -

    Accessing Your Account:

    - Login at: {url path="/login"}
    - {loop type="customer" name="customer.info" id=$customerId} - Username: {$EMAIL}
    - Password: __MOTDEPASSE__
    - {/loop} -
    -
    - -

    Support

    - For any questions, or concerns, feel free to contact support@yourdomain.com.
    - -
    - Learn more about Thelia V2.
    - Our site: http://thelia.net/v2
    - Twitter: http://twitter.com/theliaecommerce
    - Facebook: http://www.facebook.com/theliaecommerce -
    -
    - Thanks,
    - - The Thelia V2 Team -{/block} diff --git a/templates/frontOffice/default/feed.html b/templates/frontOffice/default/feed.html new file mode 100644 index 000000000..2dd35a832 --- /dev/null +++ b/templates/frontOffice/default/feed.html @@ -0,0 +1,69 @@ + + +{* @todo order item by create date desc *} +{assign var="store_name" value="{config key="store_name"}"} +{loop type="lang" name="lang" id=$_lang_} + {assign var="locale" value="{$LOCALE}"} +{/loop} +{if $_context_ == "catalog"} + + {if $_id_ == "" } + {intl l="All products in"} {$store_name} + {url path="/"} + {$store_name} + {$locale|replace:'_':'-'|lower} + {$smarty.now|date_format:'r'} + Thelia 2.0 + {else} + {loop type="category" name="category" id=$_id_ lang=$_lang_ } + {intl l="All products in"} {$TITLE} - {$store_name} + {$URL} + {$CHAPO} + {$LOCALE|replace:'_':'-'|lower} + {format_date date=$UPDATE_DATE format="r"} + {$smarty.now|date_format:'r'} + Thelia 2.0 + {/loop} + {/if} + {loop type="product" name="product" category_default=$_id_ lang=$_lang_ order="id_reverse" } + + {$TITLE} + {$URL} + {$CHAPO} + {format_date date=$CREATE_DATE format="r"} + {$URL} + + {/loop} + +{else} + + {if $_id_ == "" } + {intl l="All contents in"} {$store_name} + {url path="/"} + {$store_name} + {$locale|replace:'_':'-'|lower} + {$smarty.now|date_format:'r'} + Thelia 2.0 + {else} + {loop type="folder" name="folder" id=$_id_ lang=$_lang_ } + {intl l="All contents in"} {$TITLE} - {$store_name} + {$URL} + {$CHAPO} + {$LOCALE|replace:'_':'-'|lower} + {format_date date=$UPDATE_DATE format="r"} + {$smarty.now|date_format:'r'} + Thelia 2.0 + {/loop} + {/if} + {loop type="content" name="content" folder_default=$_id_ lang=$_lang_ } + + {$TITLE} + {$URL} + {$CHAPO} + {format_date date=$CREATE_DATE format="r"} + {$URL} + + {/loop} + +{/if} + diff --git a/templates/frontOffice/default/includes/addedToCart.html b/templates/frontOffice/default/includes/addedToCart.html index 6e83a2612..1ecbf3317 100644 --- a/templates/frontOffice/default/includes/addedToCart.html +++ b/templates/frontOffice/default/includes/addedToCart.html @@ -1,3 +1,4 @@ +{default_translation_domain domain='fo.default'} {loop type="product" name="add_product_to_cart" id={product attr="id"}}
    diff --git a/templates/frontOffice/default/includes/mini-cart.html b/templates/frontOffice/default/includes/mini-cart.html index 5c075edf4..1dad142c3 100644 --- a/templates/frontOffice/default/includes/mini-cart.html +++ b/templates/frontOffice/default/includes/mini-cart.html @@ -16,16 +16,14 @@ {loop type="cart" name="cartloop"}
    - {ifloop rel="product-image"} - {loop type="image" name="product-image" product=$PRODUCT_ID limit="1" width="118" height="60"} - {$TITLE} - {/loop} - {/ifloop} + {loop type="image" name="product-image" product=$PRODUCT_ID limit="1" width="118" height="60"} + {$TITLE} + {/loop} -

    - {$TITLE} -

    +

    + {$TITLE} +

    {intl l="Remove"}
    diff --git a/templates/frontOffice/default/includes/single-product.html b/templates/frontOffice/default/includes/single-product.html index 941742ca1..4d8828741 100644 --- a/templates/frontOffice/default/includes/single-product.html +++ b/templates/frontOffice/default/includes/single-product.html @@ -31,7 +31,7 @@

    {$productTitle}

    {if $hasDescription}
    -

    {$DESCRIPTION}

    +

    {$DESCRIPTION nofilter}

    {/if} diff --git a/templates/frontOffice/default/includes/toolbar.html b/templates/frontOffice/default/includes/toolbar.html index b64297a2b..1f76c32d4 100644 --- a/templates/frontOffice/default/includes/toolbar.html +++ b/templates/frontOffice/default/includes/toolbar.html @@ -52,4 +52,4 @@ {/if} {/if} - + diff --git a/templates/frontOffice/default/index.html b/templates/frontOffice/default/index.html index 7937c824f..53aa8c0f1 100644 --- a/templates/frontOffice/default/index.html +++ b/templates/frontOffice/default/index.html @@ -3,6 +3,11 @@ {* Body Class *} {block name="body-class"}page-home{/block} +{* Page Title *} +{block name='no-return-functions' append} + {$page_title = {config key="store_name"}} +{/block} + {* Hide breadcrumb *} {block name='breadcrumb'}{/block} diff --git a/templates/frontOffice/default/layout.tpl b/templates/frontOffice/default/layout.tpl index a53d7ea2e..8a2d06a4c 100644 --- a/templates/frontOffice/default/layout.tpl +++ b/templates/frontOffice/default/layout.tpl @@ -1,449 +1,460 @@ - - - -{* Declare assets directory, relative to template base directory *} -{declare_assets directory='assets'} -{block name="no-return-functions"}{/block} -{assign var="store_name" value="{config key="store_name"}"} -{if not $store_name}{assign var="store_name" value="{intl l='Thelia V2'}"}{/if} - -{* paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither *} - - - - - - - {* Test if javascript is enabled *} - - - - - {* Page Title *} - {block name="page-title"}{strip}{if $page_title}{$page_title}{elseif $breadcrumbs}{foreach from=$breadcrumbs|array_reverse item=breadcrumb}{$breadcrumb.title|unescape} - {/foreach}{$store_name}{/if}{/strip}{/block} - - {* Meta Tags *} - - - - {block name="meta"} - - - {/block} - - {* Stylesheets *} - {stylesheets file='assets/css/styles.css'} - - {/stylesheets} - - {block name="stylesheet"}{/block} - - {* Favicon *} - {images file='assets/img/favicon.ico'}{/images} - {images file='assets/img/favicon.png'}{/images} - - {* HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries *} - - - - - - -{intl l="Skip to content"} - -
    - -
    - - - - - - -
    - -
    -
    - {block name="breadcrumb"}{include file="misc/breadcrumb.tpl"}{/block} -
    {block name="main-content"}{/block}
    -
    -
    - - - -
    - -{block name="before-javascript-include"}{/block} - - - - - - - - -{javascripts file='assets/js/bootstrap/bootstrap.js'} - -{/javascripts} - -{javascripts file='assets/js/plugins/bootbox/bootbox.js'} - -{/javascripts} - -{block name="after-javascript-include"}{/block} - -{block name="javascript-initialization"}{/block} - - -{javascripts file='assets/js/script.js'} - -{/javascripts} - + + + +{* Declare assets directory, relative to template base directory *} +{declare_assets directory='assets'} +{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *} +{default_translation_domain domain='fo.default'} + +{* -- Define some stuff for Smarty ------------------------------------------ *} +{config_load file='variables.conf'} + +{block name="no-return-functions"}{/block} +{assign var="store_name" value="{config key="store_name"}"} +{if not $store_name}{assign var="store_name" value="{intl l='Thelia V2'}"}{/if} + +{* paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither *} + + + + + + + {* Test if javascript is enabled *} + + + + + {* Page Title *} + {block name="page-title"}{strip}{if $page_title}{$page_title}{elseif $breadcrumbs}{foreach from=$breadcrumbs|array_reverse item=breadcrumb}{$breadcrumb.title|unescape} - {/foreach}{$store_name}{/if}{/strip}{/block} + + {* Meta Tags *} + + + + {block name="meta"} + + + {/block} + + {* Stylesheets *} + {stylesheets file='assets/css/styles.css'} + + {/stylesheets} + + {block name="stylesheet"}{/block} + + {* Favicon *} + {images file='assets/img/favicon.ico'}{/images} + {images file='assets/img/favicon.png'}{/images} + + {* Feeds *} + + + {block name="feeds"}{/block} + + {* HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries *} + + + + + + +{intl l="Skip to content"} + +
    + +
    + + + + + + +
    + +
    +
    + {block name="breadcrumb"}{include file="misc/breadcrumb.tpl"}{/block} +
    {block name="main-content"}{/block}
    +
    +
    + + + +
    + +{block name="before-javascript-include"}{/block} + + + + + + + + +{javascripts file='assets/js/bootstrap/bootstrap.js'} + +{/javascripts} + +{javascripts file='assets/js/plugins/bootbox/bootbox.js'} + +{/javascripts} + +{block name="after-javascript-include"}{/block} + +{block name="javascript-initialization"}{/block} + + +{javascripts file='assets/js/script.js'} + +{/javascripts} + \ No newline at end of file diff --git a/templates/frontOffice/default/order-delivery.html b/templates/frontOffice/default/order-delivery.html index b69fabe39..49be8707d 100644 --- a/templates/frontOffice/default/order-delivery.html +++ b/templates/frontOffice/default/order-delivery.html @@ -2,7 +2,7 @@ {* Security *} {block name="no-return-functions" prepend} - {check_auth context="front" role="CUSTOMER" login_tpl="login"} + {check_auth role="CUSTOMER" login_tpl="login"} {check_cart_not_empty} {/block} @@ -23,7 +23,7 @@
    -

    {intl l="Your Cart"}

    +

    {intl l="Billing and delivery"}

    {include file="misc/checkout-progress.tpl" step="delivery"} diff --git a/templates/frontOffice/default/order-failed.html b/templates/frontOffice/default/order-failed.html new file mode 100644 index 000000000..a15eb0515 --- /dev/null +++ b/templates/frontOffice/default/order-failed.html @@ -0,0 +1,50 @@ +{extends file="layout.tpl"} + +{* Security *} +{block name="no-return-functions" prepend} + {check_auth role="CUSTOMER" login_tpl="login"} +{/block} + +{* Body Class *} +{block name="body-class"}page-order-payment{/block} + +{* Breadcrumb *} +{block name='no-return-functions' append} + {$breadcrumbs = [ + ['title' => {intl l="Cart"}, 'url'=>{url path="/cart"}], + ['title' => {intl l="Secure Payment"}, 'url'=>{url path="/order/pay"}] + ]} +{/block} + + +{block name="main-content"} +
    +
    + +

    {intl l="Your Cart"}

    + + {include file="misc/checkout-progress.tpl" step="last"} + + {loop type="order" name="failed-order" id=$failed_order_id} + +
    +
    +

    {intl l="You choose to pay by"} : {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}

    +
    +
    +

    {intl l="We're sorry, a problem occured and your payment was not successful."}

    + {if null !== $failed_order_message} +

    {$failed_order_message}

    + {/if} + + {intl l="Try again"} +
    +
    + + {/loop} + + {intl l="Go home"} + +
    +
    +{/block} diff --git a/templates/frontOffice/default/order-invoice.html b/templates/frontOffice/default/order-invoice.html index eebaa921b..fd0b5d22c 100644 --- a/templates/frontOffice/default/order-invoice.html +++ b/templates/frontOffice/default/order-invoice.html @@ -2,7 +2,7 @@ {* Security *} {block name="no-return-functions" prepend} - {check_auth context="front" role="CUSTOMER" login_tpl="login"} + {check_auth role="CUSTOMER" login_tpl="login"} {check_cart_not_empty} {check_valid_delivery} {/block} @@ -23,7 +23,7 @@
    -

    {intl l="Your Cart"}

    +

    {intl l="Check my order"}

    {include file="misc/checkout-progress.tpl" step="invoice"} @@ -173,8 +173,9 @@
    {/form} + {form name="thelia.order.payment"} - {assign var="isPost" value="{$smarty.post|count}"} + {assign var="isPost" value=$smarty.post|count}
    {form_hidden_fields form=$form} @@ -261,26 +262,22 @@ {/if}
    -
      - +
        {loop type="payment" name="payments" force_return="true"} - {assign "paymentModuleId" $ID} - {loop type="image" name="paymentspicture" source="module" source_id=$ID force_return="true" width="100" height="72"} +
      • +
      • -
        - -
        -
      • - - {/loop} + {loop type="image" name="paymentspicture" source="module" source_id=$ID force_return="true" width="100" height="72"} + {intl l= + {/loop} + {$TITLE} + + {/loop} - +
    @@ -289,14 +286,8 @@ {intl l="Back"} - {/form} - - - - -
    {/block} diff --git a/templates/frontOffice/default/order-payment-gateway.html b/templates/frontOffice/default/order-payment-gateway.html new file mode 100644 index 000000000..1ac362384 --- /dev/null +++ b/templates/frontOffice/default/order-payment-gateway.html @@ -0,0 +1,76 @@ +{extends file="layout.tpl"} + +{* Security *} +{block name="no-return-functions" prepend} + {check_auth role="CUSTOMER" login_tpl="login"} +{/block} + +{* Body Class *} +{block name="body-class"}page-order-payment{/block} + +{* Breadcrumb *} +{block name='no-return-functions' append} + {$breadcrumbs = [ + ['title' => {intl l="Cart"}, 'url'=>{url path="/cart"}], + ['title' => {intl l="Secure Payment"}, 'url'=>{url path="/order/pay"}] + ]} +{/block} + + +{block name="main-content"} +
    +
    + +

    {intl l="Secure payment"}

    + + {include file="misc/checkout-progress.tpl" step="last"} + + {loop type="order" name="placed-order" id=$order_id} + +
    +
    +

    {intl l="You choose to pay by"} : {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}

    +
    + +
    + {if $cart_count > 0} +
    + {intl l="Connecting to the secure payment server, please wait a few seconds..."} +
    + +
    + +
    + {foreach from=$payment_form_data key='name' item='value'} + + {/foreach} + +

    {intl l='If nothing happens within 10 seconds, please click here.'}

    +
    +
    + {else} + {intl l="Sorry, your cart is empty. There's nothing to pay."} + {/if} +
    +
    + {/loop} +
    + +
    +{/block} + +{block name="javascript-initialization"} + +{/block} + + diff --git a/templates/frontOffice/default/order-placed.html b/templates/frontOffice/default/order-placed.html index c8a1a24f2..3d5c097c5 100644 --- a/templates/frontOffice/default/order-placed.html +++ b/templates/frontOffice/default/order-placed.html @@ -2,7 +2,7 @@ {* Security *} {block name="no-return-functions" prepend} - {check_auth context="front" role="CUSTOMER" login_tpl="login"} + {check_auth role="CUSTOMER" login_tpl="login"} {/block} {* Body Class *} diff --git a/templates/frontOffice/default/product.html b/templates/frontOffice/default/product.html index 2d11498e8..a3c57a371 100644 --- a/templates/frontOffice/default/product.html +++ b/templates/frontOffice/default/product.html @@ -5,14 +5,14 @@ {* Page Title *} {block name='no-return-functions' append} - {loop name="product.seo.title" type="product" id="{product attr="id"}"} + {loop name="product.seo.title" type="product" id="{product attr="id"}" with_prev_next_info="1"} {$page_title = {$META_TITLE}} {/loop} {/block} {* Meta *} {block name="meta"} - {loop name="product.seo.meta" type="product" id="{product attr="id"}" limit="1"} + {loop name="product.seo.meta" type="product" id="{product attr="id"}" limit="1" with_prev_next_info="1"} {if $META_DESCRIPTION}{/if} {if $META_KEYWORDS}{/if} {/loop} @@ -21,7 +21,7 @@ {* Breadcrumb *} {block name='no-return-functions' append} {$breadcrumbs = []} - {loop type="product" name="product_breadcrumb" id="{product attr="id"}" limit="1"} + {loop type="product" name="product_breadcrumb" id="{product attr="id"}" limit="1" with_prev_next_info="1"} {loop name="category_path" type="category-path" category="{$DEFAULT_CATEGORY}"} {$breadcrumbs[] = ['title' => {$TITLE}, 'url'=> {$URL}]} {/loop} @@ -32,7 +32,7 @@ {* Content *} {block name="main-content"}
    - {loop name="product.details" type="product" id="{product attr="id"}" limit="1"} + {loop name="product.details" type="product" id="{product attr="id"}" limit="1" with_prev_next_info="1"}
    diff --git a/templates/frontOffice/default/sitemap.html b/templates/frontOffice/default/sitemap.html new file mode 100644 index 000000000..f95263eec --- /dev/null +++ b/templates/frontOffice/default/sitemap.html @@ -0,0 +1,71 @@ + + + + + {url path="/"} + {* + You can also set priority and changefreq + 0.8 + weekly + *} + + +{if $_context_ == "" || $_context_ == "catalog" } + + + {loop type="lang" name="category_lang"} + {if $_lang_ == "" || $_lang_ == $CODE } + {loop type="category" name="category" lang="$ID"} + + {$URL} + {format_date date=$UPDATE_DATE format="c"} + + {/loop} + {/if} + {/loop} + + + {loop type="lang" name="product_lang"} + {if $_lang_ == "" || $_lang_ == $CODE } + {loop type="product" name="product" lang="$ID"} + + {$URL} + {format_date date=$UPDATE_DATE format="c"} + + {/loop} + {/if} + {/loop} + +{/if} + +{if $_context_ == "" || $_context_ == "content" } + + {loop type="lang" name="folder_lang"} + {if $_lang_ == "" || $_lang_ == $CODE } + {loop type="folder" name="folder" lang="$ID"} + + {$URL} + {format_date date=$UPDATE_DATE format="c"} + + {/loop} + {/if} + {/loop} + + + {loop type="lang" name="content_lang"} + {if $_lang_ == "" || $_lang_ == $CODE } + {loop type="content" name="content" lang="$ID"} + + {$URL} + {format_date date=$UPDATE_DATE format="c"} + + {/loop} + {/if} + {/loop} +{/if} + + \ No newline at end of file diff --git a/templates/pdf/default/I18n/cs_CZ.php b/templates/pdf/default/I18n/cs_CZ.php new file mode 100644 index 000000000..45b66e616 --- /dev/null +++ b/templates/pdf/default/I18n/cs_CZ.php @@ -0,0 +1,28 @@ + 'Číslo zákazníka', + 'DELIVERY' => 'DODÁNÍ', + 'Delivery module' => 'Doručovací modul', + 'INVOICE' => 'FAKTURA', + 'Invoice REF' => 'Faktura číslo', + 'Invoice date' => 'Datum vystavení', + 'Payment module' => 'Platební modul', + 'Postage' => 'Poštovné', + 'Product' => 'Zboží', + 'Quantity' => 'Množství', + 'Ref' => 'Číslo', + 'THANK YOU' => 'Děkuji', + 'Tax' => 'Daň', + 'Taxed total' => 'Celkem před zdaněním', + 'Total' => 'Celkem', + 'Total with tax' => 'Celkem včetně daně', + 'Total without tax' => 'Celkem bez daně', + 'Unit taxed price' => 'Jednotková cena včetně daně', + 'Unit. price' => 'Jednotková cena', + 'delivery adress' => 'Doručovací adresa', + 'delivery module' => 'doručovací modul', + 'invoice address' => 'fakturační adresa', + 'page' => 'stránka', + 'product' => 'zboží', +); diff --git a/templates/pdf/default/I18n/en_US.php b/templates/pdf/default/I18n/en_US.php index e7e1d6202..2b562ab6a 100755 --- a/templates/pdf/default/I18n/en_US.php +++ b/templates/pdf/default/I18n/en_US.php @@ -1,13 +1,18 @@ 'Custmer Number', + 'DELIVERY' => 'DELIVERY', 'Delivery module' => 'Delivery module', - 'Page' => 'Page', + 'INVOICE' => 'INVOICE', + 'Invoice REF' => 'Invoice REF', + 'Invoice date' => 'Invoice date', 'Payment module' => 'Payment module', 'Postage' => 'Postage', 'Product' => 'Product', 'Quantity' => 'Quantity', 'Ref' => 'Ref', + 'THANK YOU' => 'THANK YOU', 'Tax' => 'Tax', 'Taxed total' => 'Taxed total', 'Total' => 'Total', @@ -15,13 +20,9 @@ return array( 'Total without tax' => 'Total without tax', 'Unit taxed price' => 'Unit taxed price', 'Unit. price' => 'Unit. price', - 'customer number' => 'customer number', - 'delivery address' => 'delivery address', + 'delivery adress' => 'Delivery Adress', 'delivery module' => 'delivery module', - 'invoice' => 'invoice', 'invoice address' => 'invoice address', - 'invoice date' => 'invoice date', - 'invoice ref' => 'invoice ref', 'page' => 'page', 'product' => 'product', ); diff --git a/templates/pdf/default/I18n/fr_FR.php b/templates/pdf/default/I18n/fr_FR.php index 7b3a85386..fdfc48491 100755 --- a/templates/pdf/default/I18n/fr_FR.php +++ b/templates/pdf/default/I18n/fr_FR.php @@ -1,27 +1,28 @@ 'Numéro client', + 'DELIVERY' => 'LIVRAISON', 'Delivery module' => 'Module de livraison', - 'Page' => 'Page', + 'INVOICE' => 'FACTURE', + 'Invoice REF' => 'Ref de facture', + 'Invoice date' => 'Date de facturation', 'Payment module' => 'Module de paiement', 'Postage' => 'Frais de livraison', 'Product' => 'Produit', - 'Quantity' => 'Quantit', + 'Quantity' => 'Quantité', 'Ref' => 'Ref', + 'THANK YOU' => 'MERCI', 'Tax' => 'Taxes', - 'Taxed total' => 'Montant total des taxes', + 'Taxed total' => 'Total TTC', 'Total' => 'Total', 'Total with tax' => 'Total TTC', 'Total without tax' => 'Total HT', 'Unit taxed price' => 'Prix unitaire TTC', 'Unit. price' => 'Prix unitaire', - 'customer number' => 'Numro client', - 'delivery address' => 'Adresse de livraison', + 'delivery adress' => 'adresse de livraison', 'delivery module' => 'Mode de livraison', - 'invoice' => 'Facture', 'invoice address' => 'Adresse de facturation', - 'invoice date' => 'Date de la facture', - 'invoice ref' => 'Rfrence de la facture', 'page' => 'page', 'product' => 'Produit', ); diff --git a/templates/pdf/default/I18n/ru_RU.php b/templates/pdf/default/I18n/ru_RU.php new file mode 100644 index 000000000..b64b6de53 --- /dev/null +++ b/templates/pdf/default/I18n/ru_RU.php @@ -0,0 +1,28 @@ + 'Номер заказчика', + 'DELIVERY' => 'ДОСТАВКА', + 'Delivery module' => 'Модуль доставки', + 'INVOICE' => 'СЧЕТ-ФАКТУРА', + 'Invoice REF' => 'Счет-фактура номер', + 'Invoice date' => 'Дата фактуры', + 'Payment module' => 'Модуль оплаты', + 'Postage' => 'Почтовые расходы', + 'Product' => 'Товар', + 'Quantity' => 'Количество', + 'Ref' => 'Номер', + 'THANK YOU' => 'Спасибо', + 'Tax' => 'Налог', + 'Taxed total' => 'Итого без налогов', + 'Total' => 'Итого', + 'Total with tax' => 'Итого с налогом', + 'Total without tax' => 'Итого без налога', + 'Unit taxed price' => 'Цена единицы с налогом', + 'Unit. price' => 'Цена единицы', + 'delivery adress' => 'Адрес доставки', + 'delivery module' => 'модуль доставки', + 'invoice address' => 'Адрес плательщика', + 'page' => 'страница', + 'product' => 'товар', +); diff --git a/templates/pdf/default/delivery.html b/templates/pdf/default/delivery.html index 318ddff7e..3cad6a9b5 100644 --- a/templates/pdf/default/delivery.html +++ b/templates/pdf/default/delivery.html @@ -1,47 +1,83 @@ - +{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *} +{default_translation_domain domain='pdf.default'} +{literal} + - +{/literal} - - + + + + + @@ -55,139 +91,108 @@ {assign "orderCurrency" $SYMBOL} {/loop} - -
    +

    {intl l="THANK YOU"}

    +
    +

    {config key="store_name"}

    +
    {intl l="page"} [[page_cu]]/[[page_nb]]
    +
    + + - - + + + + + + + + + + + + - - + + + + + + + + - + + + +
    +

    {intl l="DELIVERY"}

    +
    +

    {intl l="Invoice date"}

    +

    {format_date date=$INVOICE_DATE}

    +
    +

    {intl l="Invoice REF"}

    +

    {$REF}

    +
    +

    {intl l="Custmer Number"}

    +

    {loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"}{$REF}{/loop}

    +
    +
    +

    {intl l="delivery adress"}

    +

    + {loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS} + {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}
    + {$ADDRESS1} {$ADDRESS2} {$ADDRESS3}
    + {$ZIPCODE} {$CITY}
    + {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop} + {/loop} +

    +
    +

    {intl l="invoice address"}

    +

    + {loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS} + {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}
    + {$ADDRESS1} {$ADDRESS2} {$ADDRESS3}
    + {$ZIPCODE} {$CITY}
    + {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop} + {/loop} +

    +
    -
    -

    - {config key="store_name"} - -

    + + + + + + + + + + {loop type="order_product" name="order-products" order=$ID} + + + + + + {/loop} - - -

    {intl l='Delivery module'}
    {$DELIVERY_REF}

    - - -
    +

    {intl l="Ref"}

    +
    +

    {intl l="product"}

    +
    +

    {intl l="Quantity"}

    +
    +

    {$REF}

    +
    +

    {$TITLE}

    +
    +

    {$QUANTITY}

    +
    - - - - - - - - - - - - -
    {intl l="invoice ref"}{intl l="invoice date"}
    {$REF}{format_date date=$INVOICE_DATE}
    - - - - - - - - - - - - - -
    {intl l="invoice"} {intl l="customer number"}
    {$INVOICE_REF}{loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"}{$REF}{/loop}
    - - - - - - - - - - - - - - -
    {intl l="delivery address"}
    - {loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS} - {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}
    - {$ADDRESS1} {$ADDRESS2} {$ADDRESS3}
    - {$ZIPCODE} {$COUNTRY}
    - {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop} - {/loop} -
    - - - - - - - - - -
    {intl l="invoice address"}
    - {loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS} - {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}
    - {$ADDRESS1} {$ADDRESS2} {$ADDRESS3}
    - {$ZIPCODE} {$COUNTRY}
    - {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop} - {/loop} -
    - - - - - - - - - - - - - - - - - - - - - {loop type="order_product" name="order-products" order=$ID} - - - - - - {/loop} - -
    {intl l="Ref"}{intl l="product"}{intl l="Quantity"}
    {$REF}{$TITLE}{$QUANTITY}
    - - - - - - - - - - - - -
    {intl l="delivery module"}{loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}
    + + +

    {intl l='Delivery module'}

    +

    {$DELIVERY_REF}

    + + + + + + {/loop} diff --git a/templates/pdf/default/invoice.html b/templates/pdf/default/invoice.html index 9b864f217..e6def76e1 100644 --- a/templates/pdf/default/invoice.html +++ b/templates/pdf/default/invoice.html @@ -1,233 +1,204 @@ - - - - +{/literal} + + - - - - - - - - - - - - - -
    {intl l="Page"} [[page_cu]]/[[page_nb]]
    -
    + + + + + + + + + + +
    {intl l="page"} [[page_cu]]/[[page_nb]]
    +
    {loop name="order.invoice" type="order" id=$order_id customer="*"} {loop name="currency.order" type="currency" id=$CURRENCY} - {assign "orderCurrency" $SYMBOL} + {assign "orderCurrency" $SYMBOL} + {/loop} + + + + + + + + + + + + + + + +
    +

    {intl l="INVOICE"}

    +
    +

    {intl l="Invoice date"}

    + {format_date date=$INVOICE_DATE} +
    +

    {intl l="Invoice REF"}

    + {$REF} +
    +

    {intl l="Custmer Number"}

    + {loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"}{$REF}{/loop} +
    + + + + + + + +
    +

    {intl l="delivery adress"}

    +

    + {loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS} + {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}
    + {$ADDRESS1} {$ADDRESS2} {$ADDRESS3}
    + {$ZIPCODE} {$CITY}
    + {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop} + {/loop} +

    +
    +

    {intl l="invoice address"}

    +

    + {loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS} + {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}
    + {$ADDRESS1} {$ADDRESS2} {$ADDRESS3}
    + {$ZIPCODE} {$CITY}
    + {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop} + {/loop} +

    +
    + + + + + + + + + + + + + + + + + + {loop type="order_product" name="order-products" order=$ID} + {if $WAS_IN_PROMO == 1} + {assign "realPrice" $PROMO_PRICE} + {assign "realTax" $PROMO_PRICE_TAX} + {assign "realTaxedPrice" $TAXED_PROMO_PRICE} + {else} + {assign "realPrice" $PRICE} + {assign "realTax" $PRICE_TAX} + {assign "realTaxedPrice" $TAXED_PRICE} + {/if} + + + + + + + + {/loop} -

    {intl l="Product"}

    {intl l="Unit. price"}

    {intl l="Tax"}

    {intl l="Unit taxed price"}

    {intl l="Quantity"}

    {intl l="Taxed total"}

    {$TITLE}

    + {ifloop rel="combinations"} + {loop type="order_product_attribute_combination" name="combinations" order_product=$ID} + {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}
    + {/loop} + {/ifloop} +

    {$orderCurrency} {$realPrice}

    {$orderCurrency} {$realTax}

    {$orderCurrency} {$realTaxedPrice}

    {$QUANTITY}

    {$orderCurrency} {$realTaxedPrice * $QUANTITY}

    - - - - - -
    - -
    -

    {config key="store_name"}

    -

    -

    {intl l="invoice"} {$INVOICE_REF}

    -
    - - - - - - - - - - - - - -
    {intl l="invoice ref"}{intl l="customer number"}{intl l="invoice date"}
    {$REF}{loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"}{$REF}{/loop}{format_date date=$INVOICE_DATE}
    -
    - - - - - - - - - -
    {intl l="delivery address"}
    - {loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS} - {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}
    - {$ADDRESS1} {$ADDRESS2} {$ADDRESS3}
    - {$ZIPCODE} {$CITY}
    - {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop} - {/loop} -
    - - - - - - - - - -
    {intl l="invoice address"}
    - {loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS} - {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}
    - {$ADDRESS1} {$ADDRESS2} {$ADDRESS3}
    - {$ZIPCODE} {$CITY}
    - {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop} - {/loop} -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - {loop type="order_product" name="order-products" order=$ID} - {if $WAS_IN_PROMO == 1} - {assign "realPrice" $PROMO_PRICE} - {assign "realTax" $PROMO_PRICE_TAX} - {assign "realTaxedPrice" $TAXED_PROMO_PRICE} - {else} - {assign "realPrice" $PRICE} - {assign "realTax" $PRICE_TAX} - {assign "realTaxedPrice" $TAXED_PRICE} - {/if} - - - - - - - - - {/loop} - -
    {intl l="Product"}{intl l="Unit. price"}{intl l="Tax"}{intl l="Unit taxed price"}{intl l="Quantity"}{intl l="Taxed total"}
    - {$TITLE} - {ifloop rel="combinations"} - {loop type="order_product_attribute_combination" name="combinations" order_product=$ID} - {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}
    - {/loop} - {/ifloop} -
    {$orderCurrency} {$realPrice}{$orderCurrency} {$realTax}{$orderCurrency} {$realTaxedPrice}{$QUANTITY}{$orderCurrency} {$realTaxedPrice * $QUANTITY}
    - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - -
    {intl l="Payment module"}{loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}
    {intl l="delivery module"}{loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {intl l="Total without tax"}{$orderCurrency} {$TOTAL_AMOUNT}
    {intl l="Total with tax"}{$orderCurrency} {$TOTAL_TAXED_AMOUNT - $POSTAGE}
    {intl l="Postage"}{$orderCurrency} {$POSTAGE}
    {intl l="Total"}{$orderCurrency} {$TOTAL_TAXED_AMOUNT}
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + +

    {intl l="Payment module"}

    + {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop} +

    {intl l="Total without tax"}

    {$orderCurrency} {$TOTAL_AMOUNT}

    {intl l="delivery module"}

    + {loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}

    {intl l="Total with tax"}

    {$orderCurrency} {$TOTAL_TAXED_AMOUNT - $POSTAGE}

    {intl l="Postage"}

    {$orderCurrency} {$POSTAGE}

    {intl l="Total"}

    {$orderCurrency} {$TOTAL_TAXED_AMOUNT}

    {/loop} -
    + \ No newline at end of file diff --git a/web/.htaccess b/web/.htaccess index 3840d727a..5c957964e 100755 --- a/web/.htaccess +++ b/web/.htaccess @@ -5,6 +5,10 @@ AddDefaultCharset UTF-8 RewriteEngine On + # If thelia is installed in a subdirectory (e.g., thelia2) + # define the RewriteBase below to get a proper URL rewriting + # RewriteBase /thelia2 + RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d diff --git a/web/index.php b/web/index.php index d3396e10e..4fbf52870 100644 --- a/web/index.php +++ b/web/index.php @@ -1,4 +1,15 @@ . */ -/* */ -/**********************************************************************************/ +/*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************/ use Thelia\Core\Thelia; use Thelia\Core\HttpFoundation\Response; diff --git a/web/install/bdd.php b/web/install/bdd.php index 8e9561876..50303f73a 100644 --- a/web/install/bdd.php +++ b/web/install/bdd.php @@ -32,8 +32,13 @@ if (isset($_POST['host']) && isset($_POST['username']) && isset($_POST['passwor $_SESSION['install']['port'] = $_POST['port']; $checkConnection = new \Thelia\Install\CheckDatabaseConnection($_POST['host'], $_POST['username'], $_POST['password'], $_POST['port']); + if(!$checkConnection->exec()) { + header('location: connection.php?err=1'); + exit; + } $databases = $checkConnection->getConnection()->query('SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA'); - if(! $checkConnection->exec() || $databases === false){ + + if(false === $databases){ header('location: connection.php?err=1'); exit; } diff --git a/web/robots.txt b/web/robots.txt index 8f5f570ab..8e180fe20 100644 --- a/web/robots.txt +++ b/web/robots.txt @@ -6,4 +6,4 @@ Disallow: /admin Disallow: /cart Disallow: /404 -#Sitemap: http://www.yourdomain.com/sitemap.xml \ No newline at end of file +#Sitemap: http://www.yourdomain.com/sitemap \ No newline at end of file