if (preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $date) && | if (preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $date) && | ||||
($idUser || strlen($username)) && | ($idUser || strlen($username)) && | ||||
$pointSale && | $pointSale && | ||||
count($products) && | |||||
count(get_object_vars($products)) && | |||||
$distribution) { | $distribution) { | ||||
$order = new Order; | $order = new Order; |
} ?> | } ?> | ||||
<?php | <?php | ||||
if(count($this->buttons)) { | |||||
if($this->buttons && count($this->buttons)) { | |||||
foreach($this->buttons as $button) { | foreach($this->buttons as $button) { | ||||
echo '<a href="'.Yii::$app->urlManagerBackend->createUrl($button['url']).'" class="'.$button['class'].'">'.$button['label'].'</a>' ; | echo '<a href="'.Yii::$app->urlManagerBackend->createUrl($button['url']).'" class="'.$button['class'].'">'.$button['label'].'</a>' ; | ||||
} | } |
} | } | ||||
if($this->type == self::TYPE_PAYMENT || $this->type == self::TYPE_REFUND) { | if($this->type == self::TYPE_PAYMENT || $this->type == self::TYPE_REFUND) { | ||||
if(isset($this->order)) { | |||||
if(isset($this->order) && isset($this->order->distribution)) { | |||||
$str .= '<br />Commande : '.date('d/m/Y',strtotime($this->order->distribution->date)) ; | $str .= '<br />Commande : '.date('d/m/Y',strtotime($this->order->distribution->date)) ; | ||||
} | } | ||||
else { | else { |
public function isOnlinePaymentActive() | public function isOnlinePaymentActive() | ||||
{ | { | ||||
return $this->online_payment || ($this->option_stripe_mode_test && Yii::$app->user->identity->status > 10); | |||||
return $this->online_payment || ($this->option_stripe_mode_test && !Yii::$app->user->isGuest && Yii::$app->user->identity->status > 10); | |||||
} | } | ||||
public function isOnlinePaymentActiveAndTypeOrder() | public function isOnlinePaymentActiveAndTypeOrder() |
namespace common\models; | namespace common\models; | ||||
use Yii ; | |||||
use yii\base\Object; | |||||
use common\components\ActiveRecordCommon ; | use common\components\ActiveRecordCommon ; | ||||
/** | /** |
"codeception/codeception": "^2.3" | "codeception/codeception": "^2.3" | ||||
}, | }, | ||||
"config": { | "config": { | ||||
"process-timeout": 1800 | |||||
"process-timeout": 1800, | |||||
"allow-plugins": { | |||||
"yiisoft/yii2-composer": true | |||||
} | |||||
}, | }, | ||||
"extra": { | "extra": { | ||||
"asset-installer-paths": { | "asset-installer-paths": { |
<h2 id="page-title"> | <h2 id="page-title"> | ||||
<?= $this->getTitle(); ?> | <?= $this->getTitle(); ?> | ||||
<?php | <?php | ||||
if (count($this->buttons)): ?> | |||||
if ($this->buttons && count($this->buttons)): ?> | |||||
<span id="buttons"> | <span id="buttons"> | ||||
<?php foreach ($this->buttons as $button) { | <?php foreach ($this->buttons as $button) { | ||||
echo '<a href="' . Yii::$app->urlManagerProducer->createUrl($button['url']) . '" class="' . $button['class'] . '">' . $button['label'] . '</a>'; | echo '<a href="' . Yii::$app->urlManagerProducer->createUrl($button['url']) . '" class="' . $button['class'] . '">' . $button['label'] . '</a>'; |
#!/usr/bin/env bash | #!/usr/bin/env bash | ||||
sudo chown fab:www-data frontend/runtime/ -R | |||||
sudo chown guillaume:www-data . -R | |||||
sudo chown guillaume:www-data frontend/runtime/ -R | |||||
chmod 775 frontend/runtime/ | chmod 775 frontend/runtime/ | ||||
sudo chown fab:www-data frontend/web/assets/ -R | |||||
sudo chown guillaume:www-data frontend/web/assets/ -R | |||||
sudo chmod 775 frontend/web/assets/ -R | sudo chmod 775 frontend/web/assets/ -R | ||||
sudo chown fab:www-data backend/runtime/ -R | |||||
sudo chown guillaume:www-data backend/runtime/ -R | |||||
sudo chmod 775 backend/runtime/ -R | sudo chmod 775 backend/runtime/ -R | ||||
sudo chown fab:www-data backend/web/assets/ -R | |||||
sudo chown guillaume:www-data backend/web/assets/ -R | |||||
sudo chmod 775 backend/web/assets/ -R | sudo chmod 775 backend/web/assets/ -R |