@@ -103,10 +103,25 @@ $this->addButton(['label' => '+', 'url' => 'subscription/create', 'class' => 'bt | |||
], | |||
[ | |||
'attribute' => 'date_begin', | |||
'label' => 'Date de début', | |||
'label' => 'Période', | |||
'format' => 'raw', | |||
'value' => function($model) { | |||
$html = date('d/m/Y',strtotime($model->date_begin)) ; | |||
$html = '<small>' ; | |||
if($model->date_end) { | |||
$html .= 'Du ' ; | |||
} | |||
else { | |||
$html .= 'À partir du ' ; | |||
} | |||
$html .= '</small>' ; | |||
$html .= date('d/m/Y',strtotime($model->date_begin)) ; | |||
if($model->date_end) { | |||
$html .= '<br />au '.date('d/m/Y',strtotime($model->date_end)) ; | |||
if(date('Y-m-d') > $model->date_end) { | |||
$html .= ' <span class="label label-danger">Terminé</span>' ; | |||
} | |||
} | |||
return $html ; | |||
} | |||
], |
@@ -321,7 +321,7 @@ class Subscription extends ActiveRecordCommon | |||
] ; | |||
$nbDays = (strtotime($date) - strtotime($this->date_begin)) / (24 * 60 * 60); | |||
if ($nbDays % ($this->week_frequency * 7) < 7) { | |||
if (round($nbDays) % ($this->week_frequency * 7) < 7) { | |||
$numDay = date('N', strtotime($date)); | |||
$day = $arrayDays[$numDay] ; | |||
if ($this->$day) { |
@@ -1287,7 +1287,7 @@ termes. | |||
display: block; | |||
} | |||
/* line 11, ../sass/order/_order.scss */ | |||
.order-order #app-order-order #order-distribution-date { | |||
.order-order #app-order-order #distribution-date { | |||
display: none; | |||
} | |||
/* line 15, ../sass/order/_order.scss */ |
@@ -8,7 +8,7 @@ | |||
display: block ; | |||
} | |||
#order-distribution-date { | |||
#distribution-date { | |||
display: none ; | |||
} | |||