Recettes : on avance sur le BO (ajout des produits)
This commit is contained in:
@@ -36,6 +36,7 @@ class ProductsLoop extends BaseLoop implements PropelSearchLoopInterface
|
|||||||
foreach ($loopResult->getResultDataCollection() as $product) {
|
foreach ($loopResult->getResultDataCollection() as $product) {
|
||||||
|
|
||||||
$pse = ProductSaleElementsQuery::create()->findOneById($product->getPseId());
|
$pse = ProductSaleElementsQuery::create()->findOneById($product->getPseId());
|
||||||
|
$productId = $pse->getProductId();
|
||||||
$productLabel = ProductI18nQuery::create()->findOneById($pse->getProductId())->getTitle();
|
$productLabel = ProductI18nQuery::create()->findOneById($pse->getProductId())->getTitle();
|
||||||
$attributeCombination = AttributeCombinationQuery::create()->findOneByProductSaleElementsId($product->getPseId());
|
$attributeCombination = AttributeCombinationQuery::create()->findOneByProductSaleElementsId($product->getPseId());
|
||||||
$unity = AttributeAvI18nQuery::create()->findOneById($attributeCombination->getAttributeAvId())->getTitle();
|
$unity = AttributeAvI18nQuery::create()->findOneById($attributeCombination->getAttributeAvId())->getTitle();
|
||||||
@@ -45,6 +46,7 @@ class ProductsLoop extends BaseLoop implements PropelSearchLoopInterface
|
|||||||
$loopResultRow
|
$loopResultRow
|
||||||
->set("RECIPE_ID", $product->getRecipeId())
|
->set("RECIPE_ID", $product->getRecipeId())
|
||||||
->set("PSE_ID", $product->getPseId())
|
->set("PSE_ID", $product->getPseId())
|
||||||
|
->set("PRODUCT_ID", $productId)
|
||||||
->set("IN_STOCK", $inStock > 0)
|
->set("IN_STOCK", $inStock > 0)
|
||||||
->set("PRODUCT_LABEL", $productLabel)
|
->set("PRODUCT_LABEL", $productLabel)
|
||||||
->set("QUANTITY_NEEDED", $product->getQuantity())
|
->set("QUANTITY_NEEDED", $product->getQuantity())
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<table class="table table-condensed">
|
||||||
|
|
||||||
|
{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}
|
||||||
|
<tr>
|
||||||
|
<td>{$TITLE}<input type="hidden" value="{$PSE_ID}"</input></td>
|
||||||
|
<td>{$UNITY}</td>
|
||||||
|
<td>{$QUANTITY_PROPOSED}</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<a href="{url path='/admin/module/Recettes/remove-product/%recipeId/%pseId' recipeId=$recipe_id pseId=$PSE_ID}" class="delete-product"><i class="glyphicon glyphicon-trash"></i></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/loop}
|
||||||
|
{/loop}
|
||||||
|
{elseloop rel="products-loop"}
|
||||||
|
<tr>
|
||||||
|
<td colspan="99">
|
||||||
|
<div class="alert alert-info" style="margin-bottom:0">
|
||||||
|
Aucun produit n'est attaché à cette recette.
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/elseloop}
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<input class="form-control" type="text" id="product_ref" autocomplete="off" data-content-id="{$content_id}" placeholder="Indiquez une référence de produit">
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<a href="{url path='/admin/module/Recettes/add-product/%recipeId' recipeId=$recipe_id}" class="btn btn-sm btn-primary add-product"><i class="glyphicon glyphicon-plus-sign"></i></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
@@ -44,8 +44,9 @@
|
|||||||
{form_error form=$form field="summary"}{$message}{/form_error}
|
{form_error form=$form field="summary"}{$message}{/form_error}
|
||||||
{/form_field}
|
{/form_field}
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
{form_field form=$form field="difficulty"}
|
{form_field form=$form field="difficulty"}
|
||||||
<div class="form-group form-inline">
|
<div class="col-md-6 form-group form-inline">
|
||||||
<label class="control-label" for="{$label_attr.for}">
|
<label class="control-label" for="{$label_attr.for}">
|
||||||
{intl l=$label d='recettes'}
|
{intl l=$label d='recettes'}
|
||||||
{if $required}<span class="required">*</span>{/if}
|
{if $required}<span class="required">*</span>{/if}
|
||||||
@@ -59,9 +60,8 @@
|
|||||||
{form_error form=$form field="difficulty"}{$message}{/form_error}
|
{form_error form=$form field="difficulty"}{$message}{/form_error}
|
||||||
{/form_field}
|
{/form_field}
|
||||||
|
|
||||||
|
|
||||||
{form_field form=$form field="people"}
|
{form_field form=$form field="people"}
|
||||||
<div class="form-group form-inline">
|
<div class="col-md-6 form-group form-inline">
|
||||||
<label class="control-label" for="{$label_attr.for}">
|
<label class="control-label" for="{$label_attr.for}">
|
||||||
{intl l=$label d='recettes'}
|
{intl l=$label d='recettes'}
|
||||||
{if $required}<span class="required">*</span>{/if}
|
{if $required}<span class="required">*</span>{/if}
|
||||||
@@ -70,10 +70,11 @@
|
|||||||
</div>
|
</div>
|
||||||
{form_error form=$form field="people"}{$message}{/form_error}
|
{form_error form=$form field="people"}{$message}{/form_error}
|
||||||
{/form_field}
|
{/form_field}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
{form_field form=$form field="preparation_time"}
|
{form_field form=$form field="preparation_time"}
|
||||||
<div class="form-group form-inline">
|
<div class="col-md-6 form-group form-inline">
|
||||||
<label class="control-label" for="{$label_attr.for}">
|
<label class="control-label" for="{$label_attr.for}">
|
||||||
{intl l=$label d='recettes'}
|
{intl l=$label d='recettes'}
|
||||||
{if $required}<span class="required">*</span>{/if}
|
{if $required}<span class="required">*</span>{/if}
|
||||||
@@ -86,7 +87,7 @@
|
|||||||
|
|
||||||
|
|
||||||
{form_field form=$form field="cooking_time"}
|
{form_field form=$form field="cooking_time"}
|
||||||
<div class="form-group form-inline">
|
<div class="col-md-6 form-group form-inline">
|
||||||
<label class="control-label" for="{$label_attr.for}">
|
<label class="control-label" for="{$label_attr.for}">
|
||||||
{intl l=$label d='recettes'}
|
{intl l=$label d='recettes'}
|
||||||
{if $required}<span class="required">*</span>{/if}
|
{if $required}<span class="required">*</span>{/if}
|
||||||
@@ -96,6 +97,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{form_error form=$form field="cooking_time"}{$message}{/form_error}
|
{form_error form=$form field="cooking_time"}{$message}{/form_error}
|
||||||
{/form_field}
|
{/form_field}
|
||||||
|
</div>
|
||||||
|
|
||||||
{form_field form=$form field="other_ingredients"}
|
{form_field form=$form field="other_ingredients"}
|
||||||
<div class="form-group form-inline">
|
<div class="form-group form-inline">
|
||||||
@@ -110,14 +112,16 @@
|
|||||||
{/form_field}
|
{/form_field}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4 form-group">
|
||||||
<table class="table table-striped">
|
<label class="control-label">Produits attachés</label>
|
||||||
<thead>
|
<div id="related-products-block">
|
||||||
<th>{intl l="Product" d="recettes"}</th>
|
{include file='ajax/related-products.html'}
|
||||||
<th>{intl l="Quantity" d="recettes"}</th>
|
</div>
|
||||||
</thead>
|
<br>
|
||||||
<tbody></tbody>
|
<label class="control-label">Etapes de la recette</label>
|
||||||
</table>
|
<div id="steps-block">
|
||||||
|
{include file='ajax/steps.html'}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
Reference in New Issue
Block a user