</div>
</div>
<div class="col-lg-7">
<div class="row">
<?php
echo BaseHtml::activeCheckboxList($model, 'participantsId', ArrayHelper::map($participants, function ($item) {
/** @var $item \common\models\vks\Participant */
return (string) $item->primaryKey;
}, 'name'), ['item' => function ($index, $label, $name, $checked, $value) use($participants) {
/** @var Participant $participant */
$participant = $participants[$index];
$defaultOptions = ['value' => $value, 'data' => ['company-id' => (string) $participant->companyId]];
$label .= $participant->ahuConfirmation ? ' <span class="glyphicon glyphicon-star text-warning"></span>' : '';
$options = array_merge_recursive($defaultOptions, $participant->isBusy ? ['label' => $label . '<p><small>занято с ' . MinuteFormatter::asString($participant->busyFrom) . ' до ' . MinuteFormatter::asString($participant->busyTo) . '</small></p>', 'labelOptions' => ['class' => 'disabled'], 'disabled' => true] : ['label' => $label, 'data' => ['name' => $participant->name, 'short-name' => $participant->shortName, 'company-name' => $participant->company->name, 'contact' => $participant->contact, 'ip-address' => $participant->ipAddress]]);
$tooltip = $participant->ahuConfirmation ? ['data' => ['toggle' => 'tooltip', 'html' => true, 'placement' => 'top', 'container' => '#vks-participants', 'title' => Html::tag('div', 'Бронь необходимо согласовать с') . Html::tag('div', $participant->confirmPerson->fullName) . Html::tag('div', $participant->confirmPerson->post) . Html::tag('div', 'тел: ' . $participant->confirmPerson->phone . ', ' . $participant->confirmPerson->email)]] : [];
return Html::beginTag('div', array_merge(['class' => 'col-lg-4 vks-room', 'style' => 'display:none'], $tooltip)) . Html::checkbox($name, $checked, $options) . Html::endTag('div');
}]);
?>
</div>
</div>
</div>
</div>