diff --git a/local/modules/Recettes/Loop/ProductsLoop.php b/local/modules/Recettes/Loop/ProductsLoop.php index 1fcabbdb..33ec5f65 100644 --- a/local/modules/Recettes/Loop/ProductsLoop.php +++ b/local/modules/Recettes/Loop/ProductsLoop.php @@ -36,6 +36,7 @@ class ProductsLoop extends BaseLoop implements PropelSearchLoopInterface foreach ($loopResult->getResultDataCollection() as $product) { $pse = ProductSaleElementsQuery::create()->findOneById($product->getPseId()); + $productId = $pse->getProductId(); $productLabel = ProductI18nQuery::create()->findOneById($pse->getProductId())->getTitle(); $attributeCombination = AttributeCombinationQuery::create()->findOneByProductSaleElementsId($product->getPseId()); $unity = AttributeAvI18nQuery::create()->findOneById($attributeCombination->getAttributeAvId())->getTitle(); @@ -45,6 +46,7 @@ class ProductsLoop extends BaseLoop implements PropelSearchLoopInterface $loopResultRow ->set("RECIPE_ID", $product->getRecipeId()) ->set("PSE_ID", $product->getPseId()) + ->set("PRODUCT_ID", $productId) ->set("IN_STOCK", $inStock > 0) ->set("PRODUCT_LABEL", $productLabel) ->set("QUANTITY_NEEDED", $product->getQuantity()) diff --git a/local/modules/Recettes/templates/backOffice/default/ajax/related-products.html b/local/modules/Recettes/templates/backOffice/default/ajax/related-products.html new file mode 100644 index 00000000..cb5b6bd0 --- /dev/null +++ b/local/modules/Recettes/templates/backOffice/default/ajax/related-products.html @@ -0,0 +1,37 @@ + + + {loop type="recipe" name="recipe-loop" content_id=$content_id limit="1"} + {assign var="recipe_id" value="$ID"} + {/loop} + + {loop type="recipe_products" name="products-loop" recipe_id=$recipe_id} + {loop type="product" visible='*' name="related-product" id=$PRODUCT_ID} + + + + + + + {/loop} + {/loop} + {elseloop rel="products-loop"} + + + + {/elseloop} + + + + + +
{$TITLE}{$UNITY}{$QUANTITY_PROPOSED} + +
+
+ Aucun produit n'est attaché à cette recette. +
+
+ + + +
diff --git a/local/modules/Recettes/templates/backOffice/default/ajax/steps.html b/local/modules/Recettes/templates/backOffice/default/ajax/steps.html new file mode 100644 index 00000000..e69de29b diff --git a/local/modules/Recettes/templates/backOffice/default/recette-tab.html b/local/modules/Recettes/templates/backOffice/default/recette-tab.html index 8109eb74..6f2903f2 100644 --- a/local/modules/Recettes/templates/backOffice/default/recette-tab.html +++ b/local/modules/Recettes/templates/backOffice/default/recette-tab.html @@ -44,58 +44,60 @@ {form_error form=$form field="summary"}{$message}{/form_error} {/form_field} - {form_field form=$form field="difficulty"} -
- - +
+ {form_field form=$form field="difficulty"} +
+ + +
+ {form_error form=$form field="difficulty"}{$message}{/form_error} + {/form_field} + + {form_field form=$form field="people"} +
+ +   +
+ {form_error form=$form field="people"}{$message}{/form_error} + {/form_field}
- {form_error form=$form field="difficulty"}{$message}{/form_error} - {/form_field} + +
+ {form_field form=$form field="preparation_time"} +
+ +   + {$label_attr.help} +
+ {form_error form=$form field="preparation_time"}{$message}{/form_error} + {/form_field} - {form_field form=$form field="people"} -
- -   + {form_field form=$form field="cooking_time"} +
+ +   + {$label_attr.help} +
+ {form_error form=$form field="cooking_time"}{$message}{/form_error} + {/form_field}
- {form_error form=$form field="people"}{$message}{/form_error} - {/form_field} - - - {form_field form=$form field="preparation_time"} -
- -   - {$label_attr.help} -
- {form_error form=$form field="preparation_time"}{$message}{/form_error} - {/form_field} - - - {form_field form=$form field="cooking_time"} -
- -   - {$label_attr.help} -
- {form_error form=$form field="cooking_time"}{$message}{/form_error} - {/form_field} {form_field form=$form field="other_ingredients"}
@@ -110,14 +112,16 @@ {/form_field}
-
- - - - - - -
{intl l="Product" d="recettes"}{intl l="Quantity" d="recettes"}
+
+ + +
+ +
+ {include file='ajax/steps.html'} +