Hi, I can't update to the last version yet, so can i updade the code to fix it?
If so, what changes do I need to perform? See if I miising something or there is other possibility please
In the file apps/customer/views/campaigns/step-confirm.php I need to change the lines 143, 144, 145 to:
<?php echo $form->labelEx($campaign, 'send_between_interval'); ?>
<?php echo $form->dropDownList($campaign, 'send_between_interval', CMap::mergeArray(['' => t('app', 'Choose')], $campaign->getSendBetweenIntervalsList()), $campaign->fieldDecorator->getHtmlOptions('send_between_interval', ['class' => 'form-control select2', 'style' => 'width: 100%'])); ?>
<?php echo $form->error($campaign, 'send_between_interval'); ?>
In the file apps/common/models/Campaign.php i need to create 2 functions:
public function getSendBetweenHoursList(): array
{
$time = (Carbon\Carbon::now())->setTime(0, 0);
$list = [];
for ($i = 1; $i <= 24; $i++) {
try {
$key = $time->format('H:i:s');
$value = $this->dateTimeFormatter->formatLocalizedTime($time->format('Y-m-d H:i:s'));
$list[$key] = $value;
} catch (Exception $e) {
Yii::log($e->getMessage(), CLogger::LEVEL_ERROR);
}
$time = $time->addHour();
}
return $list;
}
/**
* @return array
*/
public function getSendBetweenIntervalsList(): array
{
$list = [];
for ($i = 1; $i <= 23; $i++) {
$list[$i] = t('app', '{n} hour|{n} hours', $i);
}
return $list;
}
Also the field
send_between_end in the table
mw_campaign needs to be changed?