diff --git a/core/lib/Thelia/Controller/Admin/AttributeAvController.php b/core/lib/Thelia/Controller/Admin/AttributeAvController.php index 4ddf439a2..f4d35479b 100644 --- a/core/lib/Thelia/Controller/Admin/AttributeAvController.php +++ b/core/lib/Thelia/Controller/Admin/AttributeAvController.php @@ -141,7 +141,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/Core/Template/Loop/Order.php b/core/lib/Thelia/Core/Template/Loop/Order.php index 870ce2121..a6f0e2465 100644 --- a/core/lib/Thelia/Core/Template/Loop/Order.php +++ b/core/lib/Thelia/Core/Template/Loop/Order.php @@ -92,11 +92,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 +115,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 +178,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 +210,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 +244,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/Smarty/Plugins/Module.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php index 77715cad6..84e8c4c86 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php @@ -67,7 +67,7 @@ class Module extends AbstractSmartyPlugin 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); @@ -83,9 +83,14 @@ class Module extends AbstractSmartyPlugin $file = sprintf("%s/AdminIncludes/%s.html", $module->getAbsoluteBaseDir(), $location); if (file_exists($file)) { - $content .= file_get_contents($file); - $count++; + $output = trim(file_get_contents($file)); + + if (! empty($output)) { + $content .= $output; + + $count++; + } } } } diff --git a/templates/backOffice/default/category-edit.html b/templates/backOffice/default/category-edit.html index 02e48bc63..4d9682d7a 100644 --- a/templates/backOffice/default/category-edit.html +++ b/templates/backOffice/default/category-edit.html @@ -271,13 +271,8 @@ } - {module_include location='category-edit' countvar='module_count'} + {include file="includes/module-tab-content.html" location="category-edit"} - {if $module_count == 0} -
- {intl l="There is currently no active module here."} -
- {/if} diff --git a/templates/backOffice/default/content-edit.html b/templates/backOffice/default/content-edit.html index 3c238b8da..1dad037c3 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 $module_count == 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,7 +214,6 @@ form_content = {$smarty.capture.delete_folder_dialog nofilter} {javascripts file='assets/js/jquery-ui-1.10.3.custom.min.js'} {/javascripts} -