From d6fb101a47828070b6109227dc27c3374d318ad9 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Sat, 28 Dec 2013 10:06:55 +0100 Subject: [PATCH 01/10] Use $parent instead of $folder_id in folders admin template --- templates/backOffice/default/folders.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/backOffice/default/folders.html b/templates/backOffice/default/folders.html index b8e8e27fc..286270abc 100755 --- a/templates/backOffice/default/folders.html +++ b/templates/backOffice/default/folders.html @@ -182,7 +182,7 @@ {* -- CONTENT MANAGEMENT ---------------------------------------------------- *} {* No content outsie a folder *} - {if $folder_id > 0} + {if $parent > 0}
@@ -636,4 +636,4 @@ {block name="javascript-last-call"} {module_include location='folders-js'} -{/block} \ No newline at end of file +{/block} From f939e30fb72bcbfbd1d5e34817515e00c082159c Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Sat, 28 Dec 2013 10:27:18 +0100 Subject: [PATCH 02/10] uncomment needed return statement --- core/lib/Thelia/Controller/Admin/AbstractCrudController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/Thelia/Controller/Admin/AbstractCrudController.php b/core/lib/Thelia/Controller/Admin/AbstractCrudController.php index 028d5ab15..d8574a91b 100644 --- a/core/lib/Thelia/Controller/Admin/AbstractCrudController.php +++ b/core/lib/Thelia/Controller/Admin/AbstractCrudController.php @@ -444,7 +444,7 @@ abstract class AbstractCrudController extends BaseAdminController ); - //return $this->renderEditionTemplate(); + return $this->renderEditionTemplate(); } /** From 39f35c89f106eba15a8736e9dbb287226c900488 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Sat, 28 Dec 2013 10:47:41 +0100 Subject: [PATCH 03/10] add missing value in folder modification form --- templates/backOffice/default/folder-edit.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/backOffice/default/folder-edit.html b/templates/backOffice/default/folder-edit.html index ea82e78ce..904ce524d 100755 --- a/templates/backOffice/default/folder-edit.html +++ b/templates/backOffice/default/folder-edit.html @@ -63,6 +63,10 @@ {/form_field} + {form_field form=$form field='locale'} + + {/form_field} + {* Display error message if exist *} {include file='includes/notifications.html' message=$form_error_message} @@ -351,4 +355,4 @@ {block name="javascript-last-call"} {module_include location='folder-edit-js'} -{/block} \ No newline at end of file +{/block} From b257b16285dc30339e525ed4baef211ced238a77 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Sat, 28 Dec 2013 11:05:42 +0100 Subject: [PATCH 04/10] uncomment needed loop for parent folder --- templates/backOffice/default/folder-edit.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/backOffice/default/folder-edit.html b/templates/backOffice/default/folder-edit.html index 904ce524d..a10c4b714 100755 --- a/templates/backOffice/default/folder-edit.html +++ b/templates/backOffice/default/folder-edit.html @@ -88,9 +88,9 @@ {$myparent=$PARENT} - {* loop name="fold-parent" type="folder-tree" visible="*" folder="0"} + {loop name="fold-parent" type="folder-tree" visible="*" folder="0"} - {/loop *} + {/loop}
From 652b1e02d14101f1178decafbdf0a0b2c3143472 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 31 Dec 2013 09:15:21 +0100 Subject: [PATCH 05/10] start a new section in changelog file --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec425be8a..f4caa6979 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ - http://www.mnot.net/cache_docs/ (fr) - http://tomayko.com/writings/things-caches-do (en) - http://symfony.com/doc/current/book/http_cache.html#http-cache-introduction (en and fr) + +#2.0.0-beta3 - Coupon effect inputs are now more customisable (input text, select, ajax, etc.. are usable) and unlimited amount of input for coupon effect are now possible too From a06dd9916c38225dbcbbbdddfa733b3ad1a56bcc Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 31 Dec 2013 09:22:30 +0100 Subject: [PATCH 06/10] put at the beginning of changelog file the new features --- CHANGELOG.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4caa6979..53b20dd27 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +#2.0.0-beta3 +- Coupon effect inputs are now more customisable (input text, select, ajax, etc.. are usable) and unlimited amount of input for coupon effect are now possible too + #2.0.0-beta2 - http://doc.thelia.net is available in beta. @@ -24,9 +27,4 @@ - resources : - http://www.mnot.net/cache_docs/ (fr) - http://tomayko.com/writings/things-caches-do (en) - - http://symfony.com/doc/current/book/http_cache.html#http-cache-introduction (en and fr) - -#2.0.0-beta3 -- Coupon effect inputs are now more customisable (input text, select, ajax, etc.. are usable) and unlimited amount of input for coupon effect are now possible too - - + - http://symfony.com/doc/current/book/http_cache.html#http-cache-introduction (en and fr) \ No newline at end of file From 6057c69f95a06ce6c824cd52dc6946f02e98a0ad Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 2 Jan 2014 10:07:51 +0100 Subject: [PATCH 07/10] session parameter is needed on TaxEngine::getInstance method --- core/lib/Thelia/Form/TaxCreationForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/Thelia/Form/TaxCreationForm.php b/core/lib/Thelia/Form/TaxCreationForm.php index 65617e615..001bb3cf8 100644 --- a/core/lib/Thelia/Form/TaxCreationForm.php +++ b/core/lib/Thelia/Form/TaxCreationForm.php @@ -40,7 +40,7 @@ class TaxCreationForm extends BaseForm protected function buildForm($change_mode = false) { - $types = TaxEngine::getInstance()->getTaxTypeList(); + $types = TaxEngine::getInstance($this->getRequest()->getSession())->getTaxTypeList(); $typeList = array(); $requirementList = array(); foreach ($types as $type) { From b992cc8488ca22ab5aa0571d3c437d418ab3cf0a Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 2 Jan 2014 10:30:24 +0100 Subject: [PATCH 08/10] delete all sub categories on category removal, fix issue #150 --- core/lib/Thelia/Model/Category.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php index 8f1dd8eb4..9108c159e 100755 --- a/core/lib/Thelia/Model/Category.php +++ b/core/lib/Thelia/Model/Category.php @@ -121,6 +121,15 @@ class Category extends BaseCategory { $this->markRewritenUrlObsolete(); + //delete all subcategories + $subCategories = CategoryQuery::findAllChild($this->getId()); + + foreach($subCategories as $category) { + $category->setDispatcher($this->getDispatcher()); + + $category->delete(); + } + $this->dispatchEvent(TheliaEvents::AFTER_DELETECATEGORY, new CategoryEvent($this)); } } \ No newline at end of file From cf255a6a9ceb5038c1c7b0b4299d6a2ac6a2418e Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 2 Jan 2014 13:02:11 +0100 Subject: [PATCH 09/10] delete product on category removal. delete only when it's the default category. Fix issue #151 --- core/lib/Thelia/Model/Category.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php index 9108c159e..3924f4a99 100755 --- a/core/lib/Thelia/Model/Category.php +++ b/core/lib/Thelia/Model/Category.php @@ -5,6 +5,7 @@ namespace Thelia\Model; use Thelia\Core\Event\Category\CategoryEvent; use Thelia\Model\Base\Category as BaseCategory; use Propel\Runtime\ActiveQuery\Criteria; +use Thelia\Model\ProductCategoryQuery; use Thelia\Tools\URL; use Thelia\Core\Event\TheliaEvents; use Propel\Runtime\Connection\ConnectionInterface; @@ -62,6 +63,22 @@ class Category extends BaseCategory $query->filterByParent($this->getParent()); } + public function deleteProducts(ConnectionInterface $con = null) + { + $productsCategories = ProductCategoryQuery::create() + ->filterByCategoryId($this->getId()) + ->filterByDefaultCategory(1) + ->find($con); + + if($productsCategories) { + foreach ($productsCategories as $productCategory) { + $product = $productCategory->getProduct(); + + $product->delete($con); + } + } + } + /** * {@inheritDoc} */ @@ -111,6 +128,7 @@ class Category extends BaseCategory "parent" => $this->getParent(), ) ); + $this->deleteProducts($con); return true; } From c671b3f93be88668f05a8b4773b662c4d2d4f8ee Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 2 Jan 2014 13:05:58 +0100 Subject: [PATCH 10/10] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53b20dd27..b299c0bb4 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ #2.0.0-beta3 - Coupon effect inputs are now more customisable (input text, select, ajax, etc.. are usable) and unlimited amount of input for coupon effect are now possible too +- when a category is deleted, all subcategories are deleted +- delete products when categories are removed. Works only when the category is the default one for this product #2.0.0-beta2