<span v-if="order.order_status_alias == 'canceled'" class="label label-danger" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-trash"></span></span> | <span v-if="order.order_status_alias == 'canceled'" class="label label-danger" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-trash"></span></span> | ||||
<span v-if="order.order_status_alias == 'updated'" class="label label-warning" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-pencil"></span></span> | <span v-if="order.order_status_alias == 'updated'" class="label label-warning" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-pencil"></span></span> | ||||
<span v-if="order.order_status_alias == 'ordered'" class="label label-success" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-check"></span></span> | <span v-if="order.order_status_alias == 'ordered'" class="label label-success" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-check"></span></span> | ||||
<span v-if="containUnactiveProduct(order)" class="glyphicon glyphicon-warning-sign" title="Cette commande contient un produit qui n'est pas activé"></span> | |||||
</td> | </td> | ||||
<td class="column-origin" v-html="order.labelOrigin"></td> | <td class="column-origin" v-html="order.labelOrigin"></td> | ||||
<td class="column-user"> | <td class="column-user"> | ||||
<strong><span class="glyphicon glyphicon-menu-right"></span> Produits</strong> | <strong><span class="glyphicon glyphicon-menu-right"></span> Produits</strong> | ||||
<ul> | <ul> | ||||
<li v-for="product in products" v-if="getProductDistribution(product) && order.productOrder[product.id].quantity > 0"> | <li v-for="product in products" v-if="getProductDistribution(product) && order.productOrder[product.id].quantity > 0"> | ||||
{{ product.name }} : {{ order.productOrder[product.id].quantity }} {{ order.productOrder[product.id].unit == 'piece' ? ' pièce(s)' : ' '+order.productOrder[product.id].unit }} <span v-if="getProductDistribution(product).active == 0" class="glyphicon glyphicon-warning-sign" title="Ce produit n'est pas activé"></span> | |||||
{{ product.name }} : {{ order.productOrder[product.id].quantity }} {{ order.productOrder[product.id].unit == 'piece' ? ' pièce(s)' : ' '+order.productOrder[product.id].unit }} | |||||
<span v-if="getProductDistribution(product).active == 0" class="glyphicon glyphicon-warning-sign" title="Ce produit n'est pas activé"></span> | |||||
</li> | </li> | ||||
</ul> | </ul> | ||||
<div v-if="order.comment && order.comment.length > 0" class="comment"> | <div v-if="order.comment && order.comment.length > 0" class="comment"> |
<?php endif; ?> | <?php endif; ?> | ||||
<?= $form->field($model, 'id_product_category')->dropDownList($productCategoryModule->populateProductCategoriesDropdownList()); ?> | <?= $form->field($model, 'id_product_category')->dropDownList($productCategoryModule->populateProductCategoriesDropdownList()); ?> | ||||
<?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?> | <?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?> | ||||
<?= $form->field($model, 'recipe')->textarea()->label('Description longue') ?> | |||||
<?= $form->field($model, 'recipe')->label('Description longue') | |||||
->widget(letyii\tinymce\Tinymce::class, [ | |||||
'configs' => [ | |||||
'plugins' => Yii::$app->parameterBag->get('tinyMcePlugins') | |||||
], | |||||
]); ?> | |||||
<?= $form->field($model, 'unit') | <?= $form->field($model, 'unit') | ||||
->dropDownList(ArrayHelper::map(Product::$unitsArray, 'unit', 'wording')) | ->dropDownList(ArrayHelper::map(Product::$unitsArray, 'unit', 'wording')) | ||||
->label('Unité (pièce, poids ou volume)'); ?> | ->label('Unité (pièce, poids ou volume)'); ?> |
$event.preventDefault(); | $event.preventDefault(); | ||||
navigator.clipboard.writeText(urlOrder); | navigator.clipboard.writeText(urlOrder); | ||||
appAlerts.alert('success', 'Lien vers la page de commande de la distribution copié.'); | appAlerts.alert('success', 'Lien vers la page de commande de la distribution copié.'); | ||||
return false; | |||||
}, | |||||
containUnactiveProduct: function(order) { | |||||
var app = this; | |||||
var product = null; | |||||
var productDistribution = false; | |||||
for(key in app.products) { | |||||
product = app.products[key]; | |||||
productDistribution = app.getProductDistribution(product); | |||||
if(productDistribution | |||||
&& order.productOrder[product.id].quantity > 0 | |||||
&& productDistribution.active == 0) { | |||||
return true; | |||||
} | |||||
} | |||||
return false; | return false; | ||||
} | } | ||||
}, | }, |
<div class="description-long" v-if="product.recipe.length"> | <div class="description-long" v-if="product.recipe.length"> | ||||
<a href="javascript:void(0);" class="show-more-link">En savoir | <a href="javascript:void(0);" class="show-more-link">En savoir | ||||
plus</a> | plus</a> | ||||
<div class="content"> | |||||
{{ product.recipe }} | |||||
<div class="content" v-html="product.recipe"> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</td> | </td> |
$html .= '<div class="description">' . Html::encode($model->description).'</div>'; | $html .= '<div class="description">' . Html::encode($model->description).'</div>'; | ||||
} | } | ||||
if (strlen($model->recipe)) { | if (strlen($model->recipe)) { | ||||
$html .= '<div class="description-long"><a href="javascript:void(0);" class="show-more-link">En savoir plus</a><div class="content">' . nl2br(Html::encode($model->recipe)).'</div></div>'; | |||||
$html .= '<div class="description-long"><a href="javascript:void(0);" class="show-more-link">En savoir plus</a><div class="content">' . $model->recipe .'</div></div>'; | |||||
} | } | ||||
return $html; | return $html; | ||||
} | } |